/* ===========================
   BB Product Page CSS
   =========================== */

/* ===========================
   PRODUCT DETAILS WRAPPER
   Full width layout override
   =========================== */
.product-details-wrapper {
    max-width: 100% !important;
    width: 100%;
    padding-left: var(--bb-gutter);
    padding-right: var(--bb-gutter);
    margin: 0;
}

/* ===========================
   HIDE ORIGINAL BREADCRUMB BAR
   (on single product pages)
   =========================== */
.single-product .woocommerce-breadcrumb:not(.bb-product-breadcrumb .woocommerce-breadcrumb) {
    display: none !important;
}

/* Also hide Shoptimizer's breadcrumb wrapper if present */
.single-product .shoptimizer-breadcrumbs,
.single-product .content-top .woocommerce-breadcrumb {
    display: none !important;
}

/* ===========================
   PRODUCT BREADCRUMB
   (in summary, above title)
   =========================== */
.bb-product-breadcrumb {
    margin-bottom: 12px;
}

.bb-product-breadcrumb .woocommerce-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: .65rem;
    letter-spacing: 0.01em;
    color: var(--bb-muted);
    margin: 0;
    padding: 0;
}

.bb-product-breadcrumb .woocommerce-breadcrumb a {
    color: #000;
    text-decoration: none;
    transition: color var(--bb-transition-fast);
}

.bb-product-breadcrumb .woocommerce-breadcrumb a:hover {
    color: var(--bb-fg);
}

/* Separator styling */
.bb-product-breadcrumb .woocommerce-breadcrumb .breadcrumb-separator,
.bb-product-breadcrumb .woocommerce-breadcrumb > span:not(:last-child)::after {
    color: var(--bb-muted);
    opacity: 0.5;
}

.single-product .site-content .col-full {
  background-color: #FFF!important;
}

/* ===========================
   PRODUCT SUMMARY
    (Title, Price, Add to Cart)
   =========================== */
.summary h1 {
  font-size: 1.4rem!important;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--bb-fg);
  font-family: "Jost", sans-serif!important;
}
.cart .single_add_to_cart_button {
  border-radius: 0px!important;
}

/* ===========================
   PDP MODELLO SWATCHES
   Horizontal scrollable product variants
   =========================== */
.bb-pdp-swatches {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--bb-line);
}

.bb-pdp-swatches__label {
    display: block;
    font-size: var(--bb-small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bb-fg);
    margin-bottom: 12px;
}

.bb-pdp-swatches__scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 4px 0;
    /* Show exactly 5 items: 5 * 75px + 4 * 10px gap = 415px */
    max-width: 415px;
}

.bb-pdp-swatches__scroll::-webkit-scrollbar {
    display: none;
}

.bb-pdp-swatches__item {
    display: block;
    width: 75px;
    height: 75px;
    flex-shrink: 0;
    border: 1px solid var(--bb-line);
    overflow: hidden;
    transition: border-color var(--bb-transition-fast), opacity var(--bb-transition-fast);
}

.bb-pdp-swatches__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bb-pdp-swatches__item:hover {
    border-color: var(--bb-fg);
}

/* Current product indicator */
.bb-pdp-swatches__item.is-current {
    border-color: var(--bb-fg);
    border-width: 2px;
}

/* Subtle opacity for non-current items */
.bb-pdp-swatches__item:not(.is-current) {
    opacity: 0.8;
}

.bb-pdp-swatches__item:not(.is-current):hover {
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .bb-pdp-swatches {
        margin-top: 24px;
        padding-top: 20px;
    }

    .bb-pdp-swatches__scroll {
        gap: 8px;
        /* Show 4 items on mobile: 4 * 65px + 3 * 8px = 284px */
        max-width: 284px;
    }

    .bb-pdp-swatches__item {
        width: 65px;
        height: 65px;
    }
}

/* ===========================
   STOCK STATUS
   Availability indicator below swatches
   =========================== */
.bb-pdp-stock {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: var(--bb-small);
    color: var(--bb-fg);
}

.bb-pdp-stock__label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.bb-pdp-stock__value {
    font-weight: 400;
}

.bb-pdp-stock--low .bb-pdp-stock__value {
    color: #b54a32;
}

/* ===========================
   "PIÙ DETTAGLI" LINK
   Single trigger to open details offcanvas
   =========================== */
.bb-pdp__details-link {
  margin-top: 8px;
  margin-bottom: 16px;
}

.bb-details-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--bb-body);
  font-weight: 500;
  color: var(--bb-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: opacity var(--bb-transition-fast);
  cursor: pointer;
}

.bb-details-trigger:hover {
  opacity: 0.6;
}

.bb-details-trigger svg {
  transition: transform var(--bb-transition-fast);
}

.bb-details-trigger:hover svg {
  transform: translateX(3px);
}

/* ===========================
   PRODUCT DETAILS OFFCANVAS
   Description + accordion sections
   =========================== */

