:root{
  --bg:#fff1d7;
  --panel:rgb(85, 85, 85);
  --text:#333333;
  --muted:#6b625a;
  --accent:#d1c6b8;
  --accent-2:#fff;
  --border:#f2ebdf;
  --home-card-gap:8px;
  --home-row-gap: var(--home-card-gap, 8px);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
img{max-width:100%;display:block}

body{
  font-family: century gothic, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background-color: var(--bg);
  background-image: url('/static/78255f3d4d1c4e26ba0ace8714d0621c.jpg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color:var(--accent);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

.container{
  max-width:1100px;
  margin:0 auto;
  padding:24px 16px;
}

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:10;
  background:rgba(45,40,36,.9);
  backdrop-filter:saturate(150%) blur(4px);
  border-bottom:1px solid var(--border);
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.brand{
  font-weight:400; letter-spacing:.06em;
  text-decoration:none; color:var(--text);
  font-size:45px; line-height:1; display:block;
}
.brand-wrap{ display:flex; align-items:center; gap:8px; font-size:40px; line-height:1; }
.brand-logo{ height:1em; width:auto; display:block; }
.nav a{
  color:var(--muted);
  text-decoration:none; margin-left:16px; font-size:14px;
}
.nav a:hover{color:var(--text)}

/* Keep topbar colors unchanged (override vars impact) */
.topbar{ border-bottom-color:#4a443e; }
.topbar .brand{ color:#e8e6e3; }
.topbar .nav a{ color:#a9a39e; }
.topbar .nav a:hover{ color:#e8e6e3; }

/* Prevent header overlap: force nav to next line on smaller widths */
@media (max-width:860px){
  .topbar-inner{ flex-wrap:wrap; row-gap:6px; }
  .brand, .brand-wrap{ font-size:34px; }
  .nav{ flex:1 1 100%; order:2; display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-start; }
}

/* Hero */
.hero-title{
  margin:8px 0 6px 0;
  font-size:64px; line-height:.9;
  letter-spacing:.06em; font-weight:900;
}
@media (max-width:700px){ .hero-title{font-size:40px} }

/* Breadcrumbs */
.breadcrumbs{
  color:var(--accent); font-size:12px; margin-bottom:18px;
}
.breadcrumbs a{ color:var(--accent); text-decoration:none }
.breadcrumbs a:hover{ color:var(--text) }

/* Grid catalogue */
.grid{
  display:grid; gap:16px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width:900px){ .grid{grid-template-columns: repeat(2, 1fr)} }
@media (max-width:560px){ .grid{grid-template-columns: 1fr} }

.card{
  display:block;
  position:relative; overflow:hidden;
  background:var(--panel);
  /* border:1px solid var(--border); */
  border-radius:12px;
  text-decoration:none; color:inherit;
  transition:transform .2s ease, box-shadow .2s ease;
  cursor:pointer;
}
.card:hover{ transform:translateY(-2px); box-shadow:0 6px 20px rgba(0,0,0,.25) }
.card img{ width:100%; aspect-ratio:3/4; object-fit:cover; background:#201c18 }

.card-meta{
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 10px;
}
.card-name{ font-weight:600; font-size:14px }
.card-price{ color:#fff; font-weight:700; font-size:14px }

/* Product page */
.product{
  display:grid; grid-template-columns: 1.2fr .8fr; gap:28px;
}
@media (max-width:900px){ .product{ grid-template-columns:1fr } }
.product-media img{
  width:100%;
  aspect-ratio:3/4;
  object-fit:cover;
  border-radius:12px;
  border:1px solid var(--border);
  background:#201c18;
}
.product-info{ display:flex; flex-direction:column; gap:12px }
.product-title{ margin:0; font-size:32px; color:#e8e6e3 }
.product-price{ color:var(--accent-2); font-size:20px; font-weight:800 }
.product-desc{ color:#e8e6e3; opacity:1 }

/* Forms */
.form{ display:grid; gap:14px; max-width:560px }
.form-row{ display:flex; flex-direction:column; gap:8px }
label{ color:#e8e6e3; font-size:13px; text-shadow:0 1px 0 rgba(0,0,0,.35) }
input, textarea{
  background:#25211d; color:#f2ebdf;
  border:1px solid var(--border); border-radius:10px;
  padding:12px 12px; outline:none;
}
input:focus, textarea:focus{ border-color:#6b625a }
input::placeholder, textarea::placeholder{ color:#cfc7bd; opacity:1 }
.form-actions{ display:flex; gap:10px; align-items:center }

/* Buttons */
.btn{
  display:inline-block; padding:10px 14px;
  background:#f2ebdf; color:#1d1916;
  border-radius:10px; text-decoration:none; border:0;
  font-weight:700; cursor:pointer;
}
.btn:hover{ filter:brightness(.95) }
.btn-secondary{ background:#2f2b27; color:#f2ebdf; border:1px solid var(--border) }

/* Footer */
.footer{ border-top:1px solid var(--border); margin-top:24px }
.footer-inner{ padding:24px 16px; color:var(--muted); font-size:12px }

/* Helpers */
.muted{ color:#a9a39e }

/* Make muted text readable on dark panels/forms */
.form .muted, .modal .muted, .table .muted{ color:#dcd4cc }

/* Tabs */
.tabs-nav{ display:flex; gap:8px; margin:8px 0 16px; border-bottom:1px solid var(--border) }
.tab-link{ display:inline-block; padding:8px 12px; border:1px solid transparent; border-bottom:2px solid transparent; color:var(--muted); text-decoration:none; border-radius:8px 8px 0 0 }
.tab-link.is-active{ color:var(--text); border-color:var(--border); border-bottom-color:var(--bg); background:var(--panel) }
.tab-panel{ display:none }
.tab-panel.active{ display:block }

/* Tables */
.table{ width:100%; border-collapse:collapse; background:#2f2b27; border:1px solid var(--border); border-radius:12px; overflow:hidden }
.table th, .table td{ padding:10px 12px; border-bottom:1px solid var(--border); text-align:left; color:#e8e6e3 }
.table thead th{ background:#332e29; color:#e8e6e3; font-weight:600 }
.table tbody tr{ background:#2f2b27 }
.table tbody tr:hover{ background:#2f2a25; color:#f2ebdf }

/* New Tabs (radio) */
.tabs{ margin:8px 0 16px }
.tab-input{ position:absolute; opacity:0; pointer-events:none }
.tabs-controls{
  display:inline-flex; gap:10px; align-items:center;
  background:#332e29; padding:6px;
  border-radius:14px; border:1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.tab-btn{
  appearance:none; -webkit-appearance:none;
  cursor:pointer; user-select:none;
  padding:10px 16px; border-radius:10px;
  border:1px solid transparent;
  color:#dcd4cc; font-weight:800; letter-spacing:.02em;
  background:transparent;
  transition:all .15s ease;
}
.tab-btn:hover{ color:#f2ebdf; border-color:var(--border); background:#3d372f }
.tab-btn:focus-visible{ outline:2px solid var(--accent-2); outline-offset:2px }

#tab-add:checked ~ .tabs-controls label[for="tab-add"],
#tab-orders:checked ~ .tabs-controls label[for="tab-orders"],
#tab-custom:checked ~ .tabs-controls label[for="tab-custom"],
#tab-cats:checked ~ .tabs-controls label[for="tab-cats"]{
  color:#1d1916; background:#f2ebdf; border-color:#f2ebdf;
  box-shadow:0 2px 14px rgba(0,0,0,.35)
}

.tabs-content{ margin-top:16px }
.tabs-content .tab-panel{ display:none }
#tab-add:checked ~ .tabs-content #panel-add{ display:block }
#tab-orders:checked ~ .tabs-content #panel-orders{ display:block }
#tab-custom:checked ~ .tabs-content #panel-custom{ display:block }
#tab-cats:checked ~ .tabs-content #panel-cats{ display:block }

/* Enhanced tabs visuals */
.tab-btn{ font-size:14px; letter-spacing:.03em }
.tab-btn .ico{ display:inline-flex; width:1.2em; align-items:center; justify-content:center; margin-right:6px }
.tab-btn .tab-title{ margin-right:8px }
.tab-btn .badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:22px; height:22px; padding:0 8px;
  border-radius:999px; font-size:12px; font-weight:800;
  background:#2a261f; color:var(--muted); border:1px solid var(--border);
}
#tab-add:checked ~ .tabs-controls label[for="tab-add"] .badge,
#tab-orders:checked ~ .tabs-controls label[for="tab-orders"] .badge,
#tab-custom:checked ~ .tabs-controls label[for="tab-custom"] .badge,
#tab-cats:checked ~ .tabs-controls label[for="tab-cats"] .badge{
  background:#1d1916; color:#f2ebdf; border-color:transparent;
}
#tab-add:checked ~ .tabs-controls label[for="tab-add"],
#tab-orders:checked ~ .tabs-controls label[for="tab-orders"],
#tab-custom:checked ~ .tabs-controls label[for="tab-custom"],
#tab-cats:checked ~ .tabs-controls label[for="tab-cats"]{
  transform:translateY(-1px);
}

/* Modal */
.modal{ position:fixed; inset:0; display:none; z-index:1000 }
.modal[aria-hidden="false"]{ display:block }
.modal-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.6) }
.modal-dialog{
  position:absolute; left:50%; top:50%;
  transform:translate(-50%,-50%);
  background: rgb(189, 189, 189);
  border:1px solid var(--border);
  border-radius:12px;
  width:min(900px,92vw);
  max-height:82vh;
  overflow:auto;
  box-shadow:0 20px 60px rgba(0,0,0,.6);
  padding:16px 16px 20px;
}
.modal-close{
  position:absolute; right:8px; top:8px;
  background:#2f2b27; color:#f2ebdf;
  border:1px solid var(--border);
  border-radius:8px; width:32px; height:32px;
  line-height:30px; text-align:center; cursor:pointer; font-weight:800;
}
.modal-body{ margin-top:10px }

/* Cart */
.cart-thumb{
  width:64px;
  height:64px;
  flex:0 0 64px;
  object-fit:cover;
  border-radius:8px;
  border:1px solid var(--border);
  background:#201c18;
  display:block;
}

/* Category cards (square) */
.category-card{
  aspect-ratio:3/4;
  display:block;
}
.category-card img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  background:#201c18;
}
.category-card .card-meta{
  position:absolute;
  left:0; right:0; bottom:0;
  padding:10px 14px;
  background:rgba(0,0,0,.72);
  color:#ffffff;
  border-top:1px solid var(--border);
}
.category-card .card-meta *{
  color:#ffffff !important;
  text-shadow:0 2px 6px rgba(0,0,0,.8), 0 0 1px rgba(0,0,0,.6);
}

/* Card links: light text on dark cards */
.card-link{ color:var(--text); text-decoration:none; display:block }
.card-link:visited{ color:var(--text) }

/* Category tiles are anchors too */
a.card, a.card:visited{ color:var(--text) }

/* Ensure titles inside clickable cards are light */
.card-link .card-name,
a.card .card-name,
.category-card .card-name{ color:var(--text) }

/* Force card anchors to be light, including visited */
.card-link, .card-link:visited,
a.card, a.card:visited{ color:var(--text) !important }

/* Compact grid (home) */
.grid.grid-compact{ grid-template-columns: repeat(6, 1fr); row-gap: var(--home-row-gap, 8px); column-gap: 8px; }
@media (max-width:1100px){ .grid.grid-compact{ grid-template-columns: repeat(5, 1fr); } }
@media (max-width:900px){ .grid.grid-compact{ grid-template-columns: repeat(4, 1fr); } }
@media (max-width:700px){ .grid.grid-compact{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width:480px){ .grid.grid-compact{ grid-template-columns: 1fr; } }

.grid-compact .card img{ aspect-ratio:3/4; height:auto; }
.grid-compact .card-meta{ padding:4px 6px; justify-content:flex-start; }
.grid-compact .card-name{ font-size:11px; }
.grid-compact .card-price{ font-size:11px; color:#ffffff !important; margin:0; }

/* Home row headers align left */
.cat-row{ margin-bottom:60px }
.cat-row .row-header{ display:flex; justify-content:flex-start; align-items:center; width:100%; }
.cat-row .row-title{
  text-transform:uppercase;
  letter-spacing:.06em;
  font-weight:400;
  margin:0 0 8px;
  /* background:rgb(235,235,235); */
  color:var(--accent-2) !important;
  width:100%;
  line-height:1.1;
  /* text-shadow:0 1px 0 rgba(0,0,0,.4); */
  text-align:left;
}
/* Category row title contains anchor again */
.cat-row .row-title a{
  color:var(--accent-2) !important;
  text-decoration:none;
  display:block;
  text-align:left;
  background: var(--panel);
  padding:5px 8px;
  border-radius:10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
  transition:background .15s ease, box-shadow .15s ease;
  cursor:pointer;
}
.cat-row .row-title a:visited{ color:var(--accent-2) !important; }
.cat-row .row-title a:hover{
  color:var(--accent-2);
  text-decoration:underline;
  background:#3d372f;
  box-shadow: inset 0 0 0 2px #f2ebdf;
}

/* Category page big title bar */
.category-title{
  text-transform:uppercase;
  letter-spacing:.06em;
  font-weight:400;
  background:rgb(235,235,235);
  color:rgb(103,103,103) !important;
  padding:10px 14px;
  border-radius:10px;
  border:1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
  /* text-shadow:0 1px 0 rgba(0,0,0,.4); */
  margin:0 0 12px;
}

/* Product gallery thumbnails */
.gallery-thumbs{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:8px;
  margin-top:8px;
}
.gallery-thumb{
  width:100%;
  aspect-ratio:3/4;
  object-fit:cover;
  border-radius:8px;
  border:1px solid var(--border);
  background:#201c18;
}

/* Category card name as dark bar text */
.category-card .card-meta .card-name{
  color:#ffffff !important;
  text-transform:uppercase;
  letter-spacing:.06em;
  font-weight:900;
  text-shadow:0 1px 0 rgba(0,0,0,.4);
}

/* Discount price styles */
.price-old{ text-decoration:line-through; opacity:.7; margin-right:6px }
.price-new{ color:#ffec99; font-weight:800 }

/* Hover highlight for category rows on home */
.cat-row .row-title a{ transition:background .15s ease, box-shadow .15s ease; cursor:pointer }
.cat-row .row-title a:hover{ background:#3d372f; box-shadow: inset 0 0 0 2px #f2ebdf; color:var(--accent-2); text-decoration:underline }

/* Category tiles hover refinement */
.category-card:hover .card-meta{ background:rgba(0,0,0,.82) }

/* "More" card style for categories with extra items */
.card-more{ position:relative; }
.card-more .card-link{ position:relative; display:block; height:100%; }
.card-more .card-meta{ display:none !important; } /* на всякий случай скрываем ценник, если вдруг попал */
.card-more img{ filter: blur(3px) brightness(0.7); transform: scale(1.05); z-index:1; transition: filter .35s ease, transform .35s ease; will-change: filter, transform; }
.card-more .card-more-overlay{ position:absolute; inset:0; display:grid; place-items:center; pointer-events:none; z-index:2; }
.card-more .card-more-plus{
  z-index:3;
  width:64px; height:64px; border-radius:12px;
  background:rgba(242,235,223,.95); color:#1d1916;
  font-weight:900; font-size:36px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 6px 20px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.4);
  border:1px solid var(--border);
  transform: scale(1);
  transition: transform .25s ease;
  will-change: transform;
}
.card-more:hover img{ filter: blur(1.5px) brightness(0.8); }
.card-more:hover .card-more-plus{ transform: scale(1.06); }

/* Cart badge */
.cart-badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:18px; height:18px; padding:0 6px;
  border-radius:999px;
  background:#f2ebdf; color:#1d1916;
  font-size:12px; font-weight:800; line-height:1;
  border:1px solid var(--border);
  margin-left:6px;
  box-shadow:0 1px 2px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.2);
}
.topbar .cart-badge{
  background:#f2ebdf; color:#1d1916; border-color:#dbcfbf;
}
@media (prefers-reduced-motion:no-preference){
  .cart-badge{ transition:transform .15s ease; }
  .cart-link:hover .cart-badge{ transform:translateY(-1px); }
}

/* Delivery page */
.delivery-page{ display:flex; flex-direction:column; gap:24px; }

.delivery-intro{
  text-align:center;
  color:#e8e6e3;
  font-weight:700;
  background:#332e29;
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px 16px;
  max-width:900px;
  margin:0 auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}

.roll-carousel{
  overflow:hidden;
  border-radius:12px;
  border:1px solid var(--border);
  background:#2f2b27;
  padding:12px 0;
}
.roll-carousel .roll-track{
  display:flex; align-items:center; gap:0;
  width:max-content;
  animation:roll-left 30s linear infinite;
  will-change: transform;
}
.roll-carousel img{
  height:180px; width:auto; object-fit:cover;
  border-radius:10px;
  border:1px solid var(--border);
  background:#201c18;
  box-shadow:0 4px 12px rgba(0,0,0,.25);
}

@keyframes roll-left{
  0%{ transform: translateX(0); }
  100%{ transform: translateX(-50%); }
}
@media (prefers-reduced-motion:reduce){
  .roll-carousel .roll-track{ animation:none; }
}

/* Static gallery: single row of small thumbs */
.roll-gallery{
  display:flex;
  gap:12px;
  justify-content:center;
  align-items:center;
  border-radius:12px;
  border:1px solid var(--border);
  background:#2f2b27;
  padding:12px;
  margin:0 auto;
  overflow-x:auto;
}
.roll-gallery img{
  width:120px;
  height:120px;
  object-fit:cover;
  border-radius:10px;
  border:1px solid var(--border);
  background:#201c18;
  box-shadow:0 4px 12px rgba(0,0,0,.25);
}

.shipping-grid{
  display:grid;
  grid-template-columns: repeat(3,1fr);
  gap:24px;
  align-items:stretch;
}
@media (max-width:900px){
  .shipping-grid{ grid-template-columns:1fr; }
}

.ship-card{
  background:#2f2b27;
  border:1px solid var(--border);
  border-radius:12px;
  padding:18px;
  text-align:center;
  color:#e8e6e3;
  display:flex; flex-direction:column; align-items:center; gap:10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.ship-icon{ width:96px; height:auto; object-fit:contain; margin-bottom:6px; }
.ship-title{ font-size:24px; margin:8px 0 0; color:#e8e6e3; }
.ship-sub{ font-weight:800; color:#ffec99; margin:0; }
.ship-text{ margin:0; color:#dcd4cc; }

/* Mobile adjustments: keep header fully visible and show 3–4 cards per row */
@media (max-width:560px){
  .topbar-inner{ flex-wrap:wrap; gap:8px; }
  .brand{ font-size:32px; }
  .brand-wrap{ font-size:32px; }
  .nav{ display:flex; flex-wrap:wrap; gap:8px; }
  .nav a{ margin-left:0; }
}

/* Mobile grid: 3 per row on typical phones */
@media (max-width:480px){
  .grid{ grid-template-columns: repeat(3, 1fr); }
  .grid.grid-compact{ grid-template-columns: repeat(3, 1fr); }
}
/* Very narrow screens: 4 compact cards per row */
@media (max-width:360px){
  .grid{ grid-template-columns: repeat(4, 1fr); }
  .grid.grid-compact{ grid-template-columns: repeat(4, 1fr); }
}
