* { box-sizing: border-box; }
html, body { margin: 0; padding: 0;   font-family: "Source Sans 3", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #1f2937; }


/* ===== Theme tokens ===== */
:root{
  --bg: #f8fafc;            /* page background */
  --text: #0f172a;          /* primary text */
  --muted: #475569;         /* secondary text */
  --card: #ffffff;          /* card background */
  --card-border: #e5e7eb;   /* subtle border */
  --shadow: 0 8px 20px rgba(2,6,23,0.08), 0 2px 6px rgba(2,6,23,0.06);
  --accent: #2563eb;        /* links / hover */
  --content: clamp(64rem, 92vw, 140rem);
  --gutter:  clamp(1rem, 2vw, 3rem);
  --ui-body-size: 0.9375rem;   /* ~15px */
  --ui-line: 1.5;
  --ui-bg: #fff;
  --ui-text: #0f172a;
  --ui-muted: #64748b;
  --ui-border: #e5e7eb;
  --ui-card: #fff;
  --ui-primary: #2563eb;
  --ui-primary-fore: #fff;
  --ui-danger: #b91c1c;
  --ui-danger-bg: #fee2e2;
  --ui-shadow: 0 24px 48px rgba(2,6,23,.25), 0 8px 16px rgba(2,6,23,.12);
  --ui-radius: 16px;
  --ui-radius-sm: 10px;
  --ui-font: "Noto Sans", "Source Sans 3", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}


 
  .ui-input, .ui-select, .ui-textarea, .ui-file {
  width: 100%;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--ui-font);
}
.ui-textarea { min-height: 90px; }



[hidden] { display: none !important; }


.main {
  /* add safe fallbacks in case CSS variables aren't defined globally */
  max-width: calc(var(--content, 1100px) + 2 * var(--gutter, 16px));
  margin: 0 auto;
  padding: 0 var(--gutter, 16px);
}

/* ===== Generic grid (used elsewhere) ===== */
.grid{
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-items: stretch;
  max-width: 1200px;
  margin: 0 auto;
}
/* Book card */
.card{
  display:flex; flex-direction:column; height:100%;
  padding:10px;
  background:var(--card);
  border:1px solid var(--card-border);
  border-radius:10px;
  box-shadow:var(--shadow);
}

/* Fixed-ratio cover box */
.cover{
  aspect-ratio: 2 / 3;
  width: 100%;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow:
    10px 0 16px -10px rgba(2,6,23,0.18),  /* right */
    0 12px 18px -8px  rgba(2,6,23,0.20);  /* bottom */
}

/* Make the link fill the box */
.cover > a.card-link{
  display: block;
  height: 100%;
}

/* One definitive rule for the image (fills box, bottom-aligned, with shadow) */
.cover > a.card-link img{
  width: 100%;
  height: 100%;
  background: transparent;
  object-fit: contain;
  object-position: 50% 100%; /* bottom */
  display: block;
    box-shadow: none;
}
.title{
  font-family: Montserrat, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(.95rem, 2.6vw, 1.05rem);
  line-height: 1.25;
  color: var(--text);
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
  -webkit-line-clamp: 2; line-clamp: 2;
  margin: 2px 0 4px;
}

.author{
  margin-top: auto;
  font-weight: 500;
  font-size: clamp(.85rem, 2.2vw, .98rem);
  color: var(--muted);
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
  -webkit-line-clamp: 1; line-clamp: 1;
}

