/* product: single product page (templates/single-product.html). Global tokens/components stay in theme.css;
   the trust circles (.nv-usp), card styles (.wc-block-product) and label table (.nv-label__*) are reused from there. */

.nv-pdp { --tile: var(--wp--preset--color--cream); }
.nv-tile-tomato .nv-pdp { --tile: var(--wp--preset--color--tomato); }
.nv-tile-limbu-phudina .nv-pdp { --tile: var(--wp--preset--color--green); }

/* ---------- Breadcrumbs ---------- */
.nv-pdp__crumbs { font-size: .85rem; line-height: 1.6; color: var(--wp--preset--color--ink-soft); margin-bottom: 1rem; padding-block: 12px; }
/* Inline padding: a 44px tap area that does not push a wrapped second line down. */
.nv-pdp__crumbs a { color: var(--wp--preset--color--maroon); text-decoration: none; padding: 13px 5px; margin-inline: -5px; }

/* ---------- Gallery (classic Woo gallery on the flavour colour tile) ---------- */
.nv-pdp__media .woocommerce-product-gallery { position: relative; margin: 0; float: none; width: 100% !important; max-width: 560px; }
.nv-pdp__media .woocommerce-product-gallery__wrapper,
.nv-pdp__media .flex-viewport { background: var(--tile); border-radius: var(--nv-radius); }
.nv-pdp__media .woocommerce-product-gallery__wrapper { margin: 0; padding: 0; }
.nv-pdp__media .woocommerce-product-gallery__image { --pad: 16px; padding: var(--pad); clip-path: inset(var(--pad) round var(--nv-radius-sm)); }   /* hover zoom stays inside the photo, tile frame shows */
.nv-pdp__media .woocommerce-product-gallery__image img { display: block; width: 100%; height: auto; border-radius: var(--nv-radius-sm); }
.nv-pdp__media .woocommerce-product-gallery__trigger {
  position: absolute; top: 28px !important; right: 28px !important; z-index: 9;
  width: 44px !important; height: 44px !important; box-sizing: border-box !important; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A1B2E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M20 20l-4.2-4.2M11 8.5v5M8.5 11h5'/%3E%3C/svg%3E") center / 22px no-repeat !important;
  box-shadow: var(--nv-shadow); font-size: 0; color: transparent; text-decoration: none; overflow: hidden;
}
.nv-pdp__media .woocommerce-product-gallery__trigger::before, .nv-pdp__media .woocommerce-product-gallery__trigger::after { display: none !important; }

/* PhotoSwipe: the idle preloader otherwise takes the corner slot and pushes Close 44px in on phones. */
.pswp__preloader:not(.pswp__preloader--active) { display: none; }
.nv-pdp__media .flex-control-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; list-style: none; margin: .75rem 0 0; padding: 0; }
.nv-pdp__media .flex-control-thumbs img { display: block; width: 100%; border-radius: var(--nv-radius-sm); border: 2px solid transparent; cursor: pointer; opacity: .7; }
.nv-pdp__media .flex-control-thumbs img.flex-active, .nv-pdp__media .flex-control-thumbs img:hover { border-color: var(--wp--preset--color--maroon); opacity: 1; }

/* ---------- Buy box ---------- */
.nv-pdp__buy > * { margin-block: 0; }
.nv-pdp__buy > * + * { margin-top: 1rem; }
.nv-pdp__title { font-size: clamp(2.1rem, 4vw, 3.1rem); margin: 0; }
.nv-pdp__price .wc-block-components-product-price { font-size: 1.75rem; font-weight: 700; color: var(--wp--preset--color--maroon-deep); }
.nv-pdp__price del { color: var(--wp--preset--color--ink-soft); font-weight: 500; font-size: .7em; margin-right: .35rem; }
.nv-pdp__price ins { text-decoration: none; }
.nv-pdp__excerpt { color: var(--wp--preset--color--ink-soft); font-size: 1.05rem; }
.nv-pdp__excerpt p { margin: 0; }