/* Description at top of offcanvas */
.bb-details-description {
  padding-bottom: 24px;
  font-size: var(--bb-body);
  line-height: var(--bb-lh-relaxed);
  color: var(--bb-fg);
}

.bb-details-description ul,
.bb-details-description ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bb-details-description li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
  font-size: var(--bb-body);
  line-height: var(--bb-lh-normal);
}

.bb-details-description li::before {
  content: '-';
  position: absolute;
  left: 0;
}

.bb-details-description li:last-child {
  margin-bottom: 0;
}

.bb-details-description p {
  margin: 0 0 8px;
}

.bb-details-description p:last-child {
  margin-bottom: 0;
}

/* ===========================
   ACCORDION SECTIONS
   Native <details> elements
   =========================== */
.bb-details-accordions {
  border-top: 1px solid var(--bb-fg);
}

.bb-details-accordion {
  border-bottom: 1px solid var(--bb-fg);
}

.bb-details-accordion__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

/* Remove default marker */
.bb-details-accordion__header::-webkit-details-marker {
  display: none;
}

.bb-details-accordion__header::marker {
  display: none;
  content: '';
}

.bb-details-accordion__title {
  font-size: var(--bb-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bb-fg);
  margin: 0;
}

.bb-details-accordion__icon {
  flex-shrink: 0;
  transition: transform var(--bb-transition-fast);
  color: var(--bb-fg);
}

.bb-details-accordion[open] .bb-details-accordion__icon {
  transform: rotate(180deg);
}

/* Accordion content */
.bb-details-accordion__content {
  padding: 0 0 20px;
  font-size: var(--bb-body);
  line-height: var(--bb-lh-relaxed);
  color: var(--bb-fg);
}

.bb-details-accordion__content p {
  margin: 0 0 12px;
}

.bb-details-accordion__content p:last-child {
  margin-bottom: 0;
}

/* Details list (materials, dimensions, colors) */
.bb-details-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bb-details-list li {
  padding: 6px 0;
  font-size: var(--bb-body);
  line-height: var(--bb-lh-normal);
}

.bb-details-list li strong {
  font-weight: 600;
}

/* Benedetta consiglia block */
.bb-benedetta-consiglia {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--bb-line);
}

.bb-benedetta-consiglia__text {
  font-style: italic;
  margin: 0 0 8px;
}

.bb-benedetta-consiglia__link {
  font-size: var(--bb-small);
  color: var(--bb-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: opacity var(--bb-transition-fast);
}

.bb-benedetta-consiglia__link:hover {
  opacity: 0.6;
}

/* ===========================
   WISHLIST BUTTON (CommerceKit)
   Bookmark icon, top right aligned with h1
   =========================== */

/* Position the summary as relative anchor */
.single-product .summary.entry-summary {
  position: relative;
}

/* Position wishlist button at top right */
.summary .commercekit-wishlist {
  position: absolute !important;
  top: 30px;
  right: 0;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10;
}

.summary .commercekit-wishlist a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer;
  transition: opacity var(--bb-transition-fast);
  position: relative;
}

.summary .commercekit-wishlist a:hover {
  opacity: 0.6;
}

/* Hide ALL original content (icon, text, everything) */
.summary .commercekit-wishlist a > * {
  display: none !important;
  visibility: hidden !important;
}

/* Add bookmark icon via ::after pseudo-element */
.summary .commercekit-wishlist a::after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0 1 11.186 0Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: background-image var(--bb-transition-fast);
}

/* Added to wishlist state - filled bookmark */
/* CommerceKit adds .cg-wishlist-t class to the i element when added */
.summary .commercekit-wishlist.added a::after,
.summary .commercekit-wishlist a.added::after,
.summary .commercekit-wishlist a:has(i.cg-wishlist-t)::after,
.summary .commercekit-wishlist a:has(.cg-wishlist-t)::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath fill-rule='evenodd' d='M6.32 2.577a49.255 49.255 0 0 1 11.36 0c1.497.174 2.57 1.46 2.57 2.93V21a.75.75 0 0 1-1.085.67L12 18.089l-7.165 3.583A.75.75 0 0 1 3.75 21V5.507c0-1.47 1.073-2.756 2.57-2.93Z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .summary .commercekit-wishlist a {
    width: 36px;
    height: 36px;
  }

  .summary .commercekit-wishlist a::after {
    width: 20px;
    height: 20px;
  }
}

/* ===========================
   VARIANT LABEL
   Color variant name below title
   =========================== */
.bb-pdp-variant-label {
  display: block;
  font-size: var(--bb-body);
  color: var(--bb-muted);
  margin-bottom: 8px;
}

/* ===========================
   SIZE EXPLORER
   "Explore the different sizes" grid
   =========================== */
.bb-pdp-size-explorer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--bb-line);
}

.bb-pdp-size-explorer__title {
  font-size: var(--bb-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 16px;
  color: var(--bb-fg);
}

.bb-pdp-size-explorer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.bb-pdp-size-explorer__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--bb-fg);
  transition: opacity var(--bb-transition-fast);
}

