/* ===============================
   Bundle Products Grid Layout
   =============================== */
@media (min-width: 1024px) {
  .bundled_products.columns-3 .product {
    width: 33.33333333%;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .bundled_products.columns-3 .product {
    width: 50%;
  }
}

.bundled_products {
  display: flex;
  flex-wrap: wrap;
  margin-left: -15px;
  margin-right: -15px;
  row-gap: 24px;
}

.bundled_products .product {
  padding-left: 15px;
  padding-right: 15px;
  width: 100%;
}

/* ===============================
   Bundle Item Card Style
   =============================== */
.bundle_form div.bundled_product_summary {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e6e6e6;
  padding: 18px 16px 16px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.bundle_form div.bundled_product_summary .bundled_product_images {
  margin-bottom: 12px;
}

.bundle_form div.bundled_product_summary .details {
  margin-top: 6px;
}

/* ===============================
   Typography (Titles)
   =============================== */
/* Base bundled product title */
.bundle_form div.bundled_product_summary .bundled_product_title,
.bundle_form div.bundled_product_summary .bundled_product_title a {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

/* Reduced main product page title */
.product_title.entry-title {
  font-size: 24px !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  margin-bottom: 18px !important;
  text-align: left !important;
}

/* Reduced bundled product titles (override) */
.bundle_form .bundled_product_title,
.bundle_form .bundled_product_title a {
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  text-align: left !important;
}

/* ===============================
   Variations Area
   =============================== */
.bundle_form .bundled_item_cart_details {
  margin-top: 10px;
}

.bundle_form .bundled_item_cart_details label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.bundle_form .bundled_item_cart_details select {
  width: 100%;
}

/* Reset variations link tweaks */
.bundle_form .bundled_item_cart_details .reset_variations {
  display: block !important;
  text-align: left !important;
  margin-top: 6px !important;
  font-size: 12px !important;
}

/* ===============================
   Layout & Spacing Tweaks
   =============================== */
/* Force left alignment for all bundle card content */
.bundle_form div.bundled_product_summary,
.bundle_form div.bundled_product_summary * {
  text-align: left !important;
}

/* Left align variation table content */
ul.bundled_products table.variations td,
ul.bundled_products table.variations td * {
  text-align: left !important;
}

/* Remove product short description */
.bundle_form .bundled_product_summary .details .bundled_product_excerpt {
  display: none !important;
}

/* Reduce details spacing (override) */
.bundle_form div.bundled_product_summary .details {
  margin-top: 4px !important;
}

/* Remove list styles for bundled products */
ul.bundled_products,
ul.bundled_products li {
  list-style: none !important;
}

/* Hide extra cart details area */
.bundle_form .bundled_item_after_cart_details,
.woocommerce-variation-add-to-cart.variations_button.bundled_item_after_cart_details {
  display: none !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ===============================
   WooCommerce Notifications
   =============================== */
.single-product .woocommerce-info,
.single-product .woocommerce-message,
.single-product .woocommerce-error {
  background-color: #f2f2f2 !important;
  border-top-color: #cccccc !important;
  color: #333333 !important;
}

/* ===============================
   Add to Cart Button & Quantity
   =============================== */
/* Base button style (including disabled state) */
.single-product .bundle_data .bundle_button button,
.single-product .bundle_data .bundle_button button.disabled,
.single-product .single_add_to_cart_button,
.single-product .single_add_to_cart_button.button {
  background-color: #000000 !important;
  border-color: #000000 !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Button hover state (only when enabled) */
.single-product .bundle_data .bundle_button button:not(.disabled):hover,
.single-product .single_add_to_cart_button:not(.disabled):hover,
.single-product .single_add_to_cart_button.button:not(.disabled):hover {
  background-color: #777777 !important;
  border-color: #777777 !important;
  color: #ffffff !important;
}

/* Quantity input & buttons sizing */
.single-product .quantity input.qty {
  height: 42px !important;
  line-height: 42px !important;
  padding: 0 !important;
  text-align: center;
}

.single-product .quantity .minus,
.single-product .quantity .plus {
  height: 42px !important;
  width: 32px !important;
  line-height: 42px !important;
  padding: 0 !important;
}

/* Cart form layout (base) */
.single-product .cart .quantity {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
}

.single-product form.cart {
  display: flex !important;
  align-items: center !important;
  column-gap: 10px !important;
}

/* Cart form layout (override) */
.single-product form.cart .quantity {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
}

/* Cart form layout (single product specific) */
.single-product div.product form.cart {
  display: flex !important;
  align-items: stretch !important;
  column-gap: 12px !important;
}

/* Quantity wrapper (inline flex) */
.single-product div.product form.cart .quantity {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
}

/* Quantity controls (unified height) */
.single-product div.product form.cart .quantity .minus,
.single-product div.product form.cart .quantity .plus,
.single-product div.product form.cart .quantity input.qty {
  height: 44px !important;
  line-height: 44px !important;
  padding: 0 !important;
}

/* Quantity input width & alignment */
.single-product div.product form.cart .quantity input.qty {
  width: 48px !important;
  text-align: center !important;
}

/* Add to Cart button sizing & alignment */
.single-product div.product form.cart .single_add_to_cart_button {
  height: 44px !important;
  line-height: 44px !important;
  padding: 0 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ===============================
   Bundle Price Styling
   =============================== */
/* Base bundle price */
.single-product .bundle_price,
.single-product .bundle_price .woocommerce-Price-amount {
  font-size: 36px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

/* Sale price (highlighted) */
.single-product .bundle_price ins .woocommerce-Price-amount {
  font-size: 38px !important;
  font-weight: 800 !important;
}

/* Original price (strikethrough) */
.single-product .bundle_price del .woocommerce-Price-amount {
  font-size: 20px !important;
  opacity: 0.6 !important;
}

/* ===============================
   Price Order (Sale First)
   =============================== */
/* Bundle price order */
.single-product .bundle_price {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.single-product .bundle_price del {
  order: 2 !important; /* Original price last */
}

.single-product .bundle_price ins {
  order: 1 !important; /* Sale price first */
}

/* Default WooCommerce price order (fallback) */
.single-product .price {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.single-product .price del {
  order: 2 !important;
}

.single-product .price ins {
  order: 1 !important;
}

/* Force bundled product titles to two lines only */
.bundle_form .bundled_product_title,
.bundle_form .bundled_product_title a {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;   /* limit to 2 lines */
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    height: 40px !important;            /* Keep cards aligned */
    line-height: 1.3 !important;
}