/* Variation table -> label + chips */
.nv-pdp__form .variations, .nv-pdp__form .variations tbody, .nv-pdp__form .variations tr,
.nv-pdp__form .variations th, .nv-pdp__form .variations td { display: block; border: 0; padding: 0 !important; margin: 0; background: none; text-align: left; line-height: 1.4; }
.nv-pdp__form .variations { margin: 0 0 1.25rem; width: 100%; }
.nv-pdp__form .variations tr + tr { margin-top: 1rem; }
.nv-pdp__form .variations th label, .nv-packs__label { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--wp--preset--color--maroon); margin-bottom: .5rem; }
.nv-pdp__form .nv-variation select { display: none !important; }
.nv-chipset { display: flex; flex-wrap: wrap; gap: .5rem; }
.nv-chip { position: relative; display: inline-flex; cursor: pointer; }
.nv-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.nv-chip span {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-height: 48px; min-width: 76px; padding: 0 1.1rem; border-radius: 6px;
  font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: 1.1rem; letter-spacing: .02em;
  color: var(--wp--preset--color--ink); background: var(--wp--preset--color--cream); border: 1.5px solid var(--wp--preset--color--sand);
  transition: background-color .15s, border-color .15s, color .15s;
}
.nv-chip input:checked + span { background: var(--wp--preset--color--maroon); border-color: var(--wp--preset--color--maroon); color: #fff; }
.nv-chip input:focus-visible + span { outline: 2px solid var(--wp--preset--color--maroon); outline-offset: 2px; }
.nv-chip input:disabled + span { opacity: .45; text-decoration: line-through; cursor: not-allowed; }

/* Hover tints only where a pointer can hover; on touch they would stick after a tap. */
@media (hover: hover) {
  .nv-pdp__crumbs a:hover { text-decoration: underline; }
  .nv-pdp__media .woocommerce-product-gallery__trigger:hover { background-color: var(--wp--preset--color--cream) !important; }
  .nv-chip:hover span { border-color: var(--wp--preset--color--maroon); }
}

/* Woo's own variation price would repeat the main price; availability (stock) still shows. */
.nv-pdp__form .woocommerce-variation-price { display: none; }
.nv-pdp__form .woocommerce-variation { margin-bottom: .75rem; }
.nv-pdp__form .woocommerce-variation:empty, .nv-pdp__form .woocommerce-variation:not(:has(.stock)) { margin: 0; }
.nv-pdp__form .woocommerce-variation p { margin: 0; }
.nv-pdp__form .stock { font-weight: 600; color: var(--wp--preset--color--green); }
.nv-pdp__form .stock.out-of-stock { color: var(--wp--preset--color--tomato); }

/* Pack chips (inc/product.php) on their own rows, Add to cart full width under them */
/* Woo lays the variable form out as a 3-column grid that leaves an implicit 4th column empty, so the row stopped ~130px short of the divider. */
.nv-pdp__form form.cart.variations_form { display: block; }
.nv-pdp__form .variations_button, .nv-pdp__form form.cart:not(.variations_form) { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.nv-packs { flex-basis: 100%; margin-bottom: .5rem; }
.nv-packs .nv-chipset { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 440px; }
.nv-packs .nv-chip { margin: 0; }   /* a global label margin would open up the rows */
.nv-packs .nv-chip span { width: 100%; min-width: 0; padding: 0 .4rem; white-space: nowrap; }
.nv-pdp__form .single_add_to_cart_button {
  flex: 1 1 200px; height: 52px; margin: 0; padding: 0 1.6rem !important; line-height: 1.2 !important; border: 0; border-radius: 999px;
  background: var(--wp--preset--color--maroon); color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: background-color .15s, transform .1s;
}
.nv-pdp__form .single_add_to_cart_button:hover { background: var(--wp--preset--color--maroon-deep); }
.nv-pdp__form .single_add_to_cart_button:active { transform: translateY(1px); }
.nv-pdp__form .single_add_to_cart_button.disabled { opacity: .55; cursor: not-allowed; }

/* Extras under the button */
.nv-buybox { margin-top: 1.5rem !important; padding-top: 1.5rem; border-top: 1px solid var(--wp--preset--color--sand); }
.nv-buybox > * + * { margin-top: 1.25rem; }
.nv-buybox__wa { margin: 0 0 1.25rem; }
.nv-buybox__wa .wp-block-button__link { min-height: 48px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.nv-usps--compact { gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nv-usps--compact .nv-usp { padding-top: 3.6rem; font-size: .78rem; line-height: 1.35; }
.nv-usps--compact .nv-usp strong { font-size: .88rem; }
.nv-usps--compact .nv-usp::before { width: 48px; height: 48px; background-size: 24px; }
.nv-buybox__links { display: flex; flex-wrap: wrap; column-gap: 1.5rem; margin: 0; font-size: .875rem; }
.nv-buybox__links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--wp--preset--color--maroon); font-weight: 600; }

/* ---------- Details band ---------- */
.nv-pdp__details .nv-h { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.nv-pdp__details p { max-width: 68ch; }
.nv-pdp__details .nv-label__h:first-of-type { margin-top: 1.25rem; }
.nv-pdp__details .nv-label__table { margin: 0; }

/* ---------- Reviews (Woo comments template) ---------- */
.nv-pdp__reviews .woocommerce-Reviews-title { font-family: var(--wp--preset--font-family--display); font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin: 0 0 1rem; }
.nv-pdp__reviews .commentlist { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.nv-pdp__reviews .commentlist > li { background: #fff; border: 1px solid var(--wp--preset--color--sand); border-radius: var(--nv-radius); padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.nv-pdp__reviews .comment_container { display: flex; gap: 1rem; }
.nv-pdp__reviews .comment_container img.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.nv-pdp__reviews .comment-text { flex: 1; }
.nv-pdp__reviews .meta { font-size: .85rem; color: var(--wp--preset--color--ink-soft); }
.nv-pdp__reviews .woocommerce-review__verified { color: var(--wp--preset--color--green); font-style: normal; font-weight: 600; }
.nv-pdp__reviews .woocommerce-noreviews,
.nv-pdp__reviews .woocommerce-verification-required {
  background: var(--wp--preset--color--cream); border-radius: var(--nv-radius-sm); padding: 1rem 1.25rem; margin: 0 0 1rem; color: var(--wp--preset--color--ink);
}
.nv-pdp__reviews .woocommerce-verification-required a { padding: 12px 4px; margin-inline: -4px; color: var(--wp--preset--color--maroon); font-weight: 600; }
.nv-pdp__reviews .comment-reply-title { display: block; font-weight: 700; font-size: 1.1rem; margin: 1.5rem 0 .75rem; }
.nv-pdp__reviews .comment-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.nv-pdp__reviews .comment-form input[type="text"], .nv-pdp__reviews .comment-form input[type="email"],
.nv-pdp__reviews .comment-form textarea, .nv-pdp__reviews .comment-form select {
  width: 100%; box-sizing: border-box; min-height: 48px; padding: .7rem .9rem; border: 1.5px solid var(--wp--preset--color--sand); border-radius: var(--nv-radius-sm); font: inherit; background: #fff;
}
.nv-pdp__reviews .comment-form-rating label { margin-bottom: 0; }
.nv-pdp__reviews p.stars { margin: 0; }
.nv-pdp__reviews p.stars a { width: 44px; height: 44px; margin-right: 0; }
.nv-pdp__reviews p.stars a::before { inset: 10px; width: 24px; height: 24px; line-height: 24px; }
.nv-pdp__reviews .nv-field-error { margin: .25rem 0 0; font-size: .9rem; font-weight: 600; color: var(--wp--preset--color--tomato); }
.nv-pdp__reviews .comment-form .submit { min-height: 48px; border-radius: 999px; padding: .8rem 2rem; font-weight: 700; }

/* ---------- More Masala Sing (homepage cards) ---------- */
.nv-pdp__related .nv-h { margin-bottom: 1.25rem; }
.nv-pdp__related .nv-products__grid .wc-block-product-template { grid-template-columns: repeat(auto-fill, minmax(240px, 300px)); max-width: none; margin-inline: 0; }
/* One other flavour until more SKUs exist: a full-width card on phones, a wide photo + details card above. */
.nv-pdp__related .nv-products__grid .wc-block-product:only-child { flex-basis: 100%; }
@media (min-width: 600px) {
  .nv-pdp__related .nv-products__grid .wc-block-product-template:has(> .wc-block-product:only-child) { grid-template-columns: minmax(0, 720px); }
  .nv-pdp__related .nv-products__grid .wc-block-product:only-child { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); grid-template-rows: repeat(5, auto) 1fr; column-gap: 2rem; }
  .nv-pdp__related .wc-block-product:only-child > .nv-card__img { grid-row: 1 / -1; margin: 0; }
  .nv-pdp__related .wc-block-product:only-child > :not(.nv-card__img) { grid-column: 2; }
  .nv-pdp__related .wc-block-product:only-child > .nv-card__title { margin-top: .5rem; }
  .nv-pdp__related .wc-block-product:only-child > .nv-card__btn { max-width: 320px; }
}

/* ---------- Mobile Add to cart bar (product.js) ---------- */
.nv-atc-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 16px calc(.6rem + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -4px 18px rgba(43, 24, 16, .12);
}
.nv-atc-bar[hidden] { display: none; }
.nv-atc-bar__info { display: flex; flex-direction: column; line-height: 1.2; }
.nv-atc-bar__size { font-size: .8rem; font-weight: 600; color: var(--wp--preset--color--ink-soft); }
.nv-atc-bar__price { font-weight: 700; font-size: 1.15rem; color: var(--wp--preset--color--maroon-deep); }
.nv-atc-bar__btn { min-height: 48px; padding: 0 1.75rem; border: 0; border-radius: 999px; background: var(--wp--preset--color--maroon); color: #fff; font: 700 1rem var(--wp--preset--font-family--body); cursor: pointer; }
@media (min-width: 782px) { .nv-atc-bar { display: none !important; } }

/* ---------- Responsive ---------- */
@media (min-width: 600px) and (max-width: 781px) {
  /* theme.css sets 50% columns on product pages from 600px; keep them side by side instead of wrapping at 50%. */
  .nv-pdp .wp-block-columns { flex-wrap: nowrap !important; }
}
@media (max-width: 599px) {
  .nv-pdp__media .woocommerce-product-gallery__image { --pad: 12px; }
  .nv-pdp__media .woocommerce-product-gallery__image img { max-height: 62vh; object-fit: contain; }
  .nv-pdp__media .woocommerce-product-gallery__trigger { top: 20px !important; right: 20px !important; }
  .nv-pdp__title { font-size: 2.1rem; }
  .nv-pdp__price .wc-block-components-product-price { font-size: 1.5rem; }
  .nv-pdp__form .single_add_to_cart_button { flex-basis: 160px; }
  .nv-usps--compact { gap: .6rem; }
  .nv-pdp__reviews .commentlist > li { padding: 1rem; }
}
@media (max-width: 379px) {
  .nv-chip span { min-width: 64px; padding: 0 .8rem; }   /* all four pack sizes on one row at 360 */
}
