/**
 * TeoAta — single product (plan.md §11)
 * Scope: body.single-product / .teo-single-product only.
 */

body.single-product,
body.teo-single-product {
  --teo-negro: #120a04;
  --teo-cacao: #2a1509;
  --teo-chocolate: #573016;
  --teo-caramelo: #b8712a;
  --teo-dorado: #d4a44e;
  --teo-crema: #f3e8d2;
  --teo-blanco: #fdf8f0;
  --teo-gris: #897769;
  --teo-gris-c: #e5d9c8;
  --teo-display: "Libre Baskerville", Georgia, serif;
  --teo-body: "Outfit", sans-serif;
}

body.single-product {
  --teo-frame: 1170px;
  font-family: var(--teo-body);
  background: var(--teo-blanco);
  color: var(--teo-cacao);
}

/* ── Breadcrumb, aligned to the same column as the product ── */
body.single-product .woocommerce-breadcrumb,
body.single-product .shoptimizer-breadcrumb {
  width: min(var(--teo-frame), calc(100% - 48px)) !important;
  max-width: var(--teo-frame) !important;
  margin: 0 auto !important;
  padding: 16px 0 !important;
  background: transparent !important;
  border-bottom: 0 !important;
  font-size: 12px !important;
  color: var(--teo-gris) !important;
  font-weight: 300;
  box-sizing: border-box;
}

body.single-product .woocommerce-breadcrumb a {
  color: var(--teo-gris) !important;
  text-decoration: none;
}

/* ── Added-to-cart notice (replaces the default green bar) ── */
body.single-product .woocommerce-notices-wrapper {
  width: min(var(--teo-frame), calc(100% - 48px)) !important;
  max-width: var(--teo-frame) !important;
  margin: 8px auto 0 !important;
  box-sizing: border-box;
}

