/**
 * Location: /assets/css/hdaf-single-product-summary.css
 * Purpose:
 * - Single Product Summary (V1) — base summary UI (title, rating, price, media, tools).
 * - Adds robust OUT OF STOCK styling for CTA (qty removed, button visible red + label).
 * - Old price styling: 8px smaller + black.
 * - ✅ Premium rating stars: filled + empty both GOLD (no dull grey).
 *
 * Related CSS:
 *  - /assets/css/single-product-layout.css
 *  - /assets/css/sidebar.css
 *  - /assets/css/hdaf-single-product-cta-bar.css
 *
 * Linkage/Loader:
 *  - Enqueued from /inc/features/woocommerce/single-product.php ONLY on is_product()
 */

/* ======================================================
   Single Product Summary (V1) — BASE
====================================================== */

.hdaf-sp-summary{ background:#fff; }

/* Breadcrumb row wrapper */
.single-product nav.woocommerce-breadcrumb{
  margin-top: -20px;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #6b7280;
}
.single-product nav.woocommerce-breadcrumb a{
  color: #111;
  text-decoration: none;
}
.single-product nav.woocommerce-breadcrumb a:hover{ text-decoration: underline; }
.single-product nav.woocommerce-breadcrumb span,
.single-product nav.woocommerce-breadcrumb .delimiter{
  margin: 0 6px;
  opacity: .6;
}

/* ======================================================
   SINGLE PRODUCT GRID — (your wrapper)
====================================================== */
@media (min-width: 901px){
  .hdaf-single-product-v1 .hdaf-sp__grid{
    display:grid;
    grid-template-columns: 40% 60%;
    gap:28px;
    align-items:start;
  }
}
@media (max-width: 900px){
  .hdaf-single-product-v1 .hdaf-sp__grid{
    display:grid;
    grid-template-columns:1fr;
    gap:18px;
    align-items:start;
  }
}

/* CATEGORY + TITLE */
.hdaf-sp-summary__cats{
  font-size:12px;
  letter-spacing:.02em;
  text-transform:uppercase;
  color:#6b7280;
  margin:0 0 10px;
}
.hdaf-sp-summary__title{
  font-size:34px;
  line-height:1.15;
  margin:0 0 10px;
  font-weight:800;
  color:#0f172a;
}

/* RATING */
.hdaf-sp-summary__rating{ margin:0 0 10px; }
.hdaf-sp-summary__rating .woocommerce-product-rating{
  margin:0;
  display:flex;
  align-items:center;
  gap:10px;
}

/* =========================================
   PREMIUM OFFICIAL RATING (NO GREY STARS)
   - Empty: soft light gold
   - Filled: strong premium gold
========================================= */
.hdaf-sp-summary__rating .star-rating{
  margin:0;
  font-size:16px;
  letter-spacing:2px;
  position:relative;
}
.hdaf-sp-summary__rating .star-rating:before{
  color:#FFD976; /* soft light gold (empty stars) */
}
.hdaf-sp-summary__rating .star-rating span:before{
  color:#FFB800; /* strong premium gold (filled stars) */
}

/* Rating count text (our custom count span) */
.hdaf-sp-summary__rating-count{
  font-size:14px;
  font-weight:600;
  color:#334155;
  line-height:1;
}

/* Keep Woo review link styling if it exists anywhere */
.hdaf-sp-summary__rating .woocommerce-review-link{
  font-size:13px;
  color:#334155;
  text-decoration:none;
}
.hdaf-sp-summary__rating .woocommerce-review-link:hover{ text-decoration:underline; }

/* Divider */
.hdaf-sp-summary__sep{ height:1px; background:rgba(15,23,42,.12); margin:14px 0; }

/* SOCIAL */
.hdaf-sp-summary__share{ display:flex; align-items:center; gap:10px; margin:0 0 10px; }
.hdaf-sp-summary__share-btn{
  width:38px;
  height:38px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.14);
  background:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:transform .15s ease, border-color .15s ease;
}
.hdaf-sp-summary__share-btn:hover{ transform:translateY(-1px); border-color:rgba(15,23,42,.28); }
.hdaf-sp-summary__share-btn img{ width:22px; height:22px; display:block; }