.bb-pdp-size-explorer__item:hover {
  opacity: 0.75;
}

.bb-pdp-size-explorer__image {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #f5f5f5;
  border: 1px solid var(--bb-line);
}

.bb-pdp-size-explorer__item.is-current .bb-pdp-size-explorer__image {
  border-color: var(--bb-fg);
  border-width: 2px;
}

.bb-pdp-size-explorer__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bb-pdp-size-explorer__label {
  font-size: var(--bb-small);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
}

.bb-pdp-size-explorer__item.is-current .bb-pdp-size-explorer__label {
  font-weight: 700;
}

/* ===========================
   CLIENT ADVISOR
   Contact section on PDP
   =========================== */
.bb-pdp-client-advisor {
  margin-top: 24px;
  padding: 20px;
  background: #fafafa;
  border: 1px solid var(--bb-line);
}

.bb-pdp-client-advisor__text {
  font-size: var(--bb-body);
  line-height: var(--bb-lh-relaxed);
  color: var(--bb-fg);
  margin: 0;
}

.bb-pdp-client-advisor__link {
  color: var(--bb-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: opacity var(--bb-transition-fast);
}

.bb-pdp-client-advisor__link:hover {
  opacity: 0.6;
}

/* ===========================
   MOBILE PDP LAYOUT
   Reorder summary sections for mobile mockup
   =========================== */
@media (max-width: 767px) {

  /* Flex container for visual reordering */
  .single-product .summary.entry-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  /* Default: full-width children, pushed to end */
  .summary.entry-summary > * {
    width: 100%;
    flex-shrink: 0;
    order: 200;
  }

  /* --- Section ordering --- */
  .summary.entry-summary .bb-product-breadcrumb { order: 10; }

  /* Title row: h1 + price + wishlist share one flex line */
  .summary.entry-summary .product_title {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    order: 20;
    margin-bottom: 2px;
  }

  .summary.entry-summary > .price {
    flex: 0 0 auto;
    width: auto;
    order: 20;
    text-align: right;
    align-self: flex-start;
    padding-top: 2px;
    margin-bottom: 0;
  }

  .summary.entry-summary .commercekit-wishlist {
    position: static !important;
    top: auto !important;
    right: auto !important;
    flex: 0 0 auto;
    width: auto;
    order: 20;
    align-self: flex-start;
    margin-left: 2px;
  }

  /* Variant label */
  .summary.entry-summary .bb-pdp-variant-label {
    order: 30;
    margin-bottom: 0;
  }

  /* ATC form — moved up before swatches */
  .summary.entry-summary > .cart {
    order: 40;
    margin-top: 16px;
  }

  /* Swatches */
  .summary.entry-summary .bb-pdp-swatches { order: 50; }

  /* Stock status */
  .summary.entry-summary .bb-pdp-stock { order: 60; }

  /* Short description — moved below swatches/stock */
  .summary.entry-summary .woocommerce-product-details__short-description {
    order: 70;
  }

  /* "Product Details" link — restyled as bold section title on mobile */
  .summary.entry-summary .bb-pdp__details-link {
    order: 80;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--bb-line);
  }

  .summary.entry-summary .bb-details-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-weight: 700;
    font-size: var(--bb-body);
    text-decoration: none;
  }

  .summary.entry-summary .bb-details-trigger svg {
    transform: rotate(0deg);
  }

  .summary.entry-summary .bb-details-trigger:hover svg {
    transform: translateX(3px);
  }

  /* Size explorer */
  .summary.entry-summary .bb-pdp-size-explorer { order: 90; }

  /* Client advisor */
  .summary.entry-summary .bb-pdp-client-advisor { order: 100; }

  /* Hide rating on mobile */
  .summary .woocommerce-product-rating {
    display: none !important;
  }

  /* ATC button full-width on mobile */
  .summary .cart .single_add_to_cart_button {
    width: 100%;
  }

  /* Hide WooCommerce product data tabs on mobile */
  .single-product .woocommerce-tabs {
    display: none !important;
  }
}

/* ===========================
   PDP CONFIDENCE SECTION
   "Shop with Confidence" below product summary
   =========================== */
.bb-pdp-confidence {
  max-width: 600px;
  margin: 32px auto 0;
  padding: 0 var(--bb-gutter);
}

@media (min-width: 768px) {
  .bb-pdp-confidence {
    max-width: 900px;
    margin-top: 48px;
  }
}

/* ===========================
   RELATED PRODUCTS
   Horizontal scroll on mobile
   =========================== */
@media (max-width: 767px) {
  .single-product .related.products {
    padding: 0 var(--bb-gutter);
  }

  .single-product .related.products > h2 {
    font-size: var(--bb-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
  }

  .single-product .related.products ul.products {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    gap: 12px;
    padding-bottom: 8px;
  }

  .single-product .related.products ul.products::-webkit-scrollbar {
    display: none;
  }

  .single-product .related.products ul.products li.product {
    flex: 0 0 45%;
    max-width: 45%;
  }
}