body.single-product .woocommerce-message {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--teo-crema) !important;
  color: var(--teo-cacao) !important;
  border: 0 !important;
  border-left: 3px solid var(--teo-caramelo) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 0 12px !important;
  padding: 14px 16px !important;
  font-family: var(--teo-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

body.single-product .woocommerce-message::before {
  position: static !important;
  color: var(--teo-caramelo) !important;
  margin: 0 !important;
  flex: 0 0 auto;
}

body.single-product .woocommerce-message a:not(.button) {
  color: var(--teo-chocolate) !important;
}

body.single-product .woocommerce-message .button,
body.single-product .woocommerce-message a.button {
  order: 2;
  float: none !important;
  flex: 0 0 auto;
  background: var(--teo-caramelo) !important;
  color: var(--teo-negro) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 12px 16px !important;
  font-family: var(--teo-body) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
  line-height: 1 !important;
  text-transform: uppercase;
  text-decoration: none !important;
}

body.single-product .woocommerce-message .button:hover,
body.single-product .woocommerce-message a.button:hover {
  background: var(--teo-dorado) !important;
  color: var(--teo-negro) !important;
}

/*
 * Contained shop column, same disposition as the Shoptimizer PDP:
 * centered frame, photo on the left, purchase column on the right.
 * Do not stretch this to the viewport (pdp-full).
 */
body.single-product div.product,
body.single-product.pdp-full div.product {
  display: block !important;
  width: min(var(--teo-frame), calc(100% - 48px)) !important;
  max-width: var(--teo-frame) !important;
  float: none !important;
  margin: 28px auto 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

body.single-product .product-details-wrapper,
body.single-product.pdp-full .product-details-wrapper {
  display: grid !important;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  align-items: start;
  gap: 48px;
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.single-product .product-details-wrapper > .woocommerce-product-gallery,
body.single-product .product-details-wrapper > div.images,
body.single-product .teo-sp-gallery {
  grid-column: 1;
  grid-row: 1;
  width: 100% !important;
  max-width: none !important;
  float: none !important;
}

body.single-product .product-details-wrapper > .summary.entry-summary,
body.single-product .product-details-wrapper > div.summary {
  grid-column: 2;
  grid-row: 1;
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
  padding: 16px 0 0 !important;
  background: transparent;
  box-sizing: border-box;
}

body.single-product .product-details-wrapper > .woocommerce-tabs,
body.single-product .product-details-wrapper > .related-wrapper,
body.single-product .teo-sp-about,
body.single-product .teo-sp-related-wrap,
body.single-product .related.products,
body.single-product .upsells.products {
  grid-column: 1 / -1;
  width: 100% !important;
}

/* ── Gallery column ── */
body.single-product .teo-sp-gallery {
  position: relative;
  background: var(--teo-crema);
  padding: 16px;
  box-sizing: border-box;
  align-self: start;
}

body.single-product .woocommerce-product-gallery,
body.single-product .flex-viewport {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

/*
 * With several photos, flexslider makes the wrapper as wide as all slides together
 * (inline width) and moves it; forcing 100% here stacked the slides and changing
 * photo left the frame empty. Leave its width alone.
 */
body.single-product .woocommerce-product-gallery__wrapper {
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
}

body.single-product .woocommerce-product-gallery {
  opacity: 1 !important;
  background: transparent;
}

body.single-product .flex-viewport {
  height: auto !important;
}

body.single-product .woocommerce-product-gallery__image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

body.single-product .woocommerce-product-gallery__image > a {
  display: block;
  height: 100%;
}

body.single-product .woocommerce-product-gallery__image img.wp-post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  margin: 0;
}

body.single-product .flex-control-thumbs,
body.single-product .woocommerce-product-gallery ol.flex-control-nav {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

body.single-product .flex-control-thumbs li {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
}

body.single-product .flex-control-thumbs img {
  aspect-ratio: 1;
  object-fit: cover;
  opacity: 0.7;
  border: 2px solid transparent;
  cursor: pointer;
}

body.single-product .flex-control-thumbs img.flex-active,
body.single-product .flex-control-thumbs li img.flex-active {
  opacity: 1 !important;
  border-color: var(--teo-caramelo) !important;
}

/* ── Summary typography ── */
body.single-product .teo-sp-label,
body.single-product .summary .teo-sp-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teo-caramelo);
  margin: 0 0 10px;
}

body.single-product .product_title,
body.single-product .summary h1 {
  font-family: var(--teo-display) !important;
  font-size: clamp(28px, 3.2vw, 44px) !important;
  font-weight: 700 !important;
  line-height: 1.08 !important;
  color: var(--teo-negro) !important;
  margin: 0 0 12px !important;
}

body.single-product .woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px !important;
  font-size: 13px;
}

body.single-product .star-rating {
  color: var(--teo-caramelo);
  letter-spacing: 2px;
}

body.single-product .woocommerce-review-link {
  color: var(--teo-caramelo) !important;
  text-decoration: none;
  font-weight: 300;
}

body.single-product .summary .price {
  font-family: var(--teo-display) !important;
  font-size: 38px !important;
  font-weight: 700 !important;
  color: var(--teo-chocolate) !important;
  line-height: 1 !important;
  margin: 0 0 4px !important;
}

body.single-product .teo-sp-price-note {
  font-size: 11px;
  color: var(--teo-gris);
  font-weight: 300;
  margin: 0 0 20px;
}

body.single-product .woocommerce-product-details__short-description {
  font-size: 14px;
  line-height: 1.8;
  color: var(--teo-gris);
  font-weight: 300;
  margin: 0 0 28px;
  border-left: 3px solid var(--teo-caramelo);
  padding-left: 16px;
  max-width: 480px;
}

body.single-product .woocommerce-product-details__short-description p {
  margin: 0;
}

/* Hide duplicate short desc if Shoptimizer prints twice */
body.single-product .shoptimizer-pdp-short-description {
  display: none !important;
}

/* ── Tabs in summary (Descripción · Ingredientes · Alérgenos · Envíos) ── */
body.single-product .teo-sp-tabs {
  margin: 0 0 28px;
  max-width: 100%;
}

body.single-product .teo-sp-tabs__nav {
  display: flex;
  gap: 0 20px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--teo-gris-c);
  max-width: 520px;
}

body.single-product .teo-sp-tab {
  padding: 12px 0;
  margin: 0 0 -2px;
  font-family: var(--teo-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teo-gris);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
  white-space: nowrap;
}

