/* Магазинът (клиентската част). Админ панелът ползва само styles.css */
body.shop {
  --bg: #fff; --surface: #fff; --soft: #f3f5f4; --text: #14211c; --muted: #5c6a64; --line: #dfe5e2;
  --accent: #0c6b4a; --accent-ink: #fff; --accent-soft: #e3f1eb; --buy: #ffc53d; --radius: 10px; --shadow: none;
  color-scheme: light; background: var(--bg); color: var(--text); font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5;
}
.shop .wrap { max-width: 1320px; padding: 0 20px; }
.shop h1 { font-size: 26px; font-weight: 700; margin: 0; }
.shop h2 { font-size: 21px; font-weight: 700; margin: 0; }
.shop .btn { border-radius: 8px; font-weight: 600; }
.shop .btn.primary { background: var(--accent); border-color: var(--accent); }
.shop :focus-visible { outline: 3px solid #7cc4a8; outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.preview-bar { background: #fff3d1; padding: 8px 20px; text-align: center; font-size: 14px; }

/* Горна част */
.head { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.head-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 32px; align-items: center; min-height: 72px; }
.brand { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--accent); text-decoration: none; }
.search { display: flex; border: 2px solid var(--accent); border-radius: 10px; overflow: hidden; max-width: 720px; width: 100%; background: #fff; }
.search input { border: 0; border-radius: 0; padding: 10px 14px; min-width: 0; background: #fff; }
.search input:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 3px #cfe8dd; }
.search button { border: 0; background: var(--accent); color: #fff; width: 52px; display: grid; place-items: center; cursor: pointer; }
.head-links { display: flex; gap: 22px; }
.head-links a { display: flex; align-items: center; gap: 7px; text-decoration: none; font-weight: 500; }
.head-links a:hover { color: var(--accent); }
.shop .cart-count { background: var(--buy); color: #14211c; }
.cats .wrap { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.cats a { padding: 10px 0; text-decoration: none; white-space: nowrap; font-size: 14px; font-weight: 500; border-bottom: 3px solid transparent; }
.cats a:hover { color: var(--accent); }
.cats a[aria-current] { border-color: var(--accent); color: var(--accent); }

/* Продукти в решетка */
.items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.item { text-decoration: none; display: grid; align-content: start; }
.item-img { position: relative; display: block; aspect-ratio: 1; background: var(--soft); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.item-img img { width: 100%; height: 100%; object-fit: cover; }
.item-img .alt { position: absolute; inset: 0; opacity: 0; transition: opacity .18s; }
@media (hover: hover) { .item:hover .alt { opacity: 1; } .item:hover .item-title { text-decoration: underline; } }
.item-price { font-size: 19px; font-weight: 700; }
.item-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-ship { font-size: 13px; color: var(--muted); }

/* Начало */
.home-title { margin: 32px 0 18px !important; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile { text-decoration: none; background: var(--soft); border-radius: var(--radius); overflow: hidden; display: grid; font-weight: 600; }
.tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.tile span { padding: 10px 12px; }
.tile:hover span { color: var(--accent); }
.row { margin-top: 48px; }
.row > header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; gap: 16px; }
.row > header a { color: var(--accent); font-weight: 600; }
.nothing { padding: 72px 0; text-align: center; color: var(--muted); }
.nothing h1, .nothing h2 { color: var(--text); }

/* Категория и търсене */
.trail { padding: 18px 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trail a { color: inherit; }
.catalog { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 36px; align-items: start; }
.filters summary { display: none; }
.filters section { border-bottom: 1px solid var(--line); padding: 14px 0; }
.filters section:first-of-type { padding-top: 0; }
.filters h3 { font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.filters label, .cat-link { display: flex; gap: 8px; align-items: center; padding: 4px 0; cursor: pointer; text-decoration: none; font-size: 14px; }
.filters input[type=checkbox], .filters input[type=radio] { width: 17px; height: 17px; accent-color: var(--accent); flex: none; margin: 0; padding: 0; }
.filters i { font-style: normal; color: var(--muted); margin-left: auto; font-size: 13px; }
.cat-link[aria-current] { font-weight: 700; color: var(--accent); }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters .btn { margin-top: 14px; width: 100%; }
.js .filters .btn { display: none; }
.results-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.sort { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.sort select { width: auto; padding: 8px 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chips a { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 6px 12px; text-decoration: none; font-size: 14px; font-weight: 500; }
.chips .clear { background: none; text-decoration: underline; }
.pages { display: flex; gap: 6px; justify-content: center; margin: 40px 0 0; flex-wrap: wrap; }
.pages a { min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; }
.pages a[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Продуктова страница */
.pdp { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 48px; align-items: start; }
.gal { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; position: sticky; top: 136px; }
.gal:not(:has(.gal-thumbs)) { grid-template-columns: 1fr; }
.gal-thumbs { display: grid; gap: 8px; align-content: start; }
.gal-thumbs button, .swatches button { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: #fff; aspect-ratio: 1; }
.gal-thumbs button[aria-current], .swatches button[aria-current] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.gal-thumbs img, .swatches img { width: 100%; height: 100%; object-fit: cover; }
.gal-main { position: relative; aspect-ratio: 1; max-height: 660px; width: 100%; background: var(--soft); border-radius: var(--radius); overflow: hidden; }
.gal-main img { width: 100%; height: 100%; object-fit: contain; }
.gal-nav { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #ffffffe0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--text); }
.gal-nav.prev { left: 12px; } .gal-nav.next { right: 12px; }
.buy h1 { font-size: 24px; line-height: 1.3; }
.buy-price { font-size: 32px; font-weight: 800; margin: 14px 0 0; letter-spacing: -.02em; }
.buy .small { margin: 0; }
.pick { margin: 20px 0 8px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, 60px); gap: 8px; }
.buy .field { margin: 20px 0 0; font-weight: 500; }
.ship-line { margin: 20px 0 0; }
.shop .ship-choice { border-radius: var(--radius); margin: 20px 0 0; }
.shop .ship-choice input { width: 17px; height: 17px; flex: none; accent-color: var(--accent); translate: 0 3px; }
.shop .btn.buy-btn { width: 100%; margin: 20px 0 10px; padding: 15px; font-size: 17px; background: var(--buy); border-color: var(--buy); color: #14211c; }
.shop .btn.buy-btn:hover { background: #f5b522; }
.go-cart { width: 100%; margin-bottom: 10px; }
.go-cart[hidden] { display: none; }
.facts { padding: 18px 0 0 18px; margin: 20px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.more { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 44px 48px; margin-top: 56px; border-top: 1px solid var(--line); padding-top: 36px; }
.more h2 { margin-bottom: 12px; }
.more p { max-width: 68ch; }
.specs { margin: 0; } .specs div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); } .specs dd { margin: 0; overflow-wrap: anywhere; }

/* Количка, профил, други */
.shop main > h1 { margin: 32px 0 16px; }
.account { max-width: 760px; margin: 32px auto; }
.account form.login { display: grid; gap: 12px; max-width: 380px; margin-top: 18px; }
.account .code { font-size: 26px; letter-spacing: .3em; text-align: center; }
.order { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.order header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 600; }
.order ul { padding-left: 18px; margin: 10px 0; }
.note { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 16px; }
.note.err { background: #fde8e6; }
.legal { margin: 24px 0; }

/* Долна част */
.foot { margin-top: 88px; background: var(--soft); padding: 36px 0 20px; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.foot-grid div > a { display: block; text-decoration: none; padding: 4px 0; } .foot-grid a:hover { text-decoration: underline; }
.foot-grid p { color: var(--muted); margin: 8px 0; }

@media (max-width: 1080px) { .items { grid-template-columns: repeat(3, minmax(0, 1fr)); } .catalog { gap: 24px; grid-template-columns: 210px minmax(0, 1fr); } }
@media (max-width: 860px) {
  .shop .wrap { padding: 0 16px; }
  .head-row { grid-template-columns: 1fr auto; gap: 10px 16px; padding-top: 12px !important; padding-bottom: 10px !important; min-height: 0; }
  .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .head-links span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .head-links a { min-height: 40px; }
  .items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog, .pdp, .more { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .filters summary { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; font-weight: 600; cursor: pointer; }
  .filters details[open] summary { margin-bottom: 14px; }
  .filters label, .cat-link { padding: 8px 0; }
  .sort { margin-left: 0; width: 100%; } .sort select { flex: 1; }
  .gal { grid-template-columns: minmax(0, 1fr); position: static; }
  .gal-main { order: -1; }
  .gal-thumbs { display: flex; overflow-x: auto; } .gal-thumbs button { flex: 0 0 64px; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media print { .head, .foot { display: none; } }
@media (prefers-reduced-motion: reduce) { .item-img .alt { transition: none; } }