.placeholder{
  aspect-ratio: 2/3; width: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: #f3f4f6; border-radius: 6px;
  box-shadow: 0 6px 18px rgba(2,6,23,0.12), 0 2px 6px rgba(2,6,23,0.08);
  text-align: center; padding: 10px; margin-bottom: 8px;
}
.placeholder svg{ width: 48%; height: auto; fill: #9ca3af; opacity: .95; margin-bottom: 8px; }
.placeholder span{ font-size: .9rem; color: #6b7280; }



a.card-link{ display: block; color: inherit; text-decoration: none; }
a.card-link:hover .title{ color: var(--accent); }
a.card-link:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ===== Pagination ===== */
.pager-summary{
  font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 14px;
  color:#2d4236; text-align:center; margin: 12px 0 8px;
}

.pagination{
  display:flex; align-items:center; justify-content:center;
  gap:6px; margin: 16px 0 28px; font-family: 'Montserrat', sans-serif;
}

.page-num,.page-btn{
  display:inline-flex; min-width:36px; height:36px; padding:0 10px;
  border-radius:10px; border:1px solid #e5e7eb; background:#fff; color:#2d4236;
  text-decoration:none; align-items:center; justify-content:center;
  font-weight:700; font-size:14px; transition: background .15s, border-color .15s, color .15s;
}
.page-num:hover,.page-btn:hover{ background:#f5f7f6; border-color:#dfe3e6; }
.page-num.is-current{ background:#2d4236; border-color:#2d4236; color:#fff; cursor:default; }
.page-btn.is-disabled{ opacity:.45; pointer-events:none; }
.page-ellipsis{ padding: 0 4px; color:#94a3a8; user-select:none; }

@media (max-width: 480px){
  .page-num{ min-width:32px; height:32px; font-size:13px; }
  .page-btn{ min-width:32px; height:32px; }
  .pager-summary{ font-size:13px; }
}

/* Load more */
.loadmore-wrap { display:flex; justify-content:center; margin:20px 0 32px; }
.loadmore-btn {
  font-family: 'Montserrat', sans-serif; font-weight:700; font-size:14px;
  padding:10px 16px; border-radius:8px; border:1px solid #e5e7eb;
  background:#fff; color:#2d4236; cursor:pointer;
  transition: background .15s ease, border-color .15s ease;
}
.loadmore-btn:hover { background:#f5f7f6; border-color:#dfe3e6; }
.loadmore-btn:disabled { opacity:.6; cursor:default; }

/* ===== Two-column catalog layout (filters + books) ===== */
.catalog{
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  margin-top: 16px;
}

.catalog-main { min-width: 0; } /* prevents overflow in grid children */

/* Book grid inside catalog: single, consolidated definition */
.catalog #book-grid.grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  max-width: none;
  margin: 0;
}

/* Scroll offset for JS scrollIntoView */
#book-grid { scroll-margin-top: 130px; }
@media (max-width: 660px) { #book-grid { scroll-margin-top: 72px; } }

/* Stack on smaller screens */
@media (max-width: 720px){
  .catalog{ grid-template-columns: 1fr; }
  .filters{ margin-bottom: 12px; }
}

/* Kill any old floats */
.filters, .catalog-main { float: none !important; }

.site-logo{ font-family:'Montserrat',sans-serif; font-weight:800; font-size:26px; color:#2d4236; text-decoration:none; white-space:nowrap; }
.site-logo:hover{ color:#3d5c4b; }

.header-search{ display:flex; flex:1; align-items:center; justify-content:center; padding:20px; }
.header-search__form{ display:flex; align-items:stretch; width:100%; max-width:800px; border:2px solid #2d4236; border-radius:4px; overflow:hidden; background:#fff; }
.header-search__input{ flex:1; border:none; padding:0 12px; font-size:15px; outline:none; background:#fff; display:flex; align-items:center; }
.header-search__button{ background:#1f2430; border:none; color:#fff; font-size:15px; padding:0 24px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:background .2s; white-space:nowrap; }
.header-search__button:hover{ background:#323949; }
.header-search__button svg{ width:18px; height:18px; margin-right:6px; }
.header-search__form input,
.header-search__form button{ height:48px; }

@media (max-width: 660px){
  .header-search__button{ padding:0 12px; font-size:0; }
  .header-search__button svg{ margin-right:0; }
  .site-header{ padding:10px 0; }
  .site-logo{ font-size:18px; margin-right:5px;}
  .header-search{ padding:10px 0; }
}

/* Top strip */
.top-strip{ background:#1f2430; border-bottom:1px solid #e5e7eb; width:100%; font-family:'Montserrat',sans-serif; }
.top-strip__inner{
  max-width:1200px; margin:0 auto; padding:8px 16px; display:flex; gap:16px; align-items:center;
}
.top-strip a{ color:#2d4236; text-decoration:none; font-weight:600; font-size:14px; }
.top-strip a:hover{ color:#3d5c4b; }

/* ===== Filters: accordion + lists ===== */

/* Entire filter column typography */
.filters{
  font-family: var(--ui-font);
  font-size: var(--ui-body-size);
  line-height: var(--ui-line);
  letter-spacing: 0.01em;
  color: #0f172a;
}

/* Fieldset reset + separators */
.filters fieldset{ border:0; border-radius:0; padding:0 0 12px; margin:0 0 12px; }
.filters fieldset:not(:last-of-type){ border-bottom:1px solid #030d20; }

/* Accordion legend (single source of truth) */
.filters .filter-group > legend{
  display:flex; align-items:center; justify-content:space-between;
  width:100%;
  margin:0;
  padding:10px 12px 18px;
  cursor:pointer; user-select:none;

  font-family: var(--ui-font);
  font-weight: 700;
  font-size: clamp(0.9rem, 0.88rem + 0.2vw, 1rem);
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.filters .filter-group > legend::after{
  content:""; width:8px; height:8px; border-right:2px solid #64748b; border-bottom:2px solid #64748b;
  transform: rotate(-45deg); transition: transform .15s ease; margin-left:8px; flex:0 0 auto;
}
.filters .filter-group.is-open > legend::after{ transform: rotate(45deg); }
.filters .filter-group > legend:focus-visible{ outline:2px solid #2d4236; outline-offset:2px; }
.filters .filter-group > legend:hover{ background:#f7f7f7; border-radius:6px; }

/* Collapsible body */
.filters .filter-group .fg-body{ display:none; padding:8px 12px 12px; }
.filters .filter-group.is-open .fg-body{ display:block; }

/* One checkbox per row */
#cat-list label,
#publisher-list label,
#author-list label,
#year-list label,
#lang-list label{
  display:block;
  padding: 0.375rem 0; /* 6px 0 */
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Checkbox + spacing */
.filters input[type="checkbox"]{ width:16px; height:16px; margin-right:8px; vertical-align:-2px; }

/* Inputs */
.filters input[type="text"],
.filters input[type="number"]{
  font: inherit;
  font-size: 0.875rem; /* 14px */
  letter-spacing: 0.01em;
  padding: 0.5rem 0.625rem; /* 8px 10px */
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem; /* 8px */
}

/* Facet name + count */
.facet-name{ font-family: var(--ui-font); color: #0f172a; }
.filters .facet-count{ color:#64748b; font-size:0.8125rem; margin-left:0.375rem; }

/* Apply button */
.filters .btn-apply{
  font-family: var(--ui-font);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}


.breadcrumbs { font-size: 14px; color: #6b7280; margin: 8px 0 14px; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; }
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs li + li::before { content: ">"; padding: 0 8px; color: #9ca3af; }
.breadcrumbs a { color: #374151; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .current { color: #111827; font-weight: 600; }





/* Sticky animated header */
.site-header{
  position: static; /* overlay at the very top until sticky */
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px;
  height: 80px;
  z-index: 1000;
  background: rgba(255,255,255,0.15);
  backdrop-filter: none;
  box-shadow: none;
  transition:
    padding .3s ease,
    background-color .3s ease,
    box-shadow .3s ease,
    backdrop-filter .3s ease;
}

.site-header.is-sticky{
  position: fixed; /* stick to top after threshold */
  top: 0; left: 0; right: 0;
  padding: 8px 20px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 5px 16px rgba(0,0,0,0.10);
  animation: slideDown .35s ease-out; /* <- the “pull down” */
}

/* shrink controls a bit when sticky  */
.site-header.is-sticky .header-search__form input,
.site-header.is-sticky .header-search__form button{
  height: 42px;
  font-size: 14px;
}

/* optional: gently scale logo when sticky */
.site-header .site-logo{ transition: transform .3s ease; }
.site-header.is-sticky .site-logo{ transform: scale(.92); transform-origin: left center; }

@keyframes slideDown{
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}





/* login logout state show */
.userbar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-height: 70px;
  line-height: 1;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Logged-in summary */
.userbar__summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  list-style: none;
  appearance: none;
  -webkit-user-select: none;
          user-select: none;
}
.userbar__summary::-webkit-details-marker { display: none; }

.userbar__avatar {
  width: 40px;
  height: 40px;
  max-height: 40px;
  border-radius: 50%;
  background: #1f2430;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(2,6,23,0.10);
}
.userbar__name {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
}
.userbar__chev { color: #475569; }

/* Dropdown */
.userbar__menu {
  position: relative;
}
.userbar__menu[open] .userbar__summary {
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px rgba(2,6,23,0.06);
}
.userbar__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 16px 32px rgba(2,6,23,0.12), 0 4px 12px rgba(2,6,23,0.06);
  z-index: 1000;
}
.logout-form {
  margin: 0;       /* remove default form margin */
  display: block;  /* make form fill the dropdown width */
}

.userbar__item {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  width: 100%;          /* <— ensures full width */
  color: #0f172a;
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  background: none;     /* reset button look */
  border: none;         /* reset button look */
  cursor: pointer;
  text-align: left;     /* align label with links */
}
.userbar__item:hover { background: #f1f5f9; }
.userbar__item--danger { color: #b91c1c; }
.userbar__item--danger:hover { background: #fee2e2; }

/* Logged-out buttons */
.userbar__guest {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.userbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  text-decoration: none;
  color: #0f172a;
  font-weight: 600;
  font-size: 14px;
}
.userbar__btn:hover { background: #f8fafc; }
.userbar__btn--primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.userbar__btn--primary:hover {   background: #0e40aa; color:black; }

/* Keep everything comfy inside a 70px header */
.userbar svg { display: block; }



@media (max-width: 820px){
  .userbar__btn--primary { display: none;  }
  .userbar__guest {margin-left: 5px;}
  .site-header {padding-left: 0px;}
  .userbar__btn {gap: 0px; padding: 10px 5px;}
  .userbar__name { display: none; }
  .header-search__input {padding: 10px 0px; font-size: 12px;}

}




/* ========= Modals ========= */
.modal__card {
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--ui-card);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  font-family: var(--ui-font);
}
.modal__head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid var(--ui-border);
}
.modal__close {
  border: 0;
  background: transparent;
  font-size: 22px;
  padding: 8px;
  cursor: pointer;
  line-height: 1;
  color: var(--ui-muted);
}
.modal__close:hover { color: var(--ui-text); }
.modal__body { padding: 16px; }

.sellmodal {
  border: none;
  border-radius: var(--ui-radius);
  padding: 0;
  width: min(640px, 95vw); /* default: up to 640px, else 95% viewport */
  max-height: 90vh;
  box-shadow: var(--ui-shadow);
}

/* Make it a bit wider on large screens */
@media (min-width: 1024px) {
  .sellmodal {
    width: min(780px, 80vw); /* up to 780px or 80% of viewport */
  }
}

/* On small screens: allow it to stretch almost full width */
@media (max-width: 640px) {
  .sellmodal {
    width: 96vw; /* only tiny margin left/right */
    border-radius: 12px;
  }
}



.sellmodal::backdrop { background: rgba(2,6,23,.5); }
.sellmodal h3 { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.sellmodal .form-row { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.sellmodal .form-row > span { font-weight: 600; color: #334155; }
.sellmodal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }



/* === Generic overlay (your <div id="editModal" class="modal">) === */
.modal {
  position: fixed;
  inset: 0;
  display: none;                 /* hidden by default */
  align-items: center;
  justify-content: center;
  background: rgba(2,6,23,.5);
  z-index: 1000;
}
.modal:not([hidden]) { display: flex; }

/* Lock page scroll when modal is open */
html.lock-scroll, body.lock-scroll { overflow: hidden; }

/* === Card: vertical layout; header fixed; body scrolls === */
.modal__card {
  /* Width & height responsive, override inline when present */
  width: clamp(560px, 92vw, 880px) !important;
  max-height: min(92vh, 900px) !important;

  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(2,6,23,.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;              /* keep inner scrollbars inside */
  contain: layout paint;         /* stabilizes resize/scroll paints */
}

/* Keep close row visible while body scrolls */
.modal__head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.modal__close {
  border: 0;
  background: transparent;
  font-size: 20px;
  padding: 8px;
  cursor: pointer;
  line-height: 1;
  border-radius: 8px;
}
.modal__close:hover { background: #f1f5f9; }

/* Only the body scrolls */
.modal__body {
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
}

/* Responsive tweaks */
@media (min-width: 1024px) {
  .modal__card { width: clamp(700px, 70vw, 980px) !important; }
}
@media (max-width: 640px) {
  .modal__card { width: 96vw !important; border-radius: 12px; }
}



.loginmodal .modal__msg{
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff6d5;
  border: 1px solid #ffe08a;
  border-radius: 10px;
  font-size: 14px;
}

/* optional shake animation on error */
#loginDialog.shake { animation: modal-shake .35s ease; }
@keyframes modal-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}


/* Buttons (base) */
.btn {
  padding: 10px 12px;
  border-radius: var(--ui-radius-sm);
  border: 1px solid var(--ui-border);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  color: var(--ui-text);
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

/* Primary button (blue) */
.btn--primary {
  background: var(--ui-primary);
  border-color: var(--ui-primary);
  color: var(--ui-primary-fore);
}

a.btn--primary {
text-decoration: none;
}


.btn--primary:hover {
  background: #1e4ed8; /* slightly darker blue */
  border-color: #1e4ed8;
}

/* Ghost (neutral) */
.btn--ghost {
  background: #fff;
  border-color: var(--ui-border);
  color: var(--ui-text);
}
.btn--ghost:hover {
  background: #f1f5f9; /* soft gray */
}

/* Danger (delete) */
.btn--danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff;
}
.btn--danger:hover {
  background: #fee2e2; /* light red background */
  border-color: #fca5a5;
}

/* Extra polish: focus state */
.btn:focus-visible {
  outline: 2px solid var(--ui-primary);
  outline-offset: 2px; }

.btn[disabled],
.btn.is-disabled {
  background: #e5e7eb !important;
  border-color: #e5e7eb !important;
  color: #9ca3af !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}


.prebasket-modal::backdrop{background:rgba(0,0,0,.45)}
.prebasket-modal{border:0;padding:0;background:transparent}
.prebasket{
  position:relative; max-width:780px; margin:auto; background:#fff; border-radius:16px;
  box-shadow:0 20px 60px rgba(0,0,0,.25); padding:18px;
  font-family:system-ui,Segoe UI,Roboto,Arial,sans-serif;
}
.prebasket__close{position:absolute; top:8px; right:8px; border:0; background:transparent; font-size:20px; line-height:1; cursor:pointer; opacity:.7}
.prebasket__row{display:flex; align-items:center; justify-content:center; gap:16px}
.prebasket__row--tools{justify-content:space-between; flex-wrap:wrap}
.prebasket__title{margin:0; display:flex; align-items:center; gap:12px}
.prebasket__check{display:inline-grid; place-items:center; width:28px; height:28px; border-radius:50%; background:#16a34a; color:#fff; font-weight:700}
.prebasket__book{display:flex; align-items:center; gap:12px}
.prebasket__img img{width:72px; height:96px; object-fit:contain; border:1px solid #e5e7eb; border-radius:8px; background:#f8fafc}
.prebasket__meta{display:flex; flex-direction:column}
.prebasket__meta a{font-weight:600; text-decoration:none; color:#111827}
.prebasket__price{display:block; margin-top:4px}
.prebasket__total{color:#6b7280; margin-top:2px}
.prebasket__hr{border:0; border-top:1px solid #e5e7eb; margin:12px 0}
.btn{display:inline-flex; align-items:center; justify-content:center; gap:.5rem; padding:.6rem 1rem; border-radius:10px; background:#111827; color:#fff; text-decoration:none}
.btn--bd{background:#fff; color:#111827; border:1px solid #e5e7eb}
@media (max-width:560px){
  .prebasket{margin:8px; padding:14px}
  .prebasket__row{flex-direction:column; align-items:flex-start}
}




.header-cart { display:flex; flex-direction:column; align-items:center; gap:4px; margin-right:12px }
.header-cart__btn {
  position:relative; display:inline-flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:10px; text-decoration:none;
  background:var(--ui-card); border:1px solid var(--ui-border); color:var(--ui-text);
}
.header-cart__icon { display:block }
.header-cart__badge{
  position:absolute; top:-6px; right:-6px; min-width:18px; height:18px; padding:0 5px;
  border-radius:999px; background:#ef4444; color:#fff; font-size:11px; line-height:18px;
  text-align:center; font-weight:700;
}
.header-cart.is-empty .header-cart__badge{ display:none; }

.header-cart__total{ font-size:12px; color:var(--ui-muted); white-space:nowrap; }
@media (max-width: 520px){ .header-cart__total{ display:none; } } /* optional: hide total on tiny screens */