:root {
  --wine: #4a1028;
  --wine-deep: #380b1d;
  --gold: #d8b77a;
  --gold-dark: #96713a;
  --ivory: #f8f1e7;
  --paper: #fffaf3;
  --ink: #211a1b;
  --muted: #6c595d;
  --line: #e6d8ca;
  --success: #235840;
  --error: #922841;
  --heading: Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--ivory);
  font-family: var(--body);
  line-height: 1.55;
  accent-color: var(--wine);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--wine); text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #a16a27; outline-offset: 4px; }
button:disabled { cursor: not-allowed; opacity: .55; }
h1, h2, h3, p { margin: 0; }
h1, h2 { color: var(--wine); font-family: var(--heading); font-weight: 400; line-height: 1.08; }
h1 { font-size: clamp(2.65rem, 5vw, 4.8rem); letter-spacing: -.042em; }
h2 { font-size: clamp(1.65rem, 3vw, 2.75rem); letter-spacing: -.035em; }
h3 { color: var(--wine); }
.shell { width: min(100% - 5.5rem, 1400px); margin-inline: auto; }
.sr-only, .skip:not(:focus) { position: absolute; height: 1px; width: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip:focus { position: absolute; z-index: 30; padding: .75rem; background: var(--paper); }
.mobile-only, .bottom-nav { display: none !important; }
.announcement { background: var(--wine); color: var(--ivory); font: italic 1rem var(--heading); text-align: center; padding: .7rem 1rem; }
.announcement::before, .announcement::after { content: ""; display: inline-block; height: 1px; width: min(10vw, 94px); background: var(--gold); vertical-align: .25em; margin: 0 1.1em; }
.store-header { background: #fbf5ed; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 8; }
.header-inner { min-height: 98px; display: grid; grid-template-columns: minmax(133px, 1fr) auto minmax(165px, 1fr); align-items: center; gap: 1.5rem; }
.brand { width: 138px; display: inline-block; }
.brand img { width: 100%; object-fit: contain; height: auto; max-height: 82px; }
.desktop-nav { display: flex; align-items: center; gap: clamp(1rem, 2.35vw, 2.5rem); }
.desktop-nav a { font-size: .93rem; font-weight: 600; white-space: nowrap; text-decoration: none; }
.desktop-nav a:hover, .text-link:hover { text-decoration: underline; }
.header-actions { justify-self: end; display: flex; gap: .45rem; align-items: center; }
.icon-button { color: var(--wine); background: transparent; border: 0; padding: .55rem; min-height: 42px; min-width: 42px; display: inline-grid; place-items: center; border-radius: 50%; text-decoration: none; }
.icon-button:hover { background: #f3e5d8; }
.bag-link { position: relative; }
.counter { position: absolute; top: -2px; right: -3px; border-radius: 50%; min-width: 19px; height: 19px; padding-inline: 3px; display: grid; place-items: center; background: var(--wine); color: white; font-size: .68rem; font-weight: 700; }
.hero { background: #efe2d4; position: relative; min-height: clamp(410px, 47vw, 650px); isolation: isolate; overflow: hidden; }
.hero-inner { min-height: inherit; display: flex; align-items: center; position: relative; }
.hero-image { position: absolute; inset: 0 0 0 35%; z-index: -1; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 46%; }
.hero-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #efe2d4, transparent 31%); }
.hero-copy { padding: 4rem 0; max-width: 51%; }
.hero-copy h1 { font-size: clamp(3.6rem, 7.7vw, 8.5rem); line-height: .99; letter-spacing: -.055em; text-wrap: balance; }
.hero-copy p { max-width: 24ch; color: var(--wine-deep); margin: 1.25rem 0 1.8rem; font-size: clamp(.98rem, 2vw, 1.52rem); line-height: 1.43; }
.button { display: inline-flex; min-height: 46px; padding: .68rem 1.25rem; align-items: center; justify-content: center; gap: .55rem; color: #fffaf3; background: var(--wine); border: 1px solid var(--wine); border-radius: 5px; font-size: .96rem; font-weight: 650; text-align: center; text-decoration: none; }
.button:hover:not(:disabled) { background: #67183a; }
.button svg, .text-link svg { width: 20px; height: 20px; }
.button.secondary, .button.outline { color: var(--wine); background: transparent; border-color: var(--gold-dark); }
.button.secondary:hover:not(:disabled), .button.outline:hover:not(:disabled) { background: #f1e5d8; }
.hero-button { font-family: var(--heading); font-size: clamp(1.05rem, 1.7vw, 1.45rem); font-weight: 400; gap: 1.4rem; padding-inline: 1.45rem; }
.store-section { padding-block: clamp(2.25rem, 5.2vw, 4.9rem); }
.store-section + .store-section { padding-top: 0; }
.section-title { margin-bottom: clamp(1.2rem, 3vw, 2.25rem); display: flex; justify-content: center; align-items: center; gap: clamp(.6rem, 3.15vw, 2.8rem); text-align: center; }
.section-title::before, .section-title::after { content: ""; flex: 0 1 175px; height: 1px; background: var(--gold-dark); }
.category-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.category-card { display: block; position: relative; overflow: hidden; color: white; text-decoration: none; background: #c5ab94; border-radius: 5px; }
.category-card img { width: 100%; aspect-ratio: 1.2; height: auto; object-fit: cover; object-position: center 34%; transition: transform .3s ease; }
.category-card:hover img, .card-image a:hover img { transform: scale(1.035); }
.category-card span { position: absolute; inset: auto 0 0; padding: 2rem 1rem .82rem; display: flex; align-items: center; justify-content: space-between; gap: .35rem; background: linear-gradient(transparent,#32131ce8); font-family: var(--heading); font-size: clamp(1.45rem,3vw,2.15rem); }
.category-card svg { flex-shrink: 0; }
.product-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: clamp(.85rem, 1.65vw, 1.45rem); row-gap: 2rem; }
.product-card { min-width: 0; }
.card-image, .gallery-main { position: relative; }
.card-image { border-radius: 6px; overflow: hidden; background: #ebded2; }
.card-image img { display: block; width: 100%; aspect-ratio: .96; height: auto; object-fit: cover; transition: transform .3s ease; }
.wishlist-action { position: absolute; top: .48rem; right: .48rem; margin: 0; }
.heart { width: 41px; height: 41px; min-height: 41px; min-width: 41px; background: #fffaf2e9; }
.heart svg { width: 22px; height: 22px; }
.heart.saved svg { fill: var(--wine); }
.card-status { position: absolute; left: .5rem; bottom: .55rem; background: var(--paper); color: var(--wine); border-radius: 3px; padding: .25rem .5rem; font-size: .76rem; font-weight: 700; }
.card-name { display: block; text-decoration: none; color: var(--ink); font-weight: 560; margin: .55rem .05rem .12rem; line-height: 1.38; }
.card-name:hover { color: var(--wine); text-decoration: underline; }
.card-price { color: var(--wine); font-weight: 720; font-size: 1.05rem; }
.text-link { color: var(--wine); display: inline-flex; gap: .45rem; align-items: center; font-weight: 630; text-decoration: none; }
.edit > .text-link { display: flex; width: fit-content; margin: 1.8rem auto 0; }
.store-footer { background: var(--wine); color: #f2e4d8; padding: 2.6rem 0 1.25rem; border-top: 1px solid var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
.footer-grid > div { display: grid; align-content: start; gap: .65rem; }
.footer-grid .brand { background: var(--ivory); border-radius: 4px; padding: .6rem; width: 145px; }
.footer-grid h2 { font: 650 1rem var(--body); color: var(--ivory); }
.footer-grid a { color: inherit; text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; }
.footer-grid p, .footer-base { font-size: .88rem; }
.footer-base { margin-top: 2rem; border-top: 1px solid #ffffff32; padding-top: 1rem; }
.feedback:empty { display: none; }
.notice { margin: 1rem 0; padding: .85rem 1rem; border: 1px solid #b0c9a8; background: #eef5e9; border-radius: 6px; color: var(--success); }
.notice.error { background: #fae7e9; color: var(--error); border-color: #d8a0ad; }
.page-head { margin-bottom: 1.7rem; }
.page-head p { color: var(--muted); margin-top: .6rem; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .65rem; color: var(--muted); font-size: .88rem; margin: 0 0 1rem; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.shop-filters, .fields, .variant-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .9rem; }
.shop-filters { grid-template-columns: minmax(130px,1.4fr) 1fr 1fr auto; align-items: end; margin-bottom: 1.55rem; }
.shop-filters label, .form-flow label, .fields label, .variant-fields label { display: grid; gap: .32rem; color: var(--wine-deep); font-weight: 600; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; min-width: 0; min-height: 46px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); padding: .55rem .65rem; border-radius: 5px; font-weight: 400; }
textarea { min-height: 90px; resize: vertical; }
input[type=file] { padding: .48rem; }
.check, .form-flow .check { display: flex; align-items: center; gap: .55rem; }
.check input { flex: 0 0 auto; }
.form-flow { display: grid; gap: 1rem; }
.form-flow > h2 { margin-bottom: .2rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 9px; padding: clamp(1rem, 2.3vw, 1.9rem); }
.empty { display: grid; justify-items: center; text-align: center; gap: 1rem; padding: clamp(2rem,6vw,5rem) 1rem; margin-bottom: .5rem; }
.empty p { color: var(--muted); max-width: 54ch; }
.pagination { margin-top: 1.7rem; display: flex; align-items: center; justify-content: center; gap: .65rem; }
.product-layout { display: grid; align-items: start; grid-template-columns: minmax(0,1.08fr) minmax(0,.92fr); gap: clamp(1.6rem,5vw,5.5rem); }
.gallery-zoom { width: 100%; border: 0; padding: 0; border-radius: 8px; overflow: hidden; background: #ead9cb; display: block; cursor: zoom-in; }
.gallery-zoom img { width: 100%; height: auto; aspect-ratio: 1.08; object-fit: cover; }
.thumbs { display: flex; gap: .6rem; overflow-x: auto; margin-top: .65rem; padding: .22rem; }
.thumbs button { flex: 0 0 min(19%,90px); border: 1px solid var(--line); padding: 0; border-radius: 5px; overflow: hidden; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.thumbs button[aria-pressed=true] { border-color: var(--wine); outline: 1px solid var(--wine); outline-offset: 1px; }
.category-label { text-decoration: none; font-size: .83rem; font-weight: 650; }
.product-copy h1 { font-size: clamp(2.15rem,4vw,4rem); margin: .28rem 0 .7rem; }
.product-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .8rem; font-size: 1.65rem; color: var(--wine); font-weight: 750; }
.product-price del { color: var(--muted); font-size: .93rem; font-weight: 500; }
.product-description { color: var(--muted); margin: .9rem 0 1.4rem; }
.purchase-form { gap: .7rem; }
.quantity-line { align-items: end; display: flex; gap: 1rem; }
.quantity-line input { width: 94px !important; }
.quantity-line > span { color: var(--success); align-self: center; font-weight: 650; font-size: .86rem; margin-top: 1.2rem; }
.product-copy > .outline { width: 100%; margin-top: .66rem; }
.product-details { border-top: 1px solid var(--line); margin-top: .9rem; padding: .65rem 0; }
.product-details summary { cursor: pointer; color: var(--wine); font-weight: 650; }
.product-details p { margin: .55rem 0 .3rem; color: var(--muted); }
.order-layout { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(250px,1fr); gap: clamp(1rem,3vw,2rem); align-items: start; }
.bag-lines { display: grid; gap: .85rem; }
.bag-line { display: grid; grid-template-columns: 74px minmax(0,1fr) auto; align-items: start; gap: .9rem; }
.bag-line img { border-radius: 5px; width: 74px; aspect-ratio: .87; object-fit: cover; }
.bag-line h2 { font: 680 1.05rem var(--body); }
.bag-line p { font-size: .88rem; color: var(--muted); }
.bag-line .error-text { color: var(--error); }
.line-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; margin-top: .55rem; }
.line-actions input { max-width: 64px; }
.link-button { border: 0; background: transparent; padding: .35rem 0; color: var(--wine); text-decoration: underline; text-underline-offset: 3px; text-align: start; }
.link-button:hover { color: #7d214a; }
.order-summary h2, .checkout-form h2 { font-size: 1.7rem; margin-bottom: 1rem; }
.order-summary dl, .order-summary ul { padding: 0; margin: 0 0 1rem; list-style: none; }
.order-summary dl > div, .order-summary li { display: flex; justify-content: space-between; align-items: start; gap: .7rem; padding: .4rem 0; }
.order-summary small, td small { display: block; color: var(--muted); }
.order-summary dd { margin: 0; white-space: nowrap; }
.order-summary .total { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .75rem; font-weight: 750; }
.order-summary .button { width: 100%; margin-bottom: .75rem; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: .6rem .85rem .8rem; }
legend { color: var(--wine); font-weight: 650; }
fieldset label + label { margin-top: .3rem; }
.auth { max-width: 540px; margin-inline: auto; }
.auth h2, .account-panel h2, .prose p { margin-bottom: 1rem; }
.auth p, .account-panel p { margin: .8rem 0; }
.auth-logo { width: 155px; margin: .3rem auto 1rem; }
.auth > h1 { font-size: 2.75rem; text-align: center; margin-bottom: 1.3rem; }
.account-panel { max-width: 680px; margin-inline: auto; }
.account-orders { display: grid; padding: 0; gap: .55rem; list-style: none; }
.account-orders li { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: space-between; }
.setup, .admin-auth { padding-top: 2rem; }
.setup .auth, .admin-auth { margin: 2rem auto; width: min(100% - 2rem, 540px); }
dialog { color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
dialog::backdrop { background: #2a1220a6; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .65rem; color: var(--wine); }
.drawer { margin: 0; height: 100%; max-height: 100%; width: min(88vw,385px); border-radius: 0; }
.drawer nav { display: flex; flex-direction: column; margin: 1rem 0 1.15rem; }
.drawer nav a { display: flex; align-items: center; justify-content: space-between; padding: .63rem 0; text-decoration: none; border-bottom: 1px solid var(--line); }
.drawer nav svg { width: 16px; height: 16px; }
.search-dialog { width: min(92vw,570px); }
.search-form { display: flex; gap: .45rem; }
.zoom-dialog { max-width: min(94vw,900px); max-height: 92dvh; }
.zoom-dialog > button { margin-left: auto; margin-bottom: .3rem; display: grid; }
.zoom-dialog img { max-height: 75dvh; width: auto; object-fit: contain; margin: auto; }

.backoffice { background: #f4ebe2; }
.admin-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; background: var(--wine); color: var(--paper); padding: .75rem clamp(1rem,4vw,3.15rem); }
.admin-brand { color: var(--paper); font: 1.6rem var(--heading); text-decoration: none; }
.admin-brand small { font: .83rem var(--body); display: block; margin-top: .16rem; }
.admin-header .button { color: var(--paper); border-color: var(--gold); }
.admin-header .button:hover { color: var(--wine); }
.admin-layout { display: grid; width: min(100%,1520px); margin: 0 auto; grid-template-columns: 205px minmax(0,1fr); min-height: calc(100vh - 79px); }
.admin-nav { border-right: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; gap: .3rem; padding: 1.2rem; }
.admin-nav > a { text-decoration: none; font-weight: 650; padding: .58rem .65rem; border-radius: 5px; }
.admin-nav > a:hover, .admin-nav > a.current { background: #efe1d4; }
.admin-nav form { margin-top: 1rem; padding-left: .65rem; }
.admin-main { padding: clamp(1rem,3vw,2.2rem); min-width: 0; }
.admin-page-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .65rem; margin-bottom: 1.1rem; }
.admin-page-title h1 { font-size: clamp(2rem,3.6vw,3.3rem); }
.admin-main > p { margin-bottom: .8rem; }
.admin-panel h2 { font-size: 1.6rem; margin-bottom: .65rem; }
.admin-panel h3 { margin-top: .8rem; }
.admin-panel p + .button { margin-top: .8rem; }
.metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.metrics .panel { display: grid; gap: .3rem; color: var(--wine); }
.metrics strong { font-size: 1.7rem; }
.metrics + .panel, .admin-main > .panel + .panel { margin-top: 1rem; }
.admin-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.3fr); gap: 1rem; align-items: start; }
.admin-thumb { width: 92px; height: 72px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }
.admin-thumb.small { width: 55px; height: 45px; }
.gallery-edit, .variant-foot { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.variant-row { margin: 0 0 .7rem; }
.variant-fields { grid-template-columns: repeat(3,minmax(0,1fr)); }
.variant-foot { margin-top: .75rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .91rem; }
th { text-align: left; color: var(--wine); }
td, th { border-bottom: 1px solid var(--line); padding: .55rem .5rem; vertical-align: top; }
td a { font-weight: 660; }
.inline-search { display: flex; margin: 0 0 .9rem; gap: .5rem; flex-wrap: wrap; }
.inline-search label { flex: 1 1 12rem; }
@media (max-width: 1050px) {
  .shell { width: min(100% - 3rem,1400px); }
  .desktop-nav { gap: .88rem; }
  .desktop-nav a { font-size: .87rem; }
  .header-inner { gap: .65rem; }
  .header-actions { gap: 0; }
}
@media (max-width: 820px) {
  .desktop-nav, .desktop-action { display: none; }
  .mobile-only { display: inline-grid !important; }
  .header-inner { grid-template-columns: 1fr auto 1fr; min-height: 76px; }
  .header-inner > .mobile-only { justify-self: start; }
  .brand { width: 105px; }
  .brand img { max-height: 68px; }
  .hero { min-height: 405px; }
  .hero-image { left: 32%; }
  .hero-copy h1 { font-size: clamp(3.15rem,8.65vw,5.75rem); }
  .product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .product-layout { gap: 1.5rem; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); overflow: auto; padding: .45rem .65rem; }
  .admin-nav > a, .admin-nav form { flex: 0 0 auto; }
  .admin-nav form { margin: 0 0 0 auto; align-self: center; }
}
@media (max-width: 590px) {
  .shell { width: calc(100% - 1.45rem); }
  .announcement { font-size: .87rem; padding: .48rem .4rem; }
  .announcement::before,.announcement::after { margin-inline: .6em; }
  .header-inner { min-height: 67px; }
  .brand { width: 100px; }
  .brand img { max-height: 60px; }
  .search-trigger { min-width: 38px; padding-inline: .35rem; }
  .hero { min-height: clamp(345px,91vw,440px); }
  .hero-copy { max-width: 49%; padding: 2.25rem 0; }
  .hero-copy h1 { font-size: clamp(2.55rem,10.45vw,3.6rem); text-wrap: initial; }
  .hero-copy p { font-size: .91rem; line-height: 1.37; margin: .75rem 0 1.15rem; }
  .hero-image { left: 25%; }
  .hero-image::after { background: linear-gradient(90deg, #efe2d4 2%,#efe2d4a3 25%, transparent 56%); }
  .hero-image img { object-position: 61% 45%; }
  .hero-button { font-family: var(--body); font-weight: 650; font-size: .78rem; gap: .4rem; padding: .5rem .53rem; }
  .hero-button svg { width: 14px; height: 14px; }
  .category-grid, .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
  .product-grid { row-gap: 1.2rem; }
  .category-card img { aspect-ratio: 1.1; }
  .category-card span { font-size: 1.35rem; padding: 1.65rem .63rem .55rem; }
  .category-card svg { width: 16px; height: 16px; }
  .card-name { font-size: .92rem; }
  .wishlist-action { top: .32rem; right: .32rem; }
  .heart { width: 38px; height: 38px; min-width: 38px; min-height: 38px; }
  .shop-filters { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .shop-filters > label:first-of-type { grid-column: 1/-1; }
  .shop-filters > button { grid-column: 1/-1; }
  .product-layout, .order-layout, .admin-split { grid-template-columns: 1fr; }
  .storefront { padding-bottom: calc(65px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: grid !important; position: fixed; bottom: 0; inset-inline: 0; z-index: 7; grid-template-columns: repeat(4,minmax(0,1fr)); background: var(--paper); border-top: 1px solid var(--line); padding: 0 .35rem env(safe-area-inset-bottom); }
  .bottom-nav a { display: flex; color: var(--wine-deep); flex-direction: column; align-items: center; justify-content: center; min-height: 57px; gap: .2rem; text-decoration: none; border-top: 2px solid transparent; font-size: .78rem; }
  .bottom-nav a[aria-current=page] { border-color: var(--wine); font-weight: 720; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.4rem .8rem; }
  .footer-grid > div:first-child { grid-column: 1/-1; }
  .bag-line { grid-template-columns: 57px minmax(0,1fr); gap: .6rem; }
  .bag-line img { width: 57px; }
  .bag-line > strong { grid-column: 2; }
  .fields { grid-template-columns: 1fr; }
  .variant-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metrics { grid-template-columns: 1fr; gap: .55rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
