/* Product Page Fix v6 — Full mobile + desktop cleanup */

/* ===== MOBILE ===== */
@media(max-width:767px) {
  /* Full width — zero margins, edge to edge */
  .single-product .col-full {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .single-product .content-area,
  .single-product #primary,
  .single-product .product,
  .single-product .product-details-wrapper {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Stack layout */
  .product-details-wrapper { display: block !important; }

  /* Gallery full width */
  .product-details-wrapper .woocommerce-product-gallery {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 0 8px !important;
  }
  .product-details-wrapper .woocommerce-product-gallery .woocommerce-product-gallery__image img,
  .product-details-wrapper .woocommerce-product-gallery .flex-viewport img {
    width: 100% !important;
    height: auto !important;
    border-radius: 0 !important;
    object-fit: cover !important;
  }

  /* Thumbnails — proper aspect ratio, no distortion */
  .product-details-wrapper .woocommerce-product-gallery .flex-control-thumbs {
    display: flex !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }
  .product-details-wrapper .woocommerce-product-gallery .flex-control-thumbs li {
    flex: 0 0 70px !important;
    width: 70px !important;
    list-style: none !important;
  }
  .product-details-wrapper .woocommerce-product-gallery .flex-control-thumbs li img {
    width: 70px !important;
    height: 93px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
    aspect-ratio: 3/4 !important;
  }

  /* Summary section — small side padding for text readability */
  .product-details-wrapper .summary.entry-summary {
    width: 100% !important;
    padding: 0 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  /* Product title */
  .single-product .product_title {
    font-size: 22px !important;
    margin-bottom: 4px !important;
    line-height: 1.3 !important;
  }

  /* Hide quantity selector on variable products */
  .single-product .variations_form .quantity,
  .single-product .woocommerce-variation-add-to-cart .quantity {
    display: none !important;
  }

  /* Variations selects — full width, compact, clean */
  .single-product form.cart { margin: 0 !important; padding: 0 !important; }
  .single-product .variations { margin-bottom: 4px !important; }
  .single-product .variations td,
  .single-product .variations th {
    display: block !important;
    width: 100% !important;
    padding: 2px 0 !important;
  }
  .single-product .variations th label {
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 2px !important;
  }
  .single-product .variations select {
    width: 100% !important;
    height: 48px !important;
    padding: 0 40px 0 14px !important;
    color: #1A1A1A !important;
    font-size: 15px !important;
    font-family: 'DM Sans', sans-serif !important;
    line-height: 48px !important;
    border: 1px solid #C4B5A8 !important;
    border-radius: 6px !important;
    background-color: #fff !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23C4A882' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 12px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
  }
  .single-product .variations tr { margin-bottom: 8px !important; display: block !important; }
  .single-product .variations .reset_variations { display: none !important; }
  /* Hide original labels when swatches/buttons are active */
  .single-product .variations tr:has(.cc-swatches) th { display: none !important; }
  .single-product .variations tr:has(.cc-sizes) th { display: none !important; }

  /* Add to cart button — full width, clean spacing */
  .single-product .single_add_to_cart_button {
    width: 100% !important;
    display: block !important;
    text-align: center !important;
    margin: 8px 0 4px !important;
    padding: 14px !important;
    line-height: 1.2 !important;
    font-size: 13px !important;
    letter-spacing: 2px !important;
  }

  /* Reassurance after button — make sure it's visible and not cut */
  .single-product .cc-vp-reassurance {
    display: block !important;
    width: 100% !important;
    clear: both !important;
    margin-top: 8px !important;
    padding: 0 !important;
  }

  /* Breadcrumb */
  .single-product .woocommerce-breadcrumb { padding: 8px 12px !important; }

  /* Tabs — full width */
  .single-product .woocommerce-tabs {
    width: 100% !important;
    padding: 0 12px !important;
    margin-top: 12px !important;
    box-sizing: border-box !important;
  }

  /* Remove excess spacing in tab content */
  .single-product .woocommerce-tabs .panel { padding: 10px 0 !important; }

  /* Description content — edge to edge for images */
  .single-product .woocommerce-tabs .panel img {
    width: calc(100% + 24px) !important;
    margin-left: -12px !important;
    margin-right: -12px !important;
    max-width: none !important;
    border-radius: 0 !important;
  }
  .single-product .woocommerce-tabs .panel > div {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Add bottom padding to account for sticky bar */
  .single-product .product { padding-bottom: 70px !important; }
}

/* ===== DESKTOP ===== */
@media(min-width:768px) {
  .product-details-wrapper {
    display: flex !important;
    gap: 40px !important;
    align-items: flex-start !important;
  }
  .product-details-wrapper .woocommerce-product-gallery {
    width: 50% !important;
    flex-shrink: 0 !important;
  }
  .product-details-wrapper .summary {
    width: 50% !important;
    padding: 0 !important;
  }
  .single-product .woocommerce-tabs {
    clear: both !important;
    margin-top: 30px !important;
  }
  /* Thumbnails desktop */
  .product-details-wrapper .woocommerce-product-gallery .flex-control-thumbs li img {
    aspect-ratio: 3/4 !important;
    object-fit: cover !important;
    height: auto !important;
  }
  /* Hide quantity on desktop too for variable products */
  .single-product .variations_form .quantity,
  .single-product .woocommerce-variation-add-to-cart .quantity {
    display: none !important;
  }
}

/* ===== GLOBAL HIDES ===== */
/* ALL old sticky bars — replaced by VP sticky */
.shoptimizer-sticky-add-to-cart { display: none !important; }
.cc-sticky-bar { display: none !important; }
.single-product .col-full-nav.is_stuck { display: none !important; }
.single-product .mobile-overlay { display: none !important; }

/* Related products — hidden for now */
section.related.products, section.related, .related-wrapper { display: none !important; }

/* Callback/chat features */
.call-back-feature, .callback-modal { display: none !important; }

/* Klarna — hidden until activated */
.cc-klarna, .cc-klarna-banner { display: none !important; }

/* Stripe express checkout — hidden */
#wc-stripe-express-checkout-element { display: none !important; }

/* Hide attributes table on product page */
.single-product .woocommerce-product-attributes,
.single-product table.woocommerce-product-attributes,
.single-product .product_meta,
.single-product table.shop_attributes { display: none !important; }

/* ===== DETAILS/ACCORDION STYLING ===== */
.single-product details {
  margin: 8px 0 !important;
  border: 1px solid rgba(196,181,168,.15) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}
.single-product details summary {
  cursor: pointer !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  background: #F5EDE6 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  list-style: none !important;
}
.single-product details summary::-webkit-details-marker { display: none !important; }

/* ===== WOOCOMMERCE VARIATION FORM CLEANUP ===== */
/* Fix: avoid reassurance text getting mixed with form elements */
.single-product .woocommerce-variation-add-to-cart {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}
.single-product .woocommerce-variation-add-to-cart .quantity {
  display: none !important;
}

/* ===== RESET LINK — no underline on product page links ===== */
.single-product .product a.reset_variations { font-size: 12px !important; }