/* ======================================================
   TOOLS (Compare left, Wishlist right) — Mobile/Tablet perfect
====================================================== */
.hdaf-sp-summary__tools{
  display:flex;
  align-items:center;
  gap:18px;
  margin:6px 0 12px;
}

/* Tool base */
.hdaf-sp-summary__tool{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:6px 8px;
  border:0;
  background:transparent;
  cursor:pointer;
  color:#0f172a;
}
.hdaf-sp-summary__tool img{ width:18px; height:18px; display:block; }
.hdaf-sp-summary__tool span{ font-size:15px; color:#0f172a; }

/* Mobile/tablet: split to edges + tight icon/text */
@media (max-width: 980px){
  .hdaf-sp-summary__tools{
    justify-content:space-between;
    gap:12px;
  }
  .hdaf-sp-summary__tool{
    padding:4px 0;
    gap:8px;
    max-width:48%;
  }
  .hdaf-sp-summary__tool span{
    font-size:13px;
    line-height:1.15;
    white-space:normal;
  }
}

/* DESCRIPTION */
.hdaf-sp-summary__excerpt{
  margin:10px 0 16px;
  color:#334155;
  font-size:15px;
  line-height:1.65;
}
.hdaf-sp-summary__excerpt ul{
  margin:6px 0 0;
  padding-left:0;
  list-style:disc;
  list-style-position:inside;
}
.hdaf-sp-summary__excerpt li{ margin:4px 0; color:#334155; }

/* ======================================================
   PRICE + STOCK ROW (Price left, Stock right)
====================================================== */
.hdaf-sp-summary__price-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:14px;
  margin: 0 0 12px;
}

/* =========================================
   PRICE FIX — Stable color + custom sizes
========================================= */

/* Main price color back to default black */
.hdaf-sp-summary__price .price{
  font-weight:800;
  color:#000 !important;
  margin:0;
  display:block;
}

/* NEW price (current price) */
.hdaf-sp-summary__price .price ins,
.hdaf-sp-summary__price .price > .woocommerce-Price-amount{
  font-size:30px !important;
  color:#000 !important;
  text-decoration:none;
}

/* OLD price */
.hdaf-sp-summary__price .price del{
  font-size:20px !important;
  color:#000 !important;
  opacity:.7;
  margin-right:8px;
}

/* Stock */
.hdaf-sp-summary__stock{
  margin:0;
  font-size:15px;
  color:#111827;
  text-align:right;
  white-space:nowrap;
}

/* Mobile/tablet tune */
@media (max-width: 980px){
  .hdaf-sp-summary__price-row{ margin: 0 0 14px; }
  .hdaf-sp-summary__price .price{ font-size:34px; }
  .hdaf-sp-summary__stock{ font-size:14px; }
}

/* ✅ DESKTOP ONLY: move stock under price (left) */
@media (min-width: 981px){
  .single-product .hdaf-sp-summary__price-row{
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
    margin-bottom: 14px;
  }

  .single-product .hdaf-sp-summary__stock{
    text-align: left;
    white-space: nowrap;
  }
}

/* Hide duplicate stock inside form (Woo output) */
.hdaf-sp-summary__cart .stock,
.hdaf-sp-summary__cart .woocommerce-variation-availability{
  display:none !important;
}

/* ======================================================
   OUT OF STOCK — CTA behavior (Inline form)
   - Button stays visible, becomes RED + disabled
   - Qty row hidden (fallback)
====================================================== */

/* If our simple.php sets this flag on form */
.single-product form.cart[data-hdaf-oos="1"] .hdaf-sp-summary__cta-qtyrow{
  display:none !important;
}

/* JS adds this class to the real button (simple + variations) */
.single-product .single_add_to_cart_button.hdaf-sp-oos-btn{
  background:#dc2626 !important;      /* red */
  border-color:#dc2626 !important;
  color:#fff !important;
  box-shadow:none !important;
  cursor:not-allowed !important;
  opacity:1 !important;               /* keep premium visible */
}

/* Disabled state consistency */
.single-product .single_add_to_cart_button.hdaf-sp-oos-btn[disabled]{
  filter:saturate(.95);
}

/* ======================================================
   MEDIA card (gallery wrapper styling)
====================================================== */
.hdaf-sp__media{
  border:1px solid #eee;
  border-radius:18px;
  background:#fff;
  padding:18px;
}
.hdaf-sp__media .woocommerce-product-gallery__wrapper{
  border:0 !important;
  border-radius:14px;
  overflow:hidden;
  background:#fafafa;
}
.hdaf-sp__media .woocommerce-product-gallery__trigger{
  left:auto !important;
  right:12px !important;
  top:12px !important;
  margin:0 !important;
  width:40px;
  height:40px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.14);
  background:#fff;
  display:flex !important;
  align-items:center;
  justify-content:center;
  box-shadow:none;
  z-index:5;
}
.hdaf-sp__media .woocommerce-product-gallery__trigger::before{ font-size:18px; }

