/* ==========================================================================
   NICO Pharma — Product detail + Cart
   Loaded only by product.html and cart.html.
   1. Gallery
   2. Buy box
   3. Description / FAQ panel
   4. Review band + reviews panel
   5. Cart
   6. Responsive
   ========================================================================== */

/* The description panel inherited a blue palette from the original static
   build, which fights the green brand everywhere else on the page. Retinting
   these tokens rebrands the panel, pills, cards and FAQ headings at once. */
:root {
  --pdp-blue: #22345a;
  --pdp-blue-dark: #075f41;
  --pdp-panel: #f6faf9;
  --pdp-card: #ffffff;
  --pdp-border: #e0eae6;
  --pdp-pill: #2f4774;
}

/* ------------------------------------ 0. WooCommerce default overrides */
/*
 * woocommerce-layout.css floats `div.images` and `div.summary` at 48% of
 * their container. The body carries the `.woocommerce` class, so those rules
 * apply inside the theme's own Bootstrap columns and halve each column a
 * second time — that is what shrank the gallery to a quarter width, pushed
 * the buy box into a narrow strip and left the dead space beside it.
 *
 * WooCommerce's selectors score (0,3,2) — `.woocommerce`, `.product` and the
 * target class, plus two element names. Everything below carries four or more
 * classes so the theme wins on specificity, not on stylesheet load order.
 */
.product.pdp-layout .pdp-gallery.images,
.product.pdp-layout .pdp-summary.summary {
  float: none;
  width: auto;
  clear: none;
  margin: 0;
}
.pdp-layout .pdp-gallery.images .pdp-main img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

/* `.woocommerce div.product p.price` sets an olive green at 1.25em, which
   overrode the buy box's large brand-green figure. */
.pdp-layout .pdp-summary .pdp-price.price {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary);
  margin-bottom: 18px;
}
.pdp-layout .pdp-summary .pdp-price.price ins { text-decoration: none; }
.pdp-layout .pdp-summary .pdp-price.price del {
  color: var(--muted);
  font-size: 21px;
  font-weight: 500;
  margin-right: 10px;
}
.pdp-layout .pdp-summary .pdp-price.price .woocommerce-Price-amount { font-size: inherit; }

/* Stock wording keeps the brand green rather than WooCommerce's olive. */
.pdp-layout .pdp-summary .pdp-meta .in-stock,
.pdp-layout .pdp-summary .stock.in-stock { color: var(--primary); }

/* The quantity stepper and add-to-cart button are laid out by flex, so the
   floats WooCommerce puts on them only cause rounding drift. */
.pdp-layout .pdp-summary .pdp-buy.cart .quantity,
.pdp-layout .pdp-summary .pdp-buy.cart .button,
.pdp-layout .pdp-summary .pdp-buy.cart .single_add_to_cart_button {
  float: none;
  margin: 0;
}
.pdp-layout .pdp-summary .pdp-buy.cart { margin-bottom: 0; }

/* Static arrows under the thumbnail strip. `.slider-arrow` is absolutely
   positioned for carousels; the gallery asks for `.is-static`, which had no
   rule, so the arrows sat on top of the thumbnails. */
.slider-arrow.is-static {
  position: static;
  transform: none;
  width: 38px;
  height: 38px;
}

/* ------------------------------------------------------------- 1. gallery */
.pdp-gallery { position: sticky; top: 110px; }

.pdp-main {
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}
.pdp-main img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  transition: transform .5s var(--ease);
}
.pdp-main.is-zoomed img { transform: scale(1.6); cursor: zoom-out; }

