
/* ==========================================================
   Aafiyora v4.1 QA + Performance + WooCommerce Polish
   ========================================================== */

:root{
  --a41-forest:#263728;
  --a41-text:#52604F;
  --a41-muted:#6F7A69;
  --a41-cream:#FFF8EC;
  --a41-white:#FFFFFF;
  --a41-sage:#EAF1E6;
  --a41-gold:#C9A45C;
  --a41-warning:#A66A22;
  --a41-ok:#237447;
  --a41-line:rgba(38,55,40,.12);
  --a41-shadow:0 24px 70px rgba(38,55,40,.12);
}

/* Performance-safe frontend */
.aafi-v41-performance-mode *{
  scroll-behavior:auto;
}

.aafi-v41-performance-mode .reveal,
.aafi-v41-performance-mode .aafi-product-card,
.aafi-v41-performance-mode .aafi-wc-card,
.aafi-v41-performance-mode .aafi-deal-card{
  will-change:auto!important;
}

.aafi-v41-mobile-safe-motion .aafi-product-card,
.aafi-v41-mobile-safe-motion .aafi-wc-card,
.aafi-v41-mobile-safe-motion .aafi-deal-card,
.aafi-v41-mobile-safe-motion .goal-selector-card-v35{
  transition:transform .18s ease, box-shadow .18s ease!important;
}

/* Fix common text contrast risks from older patch layers */
.site-main :where(h1,h2,h3,h4,h5,h6):not(.site-footer *):not(.launch-proof-v36 *){
  color:var(--a41-forest)!important;
  text-shadow:none!important;
}

.site-main :where(p,li,span,small):not(.btn *):not(.site-footer *):not(.launch-proof-v36 *):not(.aafi-hot-label):not(.aafi-sale-label){
  text-shadow:none!important;
}

/* WooCommerce empty cart polish */
.aafi-v41-empty-cart,
.aafi-v41-no-products{
  width:min(940px,calc(100% - 32px));
  margin:48px auto;
  padding:clamp(24px,4vw,44px);
  border-radius:34px;
  background:
    radial-gradient(circle at 88% 10%,rgba(201,164,92,.14),transparent 22rem),
    linear-gradient(145deg,#FFF8EC,#EEF4E9);
  border:1px solid var(--a41-line);
  box-shadow:var(--a41-shadow);
  text-align:center;
}

.aafi-v41-empty-cart h2,
.aafi-v41-no-products h2{
  margin:.45rem auto .7rem;
  max-width:720px;
  color:var(--a41-forest);
  font-family:var(--font-heading, Georgia, serif);
  font-size:clamp(2.2rem,4vw,4rem);
  line-height:1.04;
  letter-spacing:-.04em;
}

.aafi-v41-empty-cart p,
.aafi-v41-no-products p{
  max-width:660px;
  margin:0 auto 18px;
  color:var(--a41-text)!important;
}

.aafi-v41-empty-actions{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:10px;
  margin-top:18px;
}

.aafi-v41-empty-recommendations{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-top:26px;
}

.aafi-v41-empty-recommendations a{
  display:grid;
  gap:8px;
  padding:14px;
  border-radius:24px;
  background:rgba(255,255,255,.82);
  border:1px solid var(--a41-line);
  text-decoration:none!important;
  color:var(--a41-forest)!important;
  box-shadow:0 16px 46px rgba(38,55,40,.08);
}

.aafi-v41-empty-recommendations img{
  width:100%;
  aspect-ratio:1.05/1;
  object-fit:cover;
  border-radius:18px;
  background:var(--a41-sage);
}

.aafi-v41-empty-recommendations strong{
  color:var(--a41-forest);
  font-weight:950;
}

.aafi-v41-empty-recommendations span{
  color:var(--a41-text);
  font-weight:850;
}

.aafi-v41-suggested-searches{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  margin-top:20px;
}

.aafi-v41-suggested-searches a{
  padding:.72rem 1rem;
  border-radius:999px;
  background:#fff;
  border:1px solid var(--a41-line);
  color:var(--a41-forest)!important;
  text-decoration:none!important;
  font-weight:950;
}

/* Product QA panel */
.aafi-v41-product-qa-panel{
  padding:42px 0;
  background:linear-gradient(180deg,#FFF8EC,#F8EEDC);
  border-top:1px solid var(--a41-line);
}

.aafi-v41-qa-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}

.aafi-v41-qa-grid article{
  padding:18px;
  border-radius:22px;
  background:#fff;
  border:1px solid var(--a41-line);
  box-shadow:0 14px 42px rgba(38,55,40,.08);
}

.aafi-v41-qa-grid article.is-ok{
  border-color:rgba(35,116,71,.28);
  background:linear-gradient(145deg,#fff,#F1FFF5);
}

.aafi-v41-qa-grid article.is-warning{
  border-color:rgba(166,106,34,.32);
  background:linear-gradient(145deg,#fff,#FFF7E6);
}

.aafi-v41-qa-grid strong{
  display:block;
  color:var(--a41-forest);
  font-weight:950;
  margin-bottom:6px;
}

.aafi-v41-qa-grid span{
  color:var(--a41-text)!important;
  font-size:.92rem;
  line-height:1.45;
}

/* Cart/checkout polish */
.woocommerce-cart .cart_totals,
.woocommerce-checkout-review-order,
.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-shipping-fields{
  border-radius:26px!important;
  background:rgba(255,255,255,.82)!important;
  border:1px solid var(--a41-line)!important;
  box-shadow:0 18px 56px rgba(38,55,40,.10)!important;
  padding:18px!important;
}

.woocommerce table.shop_table{
  border-radius:22px!important;
  overflow:hidden!important;
  border:1px solid var(--a41-line)!important;
}

.woocommerce table.shop_table th{
  color:var(--a41-forest)!important;
  font-weight:950!important;
}

.woocommerce table.shop_table td{
  color:var(--a41-text)!important;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select{
  min-height:48px!important;
  border-radius:14px!important;
  border:1px solid var(--a41-line)!important;
  background:#fff!important;
  color:var(--a41-forest)!important;
  padding:.78rem .9rem!important;
}

.woocommerce-error,
.woocommerce-info,
.woocommerce-message{
  border-radius:18px!important;
  border-top:0!important;
  background:#fff!important;
  box-shadow:0 14px 42px rgba(38,55,40,.08)!important;
  color:var(--a41-forest)!important;
}

/* Buttons consistency */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button{
  border-radius:999px!important;
  font-weight:950!important;
}

/* Mobile safety */
@media(max-width:980px){
  .aafi-v41-qa-grid,
  .aafi-v41-empty-recommendations{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:760px){
  .aafi-v41-mobile-safe-motion *{
    animation-duration:.001ms!important;
    animation-iteration-count:1!important;
    transition-duration:.18s!important;
  }

  .aafi-v41-qa-grid,
  .aafi-v41-empty-recommendations{
    grid-template-columns:1fr;
  }

  .aafi-v41-empty-cart,
  .aafi-v41-no-products{
    width:calc(100% - 24px);
    margin:28px auto;
    padding:24px 16px;
    border-radius:26px;
  }

  .woocommerce-cart .cart_totals,
  .woocommerce-checkout-review-order,
  .woocommerce-checkout .woocommerce-billing-fields,
  .woocommerce-checkout .woocommerce-shipping-fields{
    padding:14px!important;
    border-radius:20px!important;
  }
}

@media(prefers-reduced-motion:reduce){
  .aafi-v41-performance-mode *,
  .aafi-v41-mobile-safe-motion *{
    animation:none!important;
    transition:none!important;
    scroll-behavior:auto!important;
  }
}
