/* Shared shop parts: bag drawer, toast, cards, shop page, product page, checkout.
   Each template sets the look with these variables in its own css/style.css. */
:root {
  --s-bg: #fff; --s-paper: #fff; --s-ink: #111; --s-mute: #6b6b6b; --s-line: #e6e6e6; --s-soft: #f4f4f4;
  --s-accent: #111; --s-accent-ink: #fff; --s-radius: 14px; --s-card: 12px; --s-display: inherit; --s-body: inherit;
}
.qty { display: inline-flex; align-items: center; border: 1px solid var(--s-line); border-radius: 999px; overflow: hidden; }
.qty button { width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; font-size: 17px; }
.qty b { min-width: 26px; text-align: center; font-weight: 600; }
.pr { display: inline-flex; gap: 8px; align-items: baseline; direction: ltr; }
.pr s { color: var(--s-mute); font-size: .88em; }
.badge { position: absolute; z-index: 2; top: 12px; inset-inline-start: 12px; padding: 5px 10px; border-radius: 999px; background: var(--s-paper); color: var(--s-ink); font-size: 12px; font-weight: 600; box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .25); }

/* card */
.card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.card-media { position: relative; display: block; overflow: hidden; border-radius: var(--s-card); background: var(--s-soft); aspect-ratio: 3 / 4; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.card:hover .card-media img { transform: scale(1.05); }
.card-top { position: relative; }
.card-sizes, .card-add { position: absolute; z-index: 3; left: 10px; right: 10px; bottom: 10px; }
.card-sizes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; padding: 10px; border-radius: calc(var(--s-card) - 2px); background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); opacity: 0; translate: 0 10px; transition: opacity .3s, translate .3s; pointer-events: none; }
.card-sizes span { width: 100%; text-align: center; font-size: 12px; color: var(--s-mute); }
.card-sizes button { min-width: 38px; height: 32px; padding: 0 8px; border: 1px solid var(--s-line); border-radius: 8px; background: #fff; color: #111; cursor: pointer; font-size: 13px; }
.card-sizes button:hover { border-color: var(--s-ink); background: var(--s-ink); color: #fff; }
.card-add { height: 42px; border: 0; border-radius: 999px; background: var(--s-ink); color: #fff; cursor: pointer; font: 600 14px/1 var(--s-body); opacity: 0; translate: 0 10px; transition: opacity .3s, translate .3s; pointer-events: none; }
.card:hover .card-sizes, .card:hover .card-add, .card:focus-within .card-sizes, .card:focus-within .card-add { opacity: 1; translate: 0 0; pointer-events: auto; }
@media (hover: none) { .card-sizes { display: none; } .card-add { position: static; opacity: 1; translate: none; pointer-events: auto; margin-top: 8px; height: 38px; font-size: 14px; } }
.card-info { display: grid; gap: 4px; padding: 12px 2px 0; }
.card-n { text-decoration: none; color: var(--s-ink); font-weight: 500; }
.dots { display: flex; gap: 5px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }

/* bag drawer */
.sc-veil { position: fixed; inset: 0; z-index: 190; background: rgba(0, 0, 0, .35); opacity: 0; transition: opacity .35s; }
.sc-open .sc-veil { opacity: 1; }
.sc { position: fixed; z-index: 200; top: 0; bottom: 0; inset-inline-end: 0; width: min(420px, 100%); display: flex; flex-direction: column; background: var(--s-paper); color: var(--s-ink); font-family: var(--s-body); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .4); translate: 105% 0; transition: translate .4s cubic-bezier(.2, .7, .2, 1); visibility: hidden; }
html[dir="rtl"] .sc { translate: -105% 0; }
.sc-open .sc { translate: 0 0; visibility: visible; }
.sc-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--s-line); }
.sc-head h2 { margin: 0; font: 600 22px/1.2 var(--s-display); }
.sc-x { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--s-soft); cursor: pointer; font-size: 22px; }
.sc-free { padding: 14px 22px; border-bottom: 1px solid var(--s-line); font-size: 14px; }
.sc-free p { margin: 0 0 8px; }
.sc-free i { display: block; height: 6px; border-radius: 9px; background: var(--s-soft); overflow: hidden; }
.sc-free b { display: block; height: 100%; background: var(--s-accent); transition: width .5s; }
.sc-lines { flex: 1; overflow-y: auto; padding: 8px 22px; }
.sc-line { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--s-line); }
.sc-line img { width: 82px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: var(--s-soft); }
.sc-n { display: block; color: inherit; text-decoration: none; font-weight: 600; }
.sc-line small { display: block; color: var(--s-mute); margin: 2px 0 10px; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sc-p { direction: ltr; }
.sc-rm { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--s-mute); text-decoration: underline; cursor: pointer; font-size: 13px; }
.sc-empty { padding: 50px 0; text-align: center; color: var(--s-mute); }
.sc-foot { padding: 18px 22px 22px; border-top: 1px solid var(--s-line); display: grid; gap: 10px; }
.sc-sum { display: flex; justify-content: space-between; font-size: 17px; }
.sc-sum b { direction: ltr; }
.sc-go { width: 100%; }
.sc-more { border: 0; background: none; color: var(--s-mute); cursor: pointer; text-decoration: underline; }
.sc-toast { position: fixed; z-index: 210; left: 50%; bottom: 24px; translate: -50% 30px; display: flex; gap: 14px; align-items: center; padding: 12px 14px 12px 20px; border-radius: 999px; background: var(--s-ink); color: #fff; font: 500 14px/1.2 var(--s-body); opacity: 0; pointer-events: none; transition: opacity .3s, translate .3s; white-space: nowrap; }
.sc-toast.on { opacity: 1; translate: -50% 0; pointer-events: auto; }
.sc-toast button { padding: 8px 14px; border: 0; border-radius: 999px; background: #fff; color: var(--s-ink); cursor: pointer; font-weight: 600; }

/* shop page */
.shop-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.shop-head h1 { margin: 0; }
.shop-cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.shop-cats::-webkit-scrollbar { display: none; }
.shop-cats button, .f-sizes button { flex: none; padding: 9px 16px; border: 1px solid var(--s-line); border-radius: 999px; background: var(--s-paper); cursor: pointer; font-size: 14px; }
.shop-cats button.on, .f-sizes button.on { background: var(--s-ink); border-color: var(--s-ink); color: #fff; }
.shop-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0; padding: 12px 0; border-block: 1px solid var(--s-line); }
.shop-bar select { padding: 9px 12px; border: 1px solid var(--s-line); border-radius: 10px; background: var(--s-paper); font: inherit; }
.f-toggle { display: none; padding: 9px 16px; border: 1px solid var(--s-ink); border-radius: 999px; background: none; cursor: pointer; font: inherit; }
.shop-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 34px; align-items: start; }
.shop-side { position: sticky; top: 110px; display: grid; gap: 18px; }
.shop-side fieldset { margin: 0; padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--s-line); }
.shop-side legend { margin-bottom: 10px; font-weight: 600; }
.f-sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.f-sizes button { min-width: 44px; padding: 7px 10px; }
.f-colors { display: grid; gap: 6px; }
.f-colors button { display: flex; gap: 10px; align-items: center; padding: 4px 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; text-align: start; }
.f-colors i { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.f-colors button.on i { box-shadow: 0 0 0 2px var(--s-paper), 0 0 0 4px var(--s-ink); }
.f-price { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.f-price label { display: grid; gap: 4px; font-size: 12px; color: var(--s-mute); }
.f-price input { width: 100%; padding: 9px 10px; border: 1px solid var(--s-line); border-radius: 10px; font: inherit; background: var(--s-paper); }
.f-clear { justify-self: start; padding: 0; border: 0; background: none; text-decoration: underline; cursor: pointer; color: var(--s-mute); font: inherit; }
.f-apply { display: none; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 20px; }
.none { grid-column: 1 / -1; padding: 40px 0; color: var(--s-mute); text-align: center; }
@media (max-width: 900px) {
  .shop-body { grid-template-columns: minmax(0, 1fr); }
  .f-toggle { display: inline-block; }
  .shop-bar { font-size: 14px; } #shopCount { white-space: nowrap; } .sort > span { display: none; }
  .shop-side { position: fixed; z-index: 180; inset: auto 0 0 0; top: auto; max-height: 82vh; overflow-y: auto; padding: 24px 20px; border-radius: 22px 22px 0 0; background: var(--s-paper); box-shadow: 0 -30px 60px -20px rgba(0, 0, 0, .35); translate: 0 105%; transition: translate .35s; }
  .f-open .shop-side { translate: 0 0; }
  .f-apply { display: inline-flex; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; }
}

/* product page */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; font-size: 13px; color: var(--s-mute); }
.crumbs a { color: inherit; text-decoration: none; }
.pd-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 60px); align-items: start; }
.pd-gallery { position: sticky; top: 100px; display: grid; gap: 12px; }
.pd-main { position: relative; overflow: hidden; border-radius: var(--s-radius); background: var(--s-soft); aspect-ratio: var(--pd-ar, 3 / 4); }
.pd-main img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs { display: flex; gap: 10px; }
.pd-thumbs button { width: 74px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--s-soft); cursor: pointer; aspect-ratio: var(--pd-ar, 3 / 4); }
.pd-thumbs button.on { border-color: var(--s-ink); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd-info h1 { margin: 0 0 10px; }
.pd-kicker { margin: 0 0 8px; color: var(--s-mute); font-size: 14px; }
.pd-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 14px; font-size: 22px; direction: ltr; justify-content: flex-start; }
html[dir="rtl"] .pd-price { justify-content: flex-end; }
.pd-price s { color: var(--s-mute); font-size: 17px; }
.pd-price em { font-style: normal; padding: 3px 9px; border-radius: 999px; background: var(--s-accent); color: var(--s-accent-ink); font-size: 13px; }
.pd-short { color: var(--s-mute); margin: 0 0 20px; }
.pd-opt { margin: 0 0 18px; }
.pd-opt > p { margin: 0 0 8px; font-size: 14px; }
.pd-colors, .pd-sizes, .pd-vals { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-colors button { width: 38px; height: 38px; padding: 3px; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; }
.pd-colors button.on { border-color: var(--s-ink); }
.pd-colors i { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.pd-sizes button { min-width: 52px; height: 46px; padding: 0 12px; border: 1px solid var(--s-line); border-radius: 10px; background: var(--s-paper); cursor: pointer; font: inherit; }
.pd-vals button { display: grid; gap: 2px; min-width: 110px; padding: 10px 14px; border: 1px solid var(--s-line); border-radius: 12px; background: var(--s-paper); cursor: pointer; font: inherit; text-align: start; }
.pd-vals small { color: var(--s-mute); direction: ltr; }
.pd-sizes button.on, .pd-vals button.on { border-color: var(--s-ink); box-shadow: inset 0 0 0 1px var(--s-ink); }
.pd-err { min-height: 1.3em; margin: 0 0 8px; color: #c0392b; font-size: 14px; }
.pd-buy { display: flex; gap: 10px; }
.pd-buy .qty { flex: none; height: 54px; }
.pd-buy .qty button { height: 52px; width: 40px; }
.pd-add { flex: 1; }
.pd-now { width: 100%; margin-top: 10px; }
.pd-stock { margin: 14px 0 22px; color: var(--s-mute); font-size: 14px; }
.pd-acc details { border-top: 1px solid var(--s-line); }
.pd-acc details:last-child { border-bottom: 1px solid var(--s-line); }
.pd-acc summary { list-style: none; display: flex; justify-content: space-between; padding: 16px 0; cursor: pointer; font-weight: 600; }
.pd-acc summary::-webkit-details-marker { display: none; }
.pd-acc summary::after { content: "+"; font-size: 20px; transition: rotate .3s; }
.pd-acc details[open] summary::after { rotate: 45deg; }
.pd-acc div, .pd-acc table { margin-bottom: 16px; color: var(--s-mute); }
.pd-acc ul { padding-inline-start: 18px; }
.pd-acc table { width: 100%; border-collapse: collapse; }
.pd-acc th, .pd-acc td { padding: 9px 0; border-bottom: 1px dashed var(--s-line); text-align: start; font-weight: 400; }
.pd-acc th { color: var(--s-ink); width: 45%; }
@media (max-width: 860px) { .pd-grid { grid-template-columns: minmax(0, 1fr); } .pd-gallery { position: static; } }

/* checkout */
.co { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.co-form { display: grid; gap: 26px; }
.co-form fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 12px; }
.co-form legend { margin-bottom: 12px; font: 600 20px/1.2 var(--s-display); }
.co-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.co-form label.f { display: grid; gap: 6px; font-size: 14px; }
.co-form input, .co-form textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--s-line); border-radius: 12px; background: var(--s-paper); font: inherit; color: inherit; }
.co-form input:focus, .co-form textarea:focus { outline: 2px solid var(--s-ink); outline-offset: 1px; }
.co-radio { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--s-line); border-radius: 12px; background: var(--s-paper); cursor: pointer; }
.co-radio:has(input:checked) { border-color: var(--s-ink); box-shadow: inset 0 0 0 1px var(--s-ink); }
.co-radio input { accent-color: var(--s-ink); width: 18px; height: 18px; }
.co-radio span { display: grid; flex: 1; }
.co-radio small { color: var(--s-mute); }
.co-radio em { font-style: normal; font-weight: 600; direction: ltr; }
.co-hp { position: absolute; left: -9999px; }
.co-err { min-height: 1.3em; margin: 0; color: #c0392b; }
.co-fine { margin: 0; color: var(--s-mute); font-size: 14px; }
.co-sum { position: sticky; top: 100px; padding: 24px; border-radius: var(--s-radius); background: var(--s-soft); }
.co-sum h2 { margin: 0 0 14px; font: 600 20px/1.2 var(--s-display); }
.co-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; }
.co-img { position: relative; }
.co-img img { width: 64px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: #fff; }
.co-img b { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--s-ink); color: #fff; font-size: 12px; display: grid; place-items: center; }
.co-line p { margin: 0; font-weight: 600; }
.co-line small { color: var(--s-mute); }
.co-line > b { direction: ltr; }
.co-tot { margin-top: 12px; border-top: 1px solid var(--s-line); padding-top: 12px; }
.co-tot p { display: flex; justify-content: space-between; margin: 8px 0; }
.co-tot b { direction: ltr; }
.co-tot .grand { font-size: 20px; padding-top: 8px; border-top: 1px solid var(--s-line); }
.co-done { max-width: 560px; margin: 40px auto; text-align: center; }
.co-tick { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--s-accent); color: var(--s-accent-ink); font-size: 36px; }
@media (max-width: 860px) { .co { grid-template-columns: minmax(0, 1fr); } .co-sum { position: static; order: -1; } .co-two { grid-template-columns: minmax(0, 1fr); } }
.co-done { grid-column: 1 / -1; }  .co-opts { display: grid; gap: 10px; }  .co-go { width: 100%; }  .related { margin-top: clamp(60px, 8vw, 110px); }
