/* =====================================================================
   shop.css — Cart, Checkout, Login/Register, My Account, Orders.
   Reuses the reference design tokens only (--ink --muted --glass --line
   --gold --green --shadow --radius --btn-bg) so every Theme applies.
   No inline styles, logical properties (RTL-safe). reference.css stays locked.
   ===================================================================== */
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.muted{color:var(--muted)}
.cart-count{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;margin-inline-start:4px;border-radius:100px;background:var(--btn-bg,#1d211f);color:#fff;font:700 11px/1 system-ui,sans-serif;vertical-align:top}

.shop-page{padding-bottom:70px}
.shop-page.container:not(.page-content){padding-top:150px}
.shop-narrow{max-width:560px;margin-inline:auto}
.shop-card,.shop-empty,.cart-lines,.cart-summary,.account-nav,.checkout-main>section{border-radius:var(--radius,28px);padding:26px}
.shop-card{margin-bottom:20px}
.shop-card h3,.cart-summary h3{font:500 24px Georgia,serif;margin:0 0 14px}
.shop-empty{text-align:center;display:flex;flex-direction:column;gap:18px;align-items:center;padding:50px 26px}
.shop-text{color:var(--muted);line-height:1.7;margin:0 0 20px}
.shop-note{color:var(--muted);font-size:13px;margin-top:14px}
.shop-links{display:flex;flex-wrap:wrap;gap:16px;margin-top:18px}
.shop-links a,.shop-form a,.account-main a:not(.btn),.shop-text a{color:var(--ink);font-weight:650}

/* Forms (storefront) */
.shop-form{border-radius:var(--radius,28px);padding:30px}
.shop-page .field{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}
.shop-page .field label{font-weight:700;font-size:13px}
.shop-page .field .req{color:#a3321f}
.shop-page .field input,.shop-page .field select,.shop-page .field textarea,.coupon-row input,.cart-qty input{border:1px solid var(--line);background:rgba(255,255,255,.7);padding:13px 15px;border-radius:15px;outline:none;font:inherit;color:var(--ink);width:100%}
.shop-page .field input:focus,.shop-page .field select:focus,.shop-page .field textarea:focus,.coupon-row input:focus,.cart-qty input:focus{border-color:var(--gold)}
.shop-page .field-check label{display:flex;gap:10px;align-items:flex-start;font-weight:600}
.shop-page .field-check input{width:auto;margin-top:3px}
.shop-page .field-help{color:var(--muted);font-size:13px;margin:0}
.shop-page .field-error{color:#a3321f;font-size:13px;font-weight:650;margin:0}
.shop-page .has-error input,.shop-page .has-error select,.shop-page .has-error textarea{border-color:#a3321f}
.field-row,.form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:0 16px}
.shop-form .btn,.cart-summary .btn,.checkout-main .btn.place{width:100%;justify-content:center;margin-top:6px}
.btn-link{background:none;border:0;color:var(--ink);text-decoration:underline;cursor:pointer;font:inherit;font-weight:650;padding:0}

/* Notices */
.notice{border-radius:18px;padding:14px 18px;margin-bottom:18px;background:rgba(255,255,255,.7);border:1px solid var(--line);font-weight:600}
.notice-err{border-color:#a3321f;color:#7d2415}
.notice-warn{border-color:var(--gold)}
.notice-info{border-color:var(--green)}

/* Cart */
.cart-layout,.checkout-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(300px,1fr);gap:24px;align-items:start}
.cart-lines ul{list-style:none;margin:0;padding:0}
.cart-line{display:grid;grid-template-columns:84px minmax(0,1fr) 90px auto;gap:16px;align-items:center;padding:16px 0;border-bottom:1px solid var(--line)}
.cart-line:last-child{border-bottom:0}
.cart-thumb{width:84px;height:84px;border-radius:18px;background:rgba(255,255,255,.55);overflow:hidden;display:grid;place-items:center}
.cart-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.cart-info{display:flex;flex-direction:column;gap:4px;min-width:0}
.cart-info strong{overflow-wrap:anywhere}
.cart-actions{display:flex;gap:14px;flex-wrap:wrap;margin-top:6px;font-size:13px}
.cart-qty input{text-align:center;padding:10px 6px}
.cart-total{font-weight:800;text-align:end;white-space:nowrap}
.cart-update{display:flex;justify-content:flex-end;padding-top:16px}
.cart-summary{position:sticky;top:110px;display:flex;flex-direction:column;gap:14px}
.cart-note{font-size:12px;margin:0}
.coupon-form label{font-weight:700;font-size:13px;display:block;margin-bottom:6px}
.coupon-row{display:flex;gap:8px}
.coupon-row .btn{margin:0;width:auto}

/* Totals / order summary */
.totals{margin:0;display:flex;flex-direction:column;gap:8px}
.totals>div{display:flex;justify-content:space-between;gap:12px}
.totals dt{color:var(--muted)}
.totals dd{margin:0;font-weight:700}
.totals .grand{border-top:1px solid var(--line);padding-top:12px;margin-top:4px;font-size:18px}
.totals .grand dt{color:var(--ink);font-weight:800}
.summary-lines{list-style:none;margin:0 0 14px;padding:0;display:flex;flex-direction:column;gap:8px}
.summary-lines li{display:flex;justify-content:space-between;gap:12px}

/* Checkout */
.checkout-main{display:flex;flex-direction:column;gap:20px}
.checkout-main>section{background:var(--glass)}
.checkout-main h3{font:500 22px Georgia,serif;margin:0 0 14px}
.choice{display:flex;gap:12px;align-items:flex-start;padding:14px 16px;border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.55);margin-bottom:10px;cursor:pointer}
.choice input{margin-top:4px;width:auto;accent-color:var(--green)}
.choice small{display:block;color:var(--muted);margin-top:2px}
.choice:has(input:checked){border-color:var(--gold);background:rgba(255,255,255,.85)}
.addr-fields{margin-top:6px}
.confirmation{max-width:720px;margin-inline:auto}
.order-no{font:500 34px Georgia,serif;letter-spacing:.02em}

/* Account */
.account-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:24px;align-items:start}
.account-nav{display:flex;flex-direction:column;gap:4px;padding:14px;position:sticky;top:110px}
.account-nav a,.account-nav .btn-link{padding:12px 14px;border-radius:14px;color:var(--ink);text-decoration:none;font-weight:650;display:flex;justify-content:space-between;align-items:center;text-align:start}
.account-nav a:hover,.account-nav a.on{background:rgba(255,255,255,.75)}
.account-nav .btn-link{width:100%;text-decoration:none;opacity:.8}
.count-pill{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:100px;background:var(--btn-bg,#1d211f);color:#fff;font-size:11px;font-weight:800}
.stat-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px;margin-bottom:20px}
.stat-card{border-radius:24px;padding:22px;display:flex;flex-direction:column;gap:6px;text-decoration:none;color:var(--ink)}
.stat-card b{font:500 34px Georgia,serif}
.stat-card span{color:var(--muted);font-size:13px}
.big-number{font:500 56px Georgia,serif}
.addr-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}
.order-list{list-style:none;margin:0;padding:0}
.order-list li{padding:14px 0;border-bottom:1px solid var(--line)}
.order-list li:last-child{border-bottom:0}
.order-list li.unread{font-weight:700}
.row-flat{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.order-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.two-col{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:20px}
.sum{display:flex;flex-direction:column;gap:6px;margin-top:16px}
.sum>div{display:flex;justify-content:space-between;gap:12px}
.sum-grand{border-top:1px solid var(--line);padding-top:10px;font-weight:800;font-size:18px}
.timeline{list-style:none;margin:0;padding:0;border-inline-start:2px solid var(--line);display:flex;flex-direction:column;gap:14px}
.timeline li{padding-inline-start:16px;position:relative}
.timeline li:before{content:"";position:absolute;inset-inline-start:-6px;top:6px;width:10px;height:10px;border-radius:50%;background:var(--gold)}
.cart-lines .is-unavailable{opacity:.55}

/* Status pills (store) */
.pill{display:inline-block;padding:4px 12px;border-radius:100px;font-size:12px;font-weight:800;background:rgba(255,255,255,.8);border:1px solid var(--line)}
.pill.st-pending{background:rgba(178,138,86,.2)}
.pill.st-confirmed,.pill.st-processing{background:rgba(66,102,92,.16);color:#254a3f}
.pill.st-shipped{background:rgba(66,102,92,.3);color:#1d3a31}
.pill.st-delivered{background:rgba(66,102,92,.45);color:#fff}
.pill.st-cancelled{background:rgba(0,0,0,.1);color:#555}

.shop-pager{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;margin-top:22px}
.shop-pager a,.shop-pager span{padding:8px 14px;border-radius:12px;background:rgba(255,255,255,.55);color:var(--ink);text-decoration:none;font-weight:700}
.shop-pager span{background:var(--btn-bg,#1d211f);color:#fff}

@media(max-width:900px){
  .cart-layout,.checkout-layout,.account-layout{grid-template-columns:1fr}
  .cart-summary,.account-nav{position:static}
  .account-nav{flex-direction:row;flex-wrap:wrap}
}
@media(max-width:560px){
  .cart-line{grid-template-columns:64px minmax(0,1fr);grid-template-areas:"t i" "q p"}
  .cart-thumb{width:64px;height:64px;grid-area:t}.cart-info{grid-area:i}.cart-qty{grid-area:q;max-width:110px}.cart-total{grid-area:p}
  .shop-form,.shop-card,.shop-empty{padding:20px}
}
.shop-form.checkout-layout{padding:0;border-radius:0}
.order-list a{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;color:var(--ink);text-decoration:none;font-weight:650}
.account-main .shop-card>.btn,.account-main .shop-card>a.btn{margin-top:14px}
/* <nav class="account-nav"> must not inherit the header's `nav{margin-left:auto}` from reference.css */
.account-nav{margin:0;width:auto}
.sum-items{list-style:none;margin:0 0 14px;padding:0;display:flex;flex-direction:column;gap:6px}
.sum-items li{display:flex;justify-content:space-between;gap:12px}
.sum dd,.sum dt{margin:0}.sum dt{color:var(--muted)}.sum dd{font-weight:700}

/* Order progress (customer) */
.trk{list-style:none;margin:18px 0;padding:0;display:flex;gap:0;counter-reset:s}
.trk-step{flex:1;display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;position:relative;font-size:12px;font-weight:700}
.trk-step:before{content:"";position:absolute;top:13px;inset-inline-start:-50%;width:100%;height:3px;background:var(--line,#d9ccb8);z-index:0}
.trk-step:first-child:before{display:none}
.trk-dot{position:relative;z-index:1;width:28px;height:28px;border-radius:50%;background:#fff;border:3px solid var(--line,#d9ccb8);display:grid;place-items:center;font-size:14px;color:#fff;line-height:1}
.trk-done .trk-dot{background:var(--green,#2e6b4f);border-color:var(--green,#2e6b4f)}
.trk-done:before,.trk-current:before{background:var(--green,#2e6b4f)}
.trk-current .trk-dot{border-color:var(--gold,#c9a55c);box-shadow:0 0 0 5px color-mix(in srgb,var(--gold,#c9a55c) 25%,transparent)}
.trk-todo{opacity:.6}
.trk-at{font-size:11px;font-weight:600;min-height:14px}
.trk-off{opacity:.45}
.trk-cancelled{margin-bottom:8px}
@media(max-width:560px){.trk{flex-direction:column;gap:14px}.trk-step{flex-direction:row;text-align:start;gap:12px}.trk-step:before{display:none}}
.trk-title{font-size:clamp(24px,5vw,34px)!important;overflow-wrap:anywhere}.trk-ship{margin:10px 0 18px}