body.single-product .teo-sp-tabs__panels {
  max-width: 520px;
}

body.single-product .teo-sp-tab--active {
  color: var(--teo-caramelo) !important;
  border-bottom-color: var(--teo-caramelo) !important;
}

body.single-product .teo-sp-tabpanel {
  padding: 20px 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--teo-gris);
  font-weight: 300;
}

body.single-product .teo-sp-tabpanel[hidden] {
  display: none !important;
}

body.single-product .teo-sp-tabpanel__flavor {
  margin: 0 0 10px;
  font-family: var(--teo-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teo-caramelo);
  line-height: 1.4;
}

body.single-product .teo-sp-tabpanel__flavor[hidden] {
  display: none !important;
}

body.single-product .teo-sp-tabpanel__body p,
body.single-product .teo-sp-tabpanel p {
  margin: 0 0 0.6em;
}

/* ── Flavor chips. Equal cells so long and short names share one grid. ── */
body.single-product .variations,
body.single-product .variations tbody,
body.single-product .variations tr,
body.single-product .variations td,
body.single-product .variations .value {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent;
}

body.single-product .variations {
  margin: 0 0 4px !important;
}

body.single-product .variations th,
body.single-product .variations .label {
  display: none !important;
}

body.single-product .teo-sp-flavors {
  margin: 0 0 18px;
}

body.single-product .teo-sp-flavors__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teo-negro);
  margin-bottom: 10px;
}

body.single-product .teo-sp-flavors__chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

