/* ==========================================================
   AAT YAPI V17 — FINAL CONTRAST & MEMBER GATES
   Last-loaded safety layer for storefront + admin.
   ========================================================== */
html[data-theme="light"]{
  --v17-text:#101820;
  --v17-text-soft:#2f3c47;
  --v17-muted:#657686;
  --v17-page:#f5f7f9;
  --v17-surface:#ffffff;
  --v17-surface-2:#f7fafc;
  --v17-border:#d9e3ea;
}
html[data-theme="dark"]{
  --v17-text:#f5f8fa;
  --v17-text-soft:#d8e3ea;
  --v17-muted:#9eb0bd;
  --v17-page:#091119;
  --v17-surface:#101c26;
  --v17-surface-2:#14232e;
  --v17-border:#29404f;
}

/* Storefront foundation: text always contrasts with the selected theme. */
body.v11-modern{background:var(--v17-page)!important;color:var(--v17-text)!important}
.v11-modern .site-main{background:var(--v17-page)!important;color:var(--v17-text)!important}
.v11-modern .site-main :where(h1,h2,h3,h4,h5,h6){color:var(--v17-text)!important}
.v11-modern .site-main :where(p,li,dd,dt,label,legend,summary,td){color:var(--v17-text-soft)!important}
.v11-modern .site-main :where(small,.muted,.text-muted){color:var(--v17-muted)!important}
.v11-modern .site-main :where(input,select,textarea){background:var(--v17-surface)!important;color:var(--v17-text)!important;border-color:var(--v17-border)!important}
.v11-modern .site-main :where(input,textarea)::placeholder{color:var(--v17-muted)!important;opacity:1!important}
.v11-modern .site-main select option{background:var(--v17-surface)!important;color:var(--v17-text)!important}

/* Generic legacy surfaces that previously kept fixed light colors in dark mode. */
.v11-modern :where(
  .form-card,.table-wrap,.auth-card,.account-panel-v6,.support-info-v6,.support-form-v6,
  .checkout-card,.checkout-summary,.order-summary-card,.filter-panel,.summary,
  .ticket-detail-v6,.notification-list-v6>a,.invoice-list-v6>article,.account-order-card-v6,
  .address-card-v6,.checkout-address-card-v6,.search-suggestions,.notification-menu-v6,
  .account-dropdown-v101,.cart-drawer,.inquiry-drawer
){background:var(--v17-surface)!important;color:var(--v17-text)!important;border-color:var(--v17-border)!important}

.v11-modern :where(.table,.table-wrap) th{background:var(--v17-surface-2)!important;color:var(--v17-muted)!important;border-color:var(--v17-border)!important}
.v11-modern :where(.table,.table-wrap) td{background:transparent!important;color:var(--v17-text-soft)!important;border-color:var(--v17-border)!important}
.v11-modern :where(.table,.table-wrap) td b,
.v11-modern :where(.table,.table-wrap) td strong{color:var(--v17-text)!important}