/* CTA compatibility (no layout rules here) */
.hdaf-sp-summary__bar,
.hdaf-sp-summary__cart,
.hdaf-sp-summary__cta,
.hdaf-sp-summary__cta-row,
.hdaf-sp-summary__cta-extra{
  min-width:0;
}

/* Small title sizing on mobile (kept) */
@media (max-width: 900px){
  .hdaf-sp-summary__title{ font-size:28px; }
  .hdaf-sp-summary__options table.variations select{ max-width:none; }
}

/* =========================================
   FIX: Variation UI inline + CTA stability
   File: /assets/css/hdaf-single-product-summary.css
========================================= */

/* 1) Keep variations area separate and stable */
.hdaf-sp-summary form.cart{
  display:block;
}

/* 2) Variations table → inline items (label + options) */
.hdaf-sp-summary .variations{
  width:100%;
  margin:10px 0 0;
  border:0;
}
.hdaf-sp-summary .variations tr{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.hdaf-sp-summary .variations td,
.hdaf-sp-summary .variations th{
  padding:0 !important;
  border:0 !important;
}

/* label (e.g. size) */
.hdaf-sp-summary .variations th.label{
  width:auto;
  min-width:auto;
  font-weight:700;
  margin-right:6px;
}

/* default select cell */
.hdaf-sp-summary .variations td.value{
  width:auto;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* 3) Swatches wrap inline */
.hdaf-sp-summary .hdaf-swatches-wrap{
  display:inline-flex;
  align-items:center;
  gap:10px;
}
.hdaf-sp-summary .hdaf-swatches{
  margin:0 !important;
  flex-direction:row !important;
  align-items:center;
  gap:10px !important;
}
.hdaf-sp-summary .hdaf-swatches__list{
  gap:8px;
}

/* Clear button inline + compact */
.hdaf-sp-summary .hdaf-swatches__clear{
  padding:7px 10px;
  border-radius:10px;
}

/* 4) Hide Woo default reset link ("Clear") to avoid duplicate */
.hdaf-sp-summary a.reset_variations{
  display:none !important;
}

/* 5) Prevent variation blocks from pushing CTA row */
.hdaf-sp-summary .single_variation_wrap,
.hdaf-sp-summary .woocommerce-variation-add-to-cart{
  width:100%;
}

/* IMPORTANT: CTA container should never wrap because of variations */
.hdaf-sp-summary .hdaf-sp-summary__cta-row,
.hdaf-sp-summary [data-hdaf-cta-row]{
  flex-wrap:nowrap !important;
}

/* =====================================================
   FIX: Stable vertical gap between
   Variations → Price → CTA buttons
   (Keeps 20px gap even when price appears)
===================================================== */

/* 1) Variations block bottom gap */
.hdaf-sp-summary .variations,
.hdaf-sp-summary .hdaf-swatches-wrap{
  margin-bottom:20px !important;
}

/* 2) Woo variation price/result block spacing */
.hdaf-sp-summary .single_variation_wrap{
  margin-bottom:20px !important;
}

/* Price itself (extra safety) */
.hdaf-sp-summary .woocommerce-variation{
  margin-bottom:20px !important;
}

/* 3) CTA row must NEVER touch content above */
.hdaf-sp-summary .hdaf-sp-summary__cta-row,
.hdaf-sp-summary [data-hdaf-cta-row]{
  margin-top:20px !important;
}

/* 4) Quantity row spacing (if present above CTA) */
.hdaf-sp-summary .hdaf-sp-summary__cta-qtyrow{
  margin-bottom:20px !important;
}

/* 5) Prevent collapse when variation is hidden */
.hdaf-sp-summary .single_variation_wrap:empty{
  display:block;
  min-height:20px;
}
/* =========================================
   Single Product Summary Interaction Fixes
   Location: /assets/css/hdaf-single-product-summary.css
   Purpose:
   - Prevent rating stars from clipping.
   - Style engine-connected compare/wishlist tools.
   - Keep short description collapsed by default in a clean dropdown.
========================================= */
.hdaf-sp-summary__rating .star-rating{
  width:6.4em !important;
  min-width:6.4em !important;
  height:1.25em !important;
  line-height:1.25 !important;
  overflow:hidden !important;
  letter-spacing:1px !important;
}

.hdaf-sp-summary__rating .star-rating::before,
.hdaf-sp-summary__rating .star-rating span::before{
  line-height:1.25 !important;
}

.hdaf-sp-summary__tool{
  border-radius:10px;
  transition:background-color .16s ease, color .16s ease, transform .16s ease;
}

.hdaf-sp-summary__tool:hover,
.hdaf-sp-summary__tool:focus-visible{
  background:rgba(15,23,42,.06);
}

.hdaf-sp-summary__tool.is-active{
  background:transparent !important;
}

.hdaf-sp-summary__tool.is-active span{
  font-weight:900;
}

.hdaf-sp-summary__tool-img{
  width:18px;
  height:18px;
  display:block;
  flex:0 0 18px;
}

.hdaf-sp-summary__tool--wishlist .hdaf-sp-summary__tool-img--active{
  display:none;
}

.hdaf-sp-summary__tool--wishlist.is-active .hdaf-sp-summary__tool-img--empty{
  display:none;
}

.hdaf-sp-summary__tool--wishlist.is-active .hdaf-sp-summary__tool-img--active{
  display:block;
}

.hdaf-sp-summary__excerpt-panel{
  margin:10px 0 16px;
  border:1px solid rgba(15,23,42,.12);
  border-radius:14px;
  background:#fff;
  overflow:hidden;
}

.hdaf-sp-summary__excerpt-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  cursor:pointer;
  color:#0f172a;
  font-size:14px;
  font-weight:800;
  line-height:1.2;
  list-style:none;
  user-select:none;
}