body.single-product .teo-sp-flavor {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  min-height: 48px;
  margin: 0;
  padding: 8px 12px;
  box-sizing: border-box;
  border: 1.5px solid var(--teo-gris-c);
  background: var(--teo-blanco);
  color: var(--teo-cacao);
  font-family: var(--teo-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

body.single-product .teo-sp-flavor:hover {
  border-color: var(--teo-caramelo);
}

body.single-product .teo-sp-flavor:focus-visible {
  outline: 2px solid var(--teo-negro);
  outline-offset: 2px;
}

body.single-product a.reset_variations {
  display: inline-block;
  margin: 0 0 16px;
  font-family: var(--teo-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--teo-gris) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.single-product a.reset_variations:hover {
  color: var(--teo-caramelo) !important;
}

body.single-product .teo-sp-flavor--selected,
body.single-product .teo-sp-flavor[aria-pressed="true"] {
  border-color: var(--teo-caramelo) !important;
  background: var(--teo-caramelo) !important;
  color: var(--teo-negro) !important;
  font-weight: 700;
}

/* ── Qty + ATC. Variable forms stack the options above the button row. ── */
body.single-product form.cart {
  display: flex !important;
  flex-flow: row nowrap !important;
  gap: 12px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  margin: 0 0 20px !important;
  box-sizing: border-box;
}

body.single-product form.variations_form.cart {
  flex-flow: column nowrap !important;
  align-items: stretch;
}

body.single-product form.variations_form .variations,
body.single-product form.variations_form .single_variation_wrap {
  width: 100%;
}

body.single-product form.variations_form .woocommerce-variation-add-to-cart-enabled {
  display: flex !important;
  flex-flow: row nowrap !important;
  gap: 12px;
  align-items: stretch;
  width: 100%;
}

body.single-product form.cart .quantity {
  position: relative !important;
  display: inline-flex !important;
  align-items: stretch;
  align-self: flex-start;
  border: 1.5px solid var(--teo-gris-c);
  margin: 0 !important;
  float: none !important;
  width: auto !important;
  height: 52px;
  background: var(--teo-blanco);
  overflow: hidden;
}

body.single-product form.cart .quantity-nav {
  position: relative !important;
  inset: auto !important;
  display: flex !important;
  flex-direction: column;
  flex: 0 0 36px;
  width: 36px !important;
  height: 52px !important;
  border-left: 1.5px solid var(--teo-gris-c);
}

body.single-product form.cart .quantity-button {
  flex: 1 1 50%;
  height: 26px !important;
  width: 36px !important;
  position: relative !important;
  right: auto !important;
}

body.single-product form.cart .quantity .qty {
  width: 52px !important;
  height: 52px !important;
  border: none !important;
  border-radius: 0 !important;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--teo-negro);
  background: transparent;
  box-shadow: none !important;
}

body.single-product form.cart .single_add_to_cart_button,
body.single-product form.cart button.button {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box !important;
  height: 52px !important;
  min-height: 52px !important;
  border: none !important;
  border-radius: 0 !important;
  background: var(--teo-caramelo) !important;
  color: var(--teo-negro) !important;
  font-family: var(--teo-body) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  margin: 0 !important;
  padding: 0 16px !important;
  letter-spacing: 0.06em;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.1 !important;
  box-shadow: none !important;
  transition: background 0.2s, transform 0.15s;
}

body.single-product form.cart .single_add_to_cart_button:hover {
  background: var(--teo-dorado) !important;
  transform: translateY(-1px);
}

body.single-product form.cart .single_add_to_cart_button.added {
  background: var(--teo-caramelo) !important;
}

/* ── Trust strip ── */
body.single-product .teo-sp-trust {
  display: flex;
  border: 1px solid var(--teo-gris-c);
  margin: 0 0 8px;
}

body.single-product .teo-sp-trust__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 12px 8px;
  border-right: 1px solid var(--teo-gris-c);
}

body.single-product .teo-sp-trust__item:last-child {
  border-right: none;
}

body.single-product .teo-sp-trust__icon {
  font-size: 18px;
  line-height: 1;
}

body.single-product .teo-sp-trust__label {
  font-size: 10px;
  color: var(--teo-gris);
  font-weight: 500;
  line-height: 1.3;
}

/* ── About section: crema band, text stays in the same column ── */
body.single-product .teo-sp-about {
  background: var(--teo-crema);
  border-top: 0;
  box-sizing: border-box;
  width: 100vw !important;
  max-width: 100vw;
  margin-top: 56px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 56px max(24px, calc((100vw - var(--teo-frame)) / 2)) 40px;
}

body.single-product .teo-sp-about__inner {
  max-width: 1100px;
}

body.single-product .teo-sp-about__title {
  font-family: var(--teo-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--teo-negro);
  margin: 0 0 20px;
  max-width: 820px;
  line-height: 1.2;
}

body.single-product .teo-sp-about__content {
  font-size: 15px;
  line-height: 1.85;
  color: var(--teo-gris);
  font-weight: 300;
  max-width: 820px;
}

body.single-product .teo-sp-about__content h2,
body.single-product .teo-sp-about__content h3 {
  font-family: var(--teo-display);
  color: var(--teo-negro);
  font-weight: 700;
}

body.single-product .teo-sp-about__content h3 {
  font-size: 20px;
  margin: 1.4em 0 14px;
}

body.single-product .teo-sp-about__closing {
  text-align: center;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--teo-gris-c);
}

body.single-product .teo-sp-about__closing p {
  font-family: var(--teo-display);
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
  color: var(--teo-negro);
  margin: 0;
}

/* Highlight boxes if editors use blockquote */
body.single-product .teo-sp-about__content blockquote {
  background: var(--teo-blanco);
  border-left: 3px solid var(--teo-caramelo);
  margin: 16px 0 0;
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--teo-cacao);
}

/* ── Related ── */
body.single-product .teo-sp-related-wrap {
  position: relative;
  padding: 56px 0 24px;
  background: var(--teo-blanco);
}

body.single-product .teo-sp-related-head {
  position: absolute;
  top: 64px;
  right: 0;
  z-index: 2;
}

body.single-product .teo-sp-related-link {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--teo-caramelo);
  text-decoration: none;
  border-bottom: 1px solid var(--teo-caramelo);
}

/* Up-sells ("Ventas dirigidas") share the related products look. */
body.single-product .related.products,
body.single-product .upsells.products,
body.single-product .related.products > h2,
body.single-product .upsells.products > h2 {
  margin: 0 !important;
}

body.single-product .related.products > h2,
body.single-product .upsells.products > h2 {
  font-family: var(--teo-display) !important;
  font-size: 32px !important;
  font-weight: 700 !important;
  color: var(--teo-negro) !important;
  margin-bottom: 40px !important;
  padding-right: 180px;
}