/* Preserve intentional dark brand sections regardless of site theme. */
.v11-modern .site-footer,
.v11-modern .site-topbar{color:#eef5f8!important}
.v11-modern .site-footer :where(h1,h2,h3,h4,h5,h6,b,strong){color:#fff!important}
.v11-modern .site-footer :where(p,small,a,span){color:#b7c7d2!important}
.v11-modern .site-footer a:hover{color:#fff!important}
.v11-modern .site-topbar :where(a,span,b,strong){color:#dce8f0!important}

/* Statuses/buttons keep semantic colors instead of inheriting generic text. */
.v11-modern :where(.btn-primary,.btn-dark,.btn-accent){color:#182029!important}
.v11-modern :where(.status-pill,.status,.tag,.badge,.variant-chip){color:inherit}

/* Member-only quote/support gate. */
.v11-modern .member-gate-card-v17{
  display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:12px!important;
  padding:24px!important;background:var(--v17-surface)!important;border:1px solid var(--v17-border)!important;
  border-radius:20px!important;color:var(--v17-text)!important;box-shadow:0 18px 50px rgba(8,24,36,.10)!important
}
.v11-modern .member-gate-card-v17 .member-gate-icon-v17{
  width:50px!important;height:50px!important;display:grid!important;place-items:center!important;border-radius:16px!important;
  background:rgba(242,138,46,.12)!important;color:#ef8b30!important;font-size:22px!important;font-weight:900!important
}
.v11-modern .member-gate-card-v17>small{color:#d57926!important;font-size:10px!important;font-weight:900!important;letter-spacing:.14em!important}
.v11-modern .member-gate-card-v17 :where(h2,h3){margin:0!important;color:var(--v17-text)!important}
.v11-modern .member-gate-card-v17 p{margin:0 0 6px!important;color:var(--v17-text-soft)!important;line-height:1.65!important}
.v11-modern .inquiry-member-gate-v17{margin:18px!important}
.v11-modern .inquiry-member-gate-v17 .inquiry-product{margin-bottom:4px!important}

/* Long user-generated content must never be visually clipped. */
.v11-modern :where(.ticket-message p,.inquiry-message-content,.inquiry-message-full,.rich-text,.order-note p){
  white-space:pre-wrap!important;overflow:visible!important;text-overflow:clip!important;word-break:break-word!important;overflow-wrap:anywhere!important;
  -webkit-line-clamp:unset!important;line-clamp:unset!important;max-height:none!important
}

/* Admin: same contrast policy. */
body.admin-v12{background:var(--adm12-page)!important;color:var(--adm12-text)!important}
.admin-v12 .admin-main{color:var(--adm12-text)!important}
.admin-v12 .admin-main :where(h1,h2,h3,h4,h5,h6){color:var(--adm12-text)!important}
.admin-v12 .admin-main :where(p,li,dd,dt,label,legend,summary,td){color:var(--adm12-text)!important}
.admin-v12 .admin-main :where(small,.muted,.text-muted){color:var(--adm12-muted)!important}
.admin-v12 .admin-main :where(input,select,textarea){color:var(--adm12-text)!important;background:var(--adm12-surface-2)!important;border-color:var(--adm12-line-strong)!important}
.admin-v12 .admin-main :where(input,textarea)::placeholder{color:var(--adm12-muted)!important;opacity:1!important}
.admin-v12 .admin-main select option{background:var(--adm12-surface)!important;color:var(--adm12-text)!important}
.admin-v12 :where(.form-card,.table-wrap,.inquiry-admin-card,.inquiry-admin-form,.admin-info-v8,.payment-status-card){background:var(--adm12-surface)!important;color:var(--adm12-text)!important;border-color:var(--adm12-line)!important}
.admin-v12 .table th{background:var(--adm12-surface-2)!important;color:var(--adm12-muted)!important;border-color:var(--adm12-line)!important}
.admin-v12 .table td{color:var(--adm12-text)!important;border-color:var(--adm12-line)!important}
.admin-v12 :where(.inquiry-message-content,.inquiry-message-full,.ticket-message p,.admin-note,.rich-text){
  white-space:pre-wrap!important;overflow:visible!important;text-overflow:clip!important;word-break:break-word!important;overflow-wrap:anywhere!important;
  -webkit-line-clamp:unset!important;line-clamp:unset!important;max-height:none!important
}

html[data-theme="dark"] .admin-v12 .inquiry-admin-body{
  background:#0c1822!important;color:#edf5f8!important;border-color:var(--adm12-line)!important
}
html[data-theme="dark"] .admin-v12 .inquiry-admin-body :where(p,b,strong,span){color:#edf5f8!important}
html[data-theme="light"] .admin-v12 .inquiry-admin-body{
  background:#f5f8fa!important;color:#132433!important;border-color:#dce5eb!important
}
html[data-theme="light"] .admin-v12 .inquiry-admin-body :where(p,b,strong,span){color:#132433!important}

@media(max-width:720px){
  .v11-modern .member-gate-card-v17{padding:18px!important;border-radius:17px!important}
  .v11-modern .inquiry-member-gate-v17{margin:12px!important}
}

/* Intentional dark/brand sections need their own inverse text. */
.v11-modern :where(.catalog-hero-v5,.support-hero-v6,.account-hero-v6,.v5-project-band,.brand-zone-v5,.auth-copy){color:#f5f9fb!important}
.v11-modern :where(.catalog-hero-v5,.support-hero-v6,.account-hero-v6,.v5-project-band,.brand-zone-v5,.auth-copy) :where(h1,h2,h3,h4,h5,h6,b,strong){color:#fff!important}
.v11-modern :where(.catalog-hero-v5,.support-hero-v6,.account-hero-v6,.v5-project-band,.brand-zone-v5,.auth-copy) :where(p,span,small,label){color:#d2e0e8!important}
.v11-modern .catalog-hero-v5 .section-kicker,
.v11-modern .catalog-hero-v5>small,
.v11-modern .v5-project-band>small,
.v11-modern .brand-zone-v5 .v5-section-head>div>small{color:#ffb66f!important}

/* Account/support sub-surfaces were legacy light-only; synchronize them. */
html[data-theme="dark"] .v11-modern :where(
  .account-nav-v6,.account-stats-v6>div,.quick-account-grid>a,.order-meta-v6>span,.tracking-strip-v6,
  .profile-logo-editor-v6,.notification-list-v6,.notification-list-v6>a,.notification-list-v6>a.unread,
  .ticket-list-v6,.ticket-list-v6>a,.ticket-message,.ticket-message.customer,.ticket-message.admin,
  .support-topic-grid-v6>div,.support-member-cta-v6,.address-card-v6,.preference-list-v6>label
){background:var(--v17-surface-2)!important;color:var(--v17-text)!important;border-color:var(--v17-border)!important}
html[data-theme="dark"] .v11-modern :where(.account-stats-v6>div.accent,.tracking-strip-v6,.profile-logo-editor-v6,.support-member-cta-v6){background:linear-gradient(135deg,#132534,#172a36)!important}
html[data-theme="dark"] .v11-modern :where(.support-topic-grid-v6 span,.quick-account-grid span,.notification-list-v6>a>span,.invoice-icon-v6){background:#1a3040!important;color:#f1a04c!important}
html[data-theme="dark"] .v11-modern :where(.ticket-message p,.ticket-message small,.order-meta-v6 span,.order-meta-v6 b,.tracking-strip-v6 small,.support-topic-grid-v6 p,.support-member-cta-v6 p){color:var(--v17-text-soft)!important}
html[data-theme="dark"] .v11-modern .account-nav-v6>a{color:var(--v17-text-soft)!important}
html[data-theme="dark"] .v11-modern .account-nav-v6>a:hover,
html[data-theme="dark"] .v11-modern .account-nav-v6>a.active{background:#172b39!important;color:#fff!important}

/* Light theme safety for the same surfaces. */
html[data-theme="light"] .v11-modern :where(
  .account-nav-v6,.account-stats-v6>div,.quick-account-grid>a,.order-meta-v6>span,.tracking-strip-v6,
  .profile-logo-editor-v6,.notification-list-v6,.notification-list-v6>a,
  .ticket-list-v6,.ticket-list-v6>a,.ticket-message,.support-topic-grid-v6>div,.support-member-cta-v6
){color:var(--v17-text)!important;border-color:var(--v17-border)!important}
html[data-theme="light"] .v11-modern :where(.ticket-message p,.support-topic-grid-v6 p,.support-member-cta-v6 p){color:var(--v17-text-soft)!important}

/* ==========================================================
   AAT YAPI V13 — HIERARCHICAL BREADCRUMB / CATEGORY TREE
   ========================================================== */
.v11-modern .product-breadcrumb-band-v13{
  position:relative!important;overflow:hidden!important;background:linear-gradient(108deg,#123c5a 0%,#1c506f 52%,#192b3b 100%)!important;color:#fff!important;
  border-bottom:1px solid rgba(255,255,255,.10)!important;box-shadow:0 14px 34px rgba(14,42,62,.14)!important
}
.v11-modern .product-breadcrumb-band-v13:before,
.v11-modern .product-breadcrumb-band-v13:after{content:"";position:absolute;pointer-events:none;border-radius:50%;border:1px solid rgba(255,255,255,.09)}
.v11-modern .product-breadcrumb-band-v13:before{width:330px;height:330px;right:-110px;top:-205px;box-shadow:0 0 0 58px rgba(255,255,255,.025),0 0 0 116px rgba(255,255,255,.018)}
.v11-modern .product-breadcrumb-band-v13:after{width:180px;height:180px;left:18%;bottom:-150px;background:rgba(255,255,255,.035)}
.v11-modern .product-breadcrumb-band-v13>.container{position:relative;z-index:1;padding-top:19px;padding-bottom:20px}
.v11-modern .product-breadcrumb-meta-v13{display:flex;align-items:center;gap:10px;margin-bottom:10px;color:#9fc1d5;font-size:10px;font-weight:900;letter-spacing:.16em}
.v11-modern .product-breadcrumb-meta-v13 b{padding-left:10px;border-left:1px solid rgba(255,255,255,.22);color:#fff;font-size:11px;letter-spacing:.02em;text-transform:none}
.v11-modern .product-breadcrumb-v13{display:flex;align-items:center;gap:8px;flex-wrap:wrap;line-height:1.45;font-size:13px}
.v11-modern .product-breadcrumb-v13 a{display:inline-flex;align-items:center;gap:6px;color:#c5dbe8!important;text-decoration:none!important;font-weight:650;transition:color .18s ease,transform .18s ease}
.v11-modern .product-breadcrumb-v13 a:hover{color:#fff!important;transform:translateY(-1px)}
.v11-modern .product-breadcrumb-v13 .crumb-home{color:#e7f1f6!important}
.v11-modern .product-breadcrumb-v13 .crumb-home span{width:23px;height:23px;display:grid;place-items:center;border-radius:7px;background:rgba(255,255,255,.12);font-size:13px}
.v11-modern .product-breadcrumb-v13 i{font-style:normal;color:#7ea8be;font-size:18px;line-height:1}
.v11-modern .product-breadcrumb-v13 strong{display:inline-block;max-width:min(560px,100%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#fff!important;font-size:14px;font-weight:850}
.v11-modern .product-page-v103{padding-top:28px!important}

.admin-v12 .category-tree-card-v13 .card-title{align-items:center!important}
.admin-v12 .category-tree-card-v13 .card-title span{color:var(--adm12-muted)!important;font-size:11px!important}
.admin-v12 .category-admin-list.v6-visual-list{display:flex!important;flex-direction:column!important;gap:0!important}
.admin-v12 .category-admin-row{display:grid!important;grid-template-columns:56px minmax(0,1fr) auto!important;align-items:center!important;gap:14px!important;min-width:0!important;padding:13px 0!important;border-bottom:1px solid var(--adm12-line)!important}
.admin-v12 .category-admin-row:last-child{border-bottom:0!important}
.admin-v12 .category-admin-row>img,.admin-v12 .category-admin-row>.list-image-fallback{width:56px!important;height:56px!important;object-fit:cover!important;border-radius:14px!important;background:var(--adm12-surface-3)!important;border:1px solid var(--adm12-line)!important}
.admin-v12 .category-admin-row>.category-admin-name{display:flex!important;flex-direction:column!important;min-width:0!important;border-left:1px solid rgba(243,154,55,.26)!important}
.admin-v12 .category-admin-row>.category-admin-name b{display:block!important;color:var(--adm12-text)!important;font-size:13px!important;line-height:1.35!important;overflow-wrap:anywhere!important}
.admin-v12 .category-admin-row>.category-admin-name small{display:block!important;margin-top:4px!important;color:var(--adm12-muted)!important;font-size:10px!important;line-height:1.45!important;overflow-wrap:anywhere!important}
.admin-v12 .category-admin-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:9px!important;flex-wrap:wrap!important;white-space:nowrap!important}
.admin-v12 .category-admin-actions form{display:inline-flex!important;margin:0!important;padding:0!important}
.admin-v12 .category-admin-actions a{font-size:11px!important;font-weight:850!important;color:#bf671a!important;text-decoration:none!important}
.admin-v12 .category-admin-actions .btn{min-height:32px!important;padding:0 10px!important}

@media(max-width:720px){
  .v11-modern .product-breadcrumb-band-v13>.container{padding-top:15px;padding-bottom:16px}
  .v11-modern .product-breadcrumb-meta-v13{font-size:8px;margin-bottom:8px}
  .v11-modern .product-breadcrumb-meta-v13 b{font-size:9px}
  .v11-modern .product-breadcrumb-v13{gap:6px;font-size:11px}
  .v11-modern .product-breadcrumb-v13 strong{font-size:12px;white-space:normal;overflow:visible;text-overflow:clip}
  .admin-v12 .category-admin-row{grid-template-columns:48px minmax(0,1fr)!important;align-items:start!important;gap:10px!important}
  .admin-v12 .category-admin-row>img,.admin-v12 .category-admin-row>.list-image-fallback{width:48px!important;height:48px!important;border-radius:12px!important}
  .admin-v12 .category-admin-actions{grid-column:2!important;justify-content:flex-start!important;padding-top:3px!important}
}