.pdp-zoom {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.pdp-zoom:hover { background: var(--primary); color: #fff; }

.pdp-thumbs { margin-top: 14px; }
.pdp-thumb {
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  display: block;
  transition: border-color .25s var(--ease);
}
.pdp-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
}
.pdp-thumb:hover { border-color: var(--primary); }
.pdp-thumb.is-active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

.pdp-thumb-nav { display: flex; gap: 8px; margin-top: 12px; }

/* ------------------------------------------------------------- 2. buy box */
.pdp-summary h1 {
  font-size: 27px;
  line-height: 1.35;
  margin-bottom: 12px;
}

.pdp-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--body);
  margin-bottom: 16px;
}
.pdp-rating .stars { color: var(--star); font-size: 14px; letter-spacing: 1px; }

.pdp-price {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 18px;
}

.pdp-meta { font-size: 13.5px; margin-bottom: 22px; }
.pdp-meta .label { font-weight: 500; color: var(--body); min-width: 82px; }
.pdp-meta .value { color: var(--ink); }
.pdp-meta .in-stock { color: var(--primary); }

.pdp-buy { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; }
.pdp-buy .btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.pdp-buy .btn i { font-size: 14px; }

.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.qty-stepper button {
  width: 38px;
  border: 0;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.qty-stepper button:hover { background: var(--primary); color: #fff; }
.qty-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.qty-stepper button:disabled:hover { background: #fff; color: var(--ink); }
.qty-stepper input {
  width: 52px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper input:focus { outline: 2px solid var(--primary); outline-offset: -2px; }

.btn-whatsapp {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-whatsapp:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(14, 158, 108, .28);
}

.pdp-links { display: flex; flex-wrap: wrap; gap: 24px; margin: 18px 0 26px; }
.pdp-links button {
  border: 0;
  background: none;
  padding: 0;
  font-size: 13.5px;
  color: var(--body);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color .25s var(--ease);
}
.pdp-links button:hover { color: var(--primary); }
.pdp-links button.is-saved { color: var(--danger); }

.safe-checkout { border-top: 1px solid var(--line); padding-top: 22px; }
.safe-checkout h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
}
.pay-badges { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.pay-badges img {
  height: 30px;
  width: auto;
  transition: transform .25s var(--ease);
}
.pay-badges img:hover { transform: translateY(-2px); }

/* ------------------------------------------------- 3. description panel */
.pdp-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  margin-bottom: 26px;
}
/* The markup renders anchors inside list items (WooCommerce's tab contract),
   so the underline styling has to target those, not bare buttons. */
.pdp-tabs button,
.pdp-tabs li a {
  border: 0;
  background: none;
  padding: 12px 4px;
  margin-bottom: -1px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--body);
  text-decoration: none;
  display: inline-block;
  border-bottom: 2px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.pdp-tabs button[aria-selected="true"],
.pdp-tabs li.active a { color: var(--primary); border-bottom-color: var(--primary); }
.pdp-tabs button:hover,
.pdp-tabs li a:hover { color: var(--primary); }
.pdp-tabs li { margin: 0; padding: 0; background: none; border: 0; }
.pdp-tabs li::before, .pdp-tabs li::after { display: none; }

.info-panel {
  background: var(--pdp-panel);
  border: 1px solid var(--pdp-border);
  border-radius: var(--radius);
  padding: 30px 32px;
  font-size: 13.5px;
  color: #42525c;
}
.info-panel h3 {
  color: var(--pdp-blue);
  font-size: 19px;
  margin-bottom: 6px;
}
.info-panel h4 {
  color: var(--pdp-blue);
  font-size: 15px;
  font-weight: 700;
  margin: 26px 0 12px;
}
.info-panel h5 {
  color: var(--pdp-blue);
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 9px;
}
.info-panel p { margin-bottom: 12px; line-height: 1.7; }
.info-lede { color: var(--pdp-pill); font-size: 13px; margin-bottom: 14px !important; }

.info-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.info-pill {
  background: var(--pdp-pill);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 20px;
}
.info-pill.is-light {
  background: #dcecf9;
  color: var(--pdp-blue-dark);
}

.info-card {
  background: var(--pdp-card);
  border: 1px solid var(--pdp-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  height: 100%;
  font-size: 12.5px;
  line-height: 1.65;
}
.info-card ul { padding-left: 17px; margin: 0; }
.info-card li { margin-bottom: 7px; }
.info-card li:last-child { margin-bottom: 0; }
.info-card strong { color: var(--pdp-blue-dark); }
.info-card p:last-child { margin-bottom: 0; }

.info-faq { margin-top: 8px; }
.info-faq dt {
  color: var(--pdp-blue);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 5px;
}
.info-faq dd { margin: 0 0 16px; font-size: 12.5px; line-height: 1.7; }

.info-trust { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 12px 0; }
.info-trust li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.info-trust i { color: var(--primary); font-size: 12px; }

.info-fineprint {
  font-size: 11.5px;
  color: #7e8d96;
  line-height: 1.6;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--pdp-border);
}

/* -------------------------------------------------------- 4. review band */
.stat-trio {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px 70px;
  margin-bottom: 42px;
  text-align: center;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}
.stat-caption {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.review-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.review-card .r-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
  display: block;
}
.review-card .r-city { font-size: 12px; color: var(--muted); display: block; margin-bottom: 10px; }
.review-card .r-stars { color: var(--star); font-size: 12.5px; margin-bottom: 12px; letter-spacing: 1px; }
.review-card .r-stars .fa-regular { color: #dfe5e3; }
.review-card .r-text { font-size: 13px; line-height: 1.7; margin-bottom: 16px; flex: 1; }
.verified-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
}
.review-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
}

/* reviews panel (rating breakdown + written reviews) */
.reviews-panel {
  border: 1px solid var(--line);
  padding: 32px 34px;
}
.reviews-panel h2 { font-size: 24px; margin-bottom: 22px; }
.reviews-summary { display: flex; align-items: center; gap: 34px; flex-wrap: wrap; }
.based-on { font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.rating-bars { flex: 1; min-width: 240px; max-width: 340px; }
.rating-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
}
.rating-bar .track {
  flex: 1;
  height: 12px;
  background: #f0f3f2;
  border: 1px solid var(--line);
  overflow: hidden;
}
.rating-bar .fill { height: 100%; background: var(--star); }
.rating-bar .pct { width: 38px; text-align: right; }
.rating-bar .count { width: 30px; }

.review-entry {
  border-top: 1px solid var(--line);
  padding: 24px 0;
}
.review-entry .re-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.review-entry .re-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 14.5px;
}
.review-entry h4 { font-size: 15px; margin-bottom: 8px; }
.review-entry p { font-size: 13.5px; margin-bottom: 12px; }
.review-photo {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--line-strong);
  font-size: 20px;
}