body.single-product .related.products ul.products,
body.single-product .upsells.products ul.products {
  margin-top: 0 !important;
}

/* Hide noisy Shoptimizer / demo PDP chrome we don't want */
body.single-product .shoptimizer-prev-next-product,
body.single-product .shoptimizer-product-prevnext,
body.single-product .product-widget,
body.single-product .call-back-feature,
body.single-product .shoptimizer-sticky-add-to-cart,
body.single-product .commercekit-sticky-add-to-cart {
  display: none !important;
}

body.single-product .woocommerce-breadcrumb,
body.single-product .shoptimizer-breadcrumb {
  white-space: normal !important;
  overflow-wrap: anywhere;
}

body.single-product,
body.single-product .site-content,
body.single-product .site-content .col-full,
body.single-product #content .col-full {
  background: var(--teo-blanco) !important;
}

body.single-product .site-content {
  overflow-x: clip;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  body.single-product .product-details-wrapper,
  body.single-product.pdp-full .product-details-wrapper {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  body.single-product .product-details-wrapper > .woocommerce-product-gallery,
  body.single-product .product-details-wrapper > div.images,
  body.single-product .product-details-wrapper > .summary.entry-summary,
  body.single-product .product-details-wrapper > div.summary,
  body.single-product .teo-sp-gallery {
    grid-column: 1;
    grid-row: auto;
    width: 100% !important;
  }

  body.single-product .teo-sp-gallery {
    padding: 12px;
  }

  body.single-product .summary.entry-summary,
  body.single-product div.summary {
    padding: 0 !important;
  }

  body.single-product .teo-sp-related-head {
    top: 56px;
    right: 0;
  }
}

@media (max-width: 768px) {
  body.single-product form.cart {
    flex-flow: row nowrap !important;
    align-items: stretch;
  }

  body.single-product form.variations_form.cart {
    flex-flow: column nowrap !important;
  }

  body.single-product form.cart .quantity {
    flex: 0 0 auto;
    align-self: flex-start;
  }

  body.single-product form.cart .single_add_to_cart_button {
    flex: 1 1 auto;
    width: auto !important;
    padding: 0 10px !important;
    font-size: 11px !important;
    letter-spacing: 0.02em !important;
  }

  body.single-product .teo-sp-trust {
    display: flex;
  }

  body.single-product .teo-sp-trust__item {
    flex: 1;
    border-right: 1px solid var(--teo-gris-c);
    border-bottom: none;
    padding: 10px 4px;
  }

  body.single-product .teo-sp-trust__item:last-child {
    border-right: none;
  }

  body.single-product .teo-sp-related-head {
    position: static;
    margin-bottom: 12px;
  }

  body.single-product .related.products > h2,
  body.single-product .upsells.products > h2 {
    padding-right: 0;
    font-size: 26px !important;
    margin-bottom: 16px !important;
  }

  body.single-product .summary .price {
    font-size: 32px !important;
  }
}

@media (max-width: 560px) {
  body.single-product div.product,
  body.single-product.pdp-full div.product,
  body.single-product .woocommerce-breadcrumb,
  body.single-product .shoptimizer-breadcrumb,
  body.single-product .woocommerce-notices-wrapper {
    width: min(var(--teo-frame), calc(100% - 32px)) !important;
  }

  body.single-product .woocommerce-message {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  body.single-product .woocommerce-breadcrumb,
  body.single-product .shoptimizer-breadcrumb {
    padding: 12px 0 !important;
  }

  body.single-product .teo-sp-tabs__nav {
    gap: 0 14px;
    max-width: 100%;
  }

  body.single-product .teo-sp-tab {
    font-size: 11px;
  }

  body.single-product .teo-sp-tabs__panels {
    max-width: 100%;
  }

  body.single-product .flex-control-thumbs {
    grid-template-columns: repeat(4, 1fr);
  }

  body.single-product .teo-sp-about__title {
    font-size: 24px;
  }

  body.single-product .teo-sp-about__closing p {
    font-size: 18px;
  }
}