.hdaf-sp-summary__excerpt-toggle::-webkit-details-marker{
  display:none;
}

.hdaf-sp-summary__excerpt-plus{
  position:relative;
  flex:0 0 18px;
  width:18px;
  height:18px;
}

.hdaf-sp-summary__excerpt-plus::before,
.hdaf-sp-summary__excerpt-plus::after{
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:14px;
  height:2px;
  border-radius:999px;
  background:#0f172a;
  transform:translate(-50%,-50%);
}

.hdaf-sp-summary__excerpt-plus::after{
  transform:translate(-50%,-50%) rotate(90deg);
}

.hdaf-sp-summary__excerpt-panel[open] .hdaf-sp-summary__excerpt-plus::after{
  opacity:0;
}

.hdaf-sp-summary__excerpt-panel .hdaf-sp-summary__excerpt{
  margin:0;
  padding:0 14px 14px;
  border-top:1px solid rgba(15,23,42,.08);
}

@media (max-width: 980px){
  .hdaf-sp-summary__excerpt-toggle{
    padding:11px 12px;
  }
  .hdaf-sp-summary__excerpt-panel .hdaf-sp-summary__excerpt{
    padding:0 12px 12px;
  }
}


/* =========================================
   Single Product Tool Active State + Rating Edge Fix
   Location: /assets/css/hdaf-single-product-summary.css
   Purpose:
   - Active compare/wishlist text becomes bold without changing background.
   - Prevent the last rating star from clipping on single product pages.
========================================= */
.hdaf-sp-summary__rating .star-rating{
  width:7.1em !important;
  min-width:7.1em !important;
  overflow:visible !important;
}

.hdaf-sp-summary__rating .star-rating span{
  overflow:hidden !important;
}

.hdaf-sp-summary__tool.is-active,
.hdaf-sp-summary__tool.is-active:hover,
.hdaf-sp-summary__tool.is-active:focus-visible{
  background:transparent !important;
}

.hdaf-sp-summary__tool.is-active span{
  font-weight:900 !important;
}