/* ---------------------------------------------------------------- 5. cart */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  text-align: left;
  padding: 0 14px 14px;
  border-bottom: 1px solid var(--line);
}
.cart-table td {
  padding: 26px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.cart-table .col-media { width: 190px; }
.cart-table .col-qty { width: 170px; }
.cart-table .col-remove { width: 70px; text-align: right; }

.cart-thumb {
  display: block;
  width: 150px;
  max-width: 100%;
}
.cart-thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; }

.cart-item-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.5;
}
.cart-item-title:hover { color: var(--primary); }
.cart-price, .cart-line-total { font-size: 15px; color: var(--ink); white-space: nowrap; }

.cart-remove {
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 19px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.cart-remove:hover { background: #fdecee; color: var(--danger); }

.cart-actions { display: flex; flex-wrap: wrap; gap: 22px; margin: 34px 0 10px; }
.cart-actions .btn { padding: 18px 42px; font-size: 15px; }

.cart-totals h2 { font-size: 27px; margin-bottom: 22px; }
.totals-table { width: 100%; border-collapse: collapse; }
.totals-table th,
.totals-table td {
  border: 1px solid var(--line);
  padding: 20px 22px;
  font-size: 15px;
}
.totals-table th {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  width: 42%;
}
.totals-table td { color: var(--ink); }
.totals-table tr:first-child th,
.totals-table tr:first-child td { background: #f7faf9; }
.totals-table .grand td { font-weight: 600; }

.btn-checkout {
  display: block;
  width: 100%;
  border: 0;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  padding: 20px;
  text-align: center;
  transition: background .25s var(--ease);
}
.btn-checkout:hover { background: var(--primary-dark); color: #fff; }

.btn-cod {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: #000;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  padding: 20px;
  transition: background .25s var(--ease);
}
.btn-cod:hover { background: #1c1c1c; color: #fff; }

.cart-empty {
  text-align: center;
  padding: 70px 20px;
  border: 1px dashed var(--line-strong);
}
.cart-empty i { font-size: 42px; color: var(--line-strong); margin-bottom: 18px; display: block; }
.cart-empty h2 { font-size: 24px; margin-bottom: 10px; }

/* ---------------------------------------------------------- 6. responsive */
@media (max-width: 1199.98px) {
  .pdp-summary h1 { font-size: 24px; }
  .pdp-price { font-size: 30px; }
  .info-panel { padding: 26px 22px; }
  .stat-trio { gap: 20px 46px; }
}

@media (max-width: 991.98px) {
  .pdp-gallery { position: static; }
  /* g-5 gutters give the row -24px side margins, wider than the container's
     15px padding — the product row would sit past the viewport edge. */
  .pdp-layout { --bs-gutter-x: 1.5rem; }
  .cart-table .col-media { width: 130px; }
  .cart-thumb { width: 104px; }
  .cart-totals { margin-top: 44px; }
  .reviews-panel { padding: 26px 22px; }
}

@media (max-width: 767.98px) {
  .pdp-summary h1 { font-size: 21px; }
  .pdp-price { font-size: 26px; }
  .pdp-buy { gap: 10px; }
  .pdp-buy .btn { flex: 1; }
  .pay-badges img { height: 26px; }
  .info-panel { padding: 20px 16px; font-size: 13px; }
  .stat-value { font-size: 27px; }
  .stat-trio { gap: 18px 30px; margin-bottom: 30px; }

  /* the cart table becomes a stacked card per line */
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table tr {
    position: relative;
    border-bottom: 1px solid var(--line);
    padding: 20px 0;
  }
  .cart-table td { border: 0; padding: 4px 0; }
  .cart-table .col-media { width: 100%; }
  .cart-thumb { width: 120px; margin: 0 auto 10px; }
  .cart-table .col-remove { position: absolute; top: 14px; right: 0; width: auto; }
  .cart-table td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 96px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
  }
  .cart-item-title { display: block; text-align: center; margin-bottom: 10px; }
  .cart-actions { gap: 12px; }
  .cart-actions .btn { flex: 1; padding: 15px 20px; font-size: 14px; }
  .totals-table th, .totals-table td { padding: 15px 16px; font-size: 14px; }
  .btn-checkout, .btn-cod { padding: 16px; font-size: 15px; }
}

/* ==========================================================================
   Shop layout — collapsible filter rail
   ========================================================================== */
.shop-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 18px;
  cursor: pointer;
  transition: border-color .25s var(--ease), color .25s var(--ease), background .25s var(--ease);
}
.filter-toggle:hover,
.filter-toggle:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.filter-toggle i { font-size: 13px; }

/* Collapsed: the rail is removed from the flow and the grid takes the width. */
.shop-layout.filters-hidden .shop-filters { display: none; }
.shop-layout.filters-hidden .shop-results {
  flex: 0 0 100%;
  max-width: 100%;
}

/* The rail animates in rather than snapping when it comes back. */
.shop-filters { animation: nico-filters-in .25s var(--ease); }
@keyframes nico-filters-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .shop-filters { animation: none; }
}
