/* ==========================================================================
   Discountshops storefront — design system
   Original implementation. No third-party theme assets.
   ========================================================================== */

:root {
  --brand:        #0b4f9e;
  --brand-dark:   #083c78;
  --brand-light:  #e8f1fb;
  --accent:       #e8442c;
  --accent-dark:  #c4341f;
  --deal:         #f5a623;

  --ink:          #14181f;
  --ink-2:        #3d4652;
  --ink-3:        #6b7683;
  --line:         #e2e6ec;
  --line-2:       #f0f2f5;
  --bg:           #ffffff;
  --bg-2:         #f7f8fa;
  --bg-3:         #eef1f5;

  --ok:           #1d7a4c;
  --warn:         #b45309;

  --r-sm: 4px;  --r: 8px;  --r-lg: 14px;
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  --shadow:    0 1px 3px rgba(20,24,31,.08), 0 1px 2px rgba(20,24,31,.04);
  --shadow-lg: 0 8px 28px rgba(20,24,31,.12);

  --max: 1280px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55;
  color: var(--ink); background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-family: var(--font-heading, var(--font)); line-height: 1.22; margin: 0 0 var(--sp-3); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.65rem); }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 var(--sp-4); }
ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.25em; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: var(--r-sm); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--sp-4); }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--brand); color: #fff; padding: var(--sp-3) var(--sp-4);
}
.skip:focus { left: 0; }
.sr { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 11px 20px; border-radius: var(--r); border: 1px solid transparent;
  background: var(--brand); color: #fff; text-align: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn--accent { background: var(--accent); }
.btn--accent:hover { background: var(--accent-dark); }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { background: var(--bg-2); border-color: var(--ink-3); color: var(--ink); }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 28px; font-size: 1.02rem; }
.btn--sm { padding: 7px 13px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Header ---------- */
.util {
  background: var(--ink); color: #cfd6de; font-size: .8rem;
}
.util .wrap { display: flex; align-items: center; gap: var(--sp-2) var(--sp-4); min-height: 36px; flex-wrap: wrap; padding-top: 4px; padding-bottom: 4px; }
.util span { min-width: 0; overflow-wrap: anywhere; }
.util a { color: #cfd6de; }
.util a:hover { color: #fff; }
.util__spacer { margin-left: auto; }

.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.masthead .wrap {
  display: flex; align-items: center; gap: var(--sp-5); padding-top: var(--sp-4); padding-bottom: var(--sp-4);
}
.logo { display: flex; align-items: baseline; gap: 2px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; color: var(--brand); flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--accent); }
.logo small { display:block; font-size:.6rem; font-weight:500; color:var(--ink-3); letter-spacing:.02em; }

.search { flex: 1; display: flex; max-width: 620px; }
.search input {
  flex: 1; font: inherit; padding: 11px 14px; border: 2px solid var(--brand);
  border-radius: var(--r) 0 0 var(--r); min-width: 0;
}
.search button {
  border: 2px solid var(--brand); border-left: none; background: var(--brand); color: #fff;
  padding: 0 20px; border-radius: 0 var(--r) var(--r) 0; cursor: pointer; font: inherit; font-weight: 600;
}
.search button:hover { background: var(--brand-dark); }

.mast-actions { display: flex; align-items: center; gap: var(--sp-4); margin-left: auto; }
.mast-link { display: flex; align-items: center; gap: var(--sp-2); color: var(--ink-2); font-size: .85rem; font-weight: 500; }
.mast-link:hover { color: var(--brand); text-decoration: none; }
.cart-count {
  background: var(--accent); color: #fff; border-radius: 999px; font-size: .7rem;
  font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center;
}

/* ---------- Nav / mega menu ---------- */
.nav { background: var(--brand); position: relative; }
.nav__list { display: flex; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav__item { position: relative; }
.nav__link {
  display: block; padding: 12px 14px; color: #fff; font-size: .875rem; font-weight: 600; white-space: nowrap;
}
.nav__link:hover, .nav__item:hover .nav__link, .nav__item:focus-within .nav__link {
  background: var(--brand-dark); text-decoration: none;
}
.mega {
  display: none; position: absolute; left: 0; top: 100%; z-index: 60;
  background: #fff; min-width: 260px; padding: var(--sp-4);
  border: 1px solid var(--line); border-top: none; box-shadow: var(--shadow-lg);
  border-radius: 0 0 var(--r) var(--r);
}
.nav__item:hover .mega, .nav__item:focus-within .mega { display: block; }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega a { display: block; padding: 6px 0; color: var(--ink-2); font-size: .875rem; }
.mega a:hover { color: var(--brand); }

.nav__toggle { display: none; }

/* ---------- Trust strip ---------- */
.trust { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.trust__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); padding: var(--sp-4) 0; }
.trust__item { display: flex; align-items: center; gap: var(--sp-3); font-size: .84rem; }
.trust__ico { font-size: 1.5rem; line-height: 1; }
.trust__item strong { display: block; font-size: .9rem; }
.trust__item span { color: var(--ink-3); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(120deg, var(--brand) 0%, #1567c4 55%, #2b86e0 100%);
  color: #fff; padding: var(--sp-8) 0; margin-bottom: var(--sp-6);
}
.hero__inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--sp-7); align-items: center; }
.hero h1 { color: #fff; margin-bottom: var(--sp-4); }
.hero p { font-size: 1.05rem; opacity: .92; margin-bottom: var(--sp-5); }
.hero__badge {
  display: inline-block; background: var(--deal); color: #3a2600; font-weight: 700;
  font-size: .78rem; padding: 5px 12px; border-radius: 999px; margin-bottom: var(--sp-4);
  text-transform: uppercase; letter-spacing: .05em;
}
.hero__cta { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.hero__cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.hero__card {
  background: rgba(255,255,255,.14); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.22); border-radius: var(--r-lg);
  padding: var(--sp-4); text-align: center; color: #fff;
}
.hero__card span { font-size: 1.8rem; display: block; margin-bottom: var(--sp-2); }
.hero__card strong { display: block; font-size: .9rem; }
.hero__card em { font-style: normal; font-size: .78rem; opacity: .85; }

/* ---------- Sections ---------- */
.section { padding: var(--sp-6) 0; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-4); margin-bottom: var(--sp-5); border-bottom: 2px solid var(--line); padding-bottom: var(--sp-3);
}
.section__head h2 { margin: 0; }
.section__head a { font-size: .875rem; font-weight: 600; }

/* ---------- Product grid ---------- */
.grid { display: grid; gap: var(--sp-4); }
.grid--products { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid--cats { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

.card {
  border: 1px solid var(--line); border-radius: var(--r); background: #fff;
  display: flex; flex-direction: column; overflow: hidden;
  transition: box-shadow .16s ease, border-color .16s ease;
  position: relative;
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--ink-3); }
.card__media { position: relative; aspect-ratio: 1; background: var(--bg-3); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__tag {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700;
  padding: 3px 8px; border-radius: var(--r-sm); text-transform: uppercase; letter-spacing: .04em;
}
.card__tag--deal { background: var(--deal); color: #3a2600; }
.card__body { padding: var(--sp-3); display: flex; flex-direction: column; flex: 1; gap: var(--sp-2); }
.card__cat { font-size: .7rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.card__title { font-size: .875rem; font-weight: 600; margin: 0; line-height: 1.35; overflow-wrap: anywhere; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--brand); text-decoration: none; }
.card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.price { font-size: 1.1rem; font-weight: 800; color: var(--ink); }
.price__was { font-size: .8rem; color: var(--ink-3); text-decoration: line-through; font-weight: 500; margin-left: 5px; }
.stock { font-size: .74rem; color: var(--ok); font-weight: 600; }
.stock--out { color: var(--ink-3); }

.cat-tile {
  border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp-4) var(--sp-3);
  text-align: center; background: #fff; color: var(--ink); display: block;
  transition: border-color .16s ease, transform .16s ease;
}
.cat-tile:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.cat-tile span { font-size: 1.9rem; display: block; margin-bottom: var(--sp-2); }
.cat-tile strong { font-size: .84rem; font-weight: 600; }

/* ---------- Layout with sidebar ---------- */
.with-side { display: grid; grid-template-columns: 240px 1fr; gap: var(--sp-6); align-items: start; }
.side { border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp-4); background: #fff; }
.side h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: var(--sp-3); }
.side ul { list-style: none; margin: 0 0 var(--sp-5); padding: 0; }
.side li a { display: block; padding: 5px 0; font-size: .875rem; color: var(--ink-2); }
.side li a:hover { color: var(--brand); }

/* ---------- Breadcrumb + toolbar ---------- */
.crumb { font-size: .8rem; color: var(--ink-3); padding: var(--sp-4) 0; }
.crumb a { color: var(--ink-3); }
.crumb span { margin: 0 6px; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  flex-wrap: wrap; margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line);
}
.toolbar select, .field select, .field input, .field textarea {
  font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: var(--ink);
}
.count { font-size: .85rem; color: var(--ink-3); }

/* ---------- Product detail ---------- */
.pdp { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--sp-7); align-items: start; margin-bottom: var(--sp-7); }
.pdp__media { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-3); }
.pdp__thumbs { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--sp-2); margin-top: var(--sp-2); }
.pdp__thumbs img { border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
.pdp__price { font-size: 2rem; font-weight: 800; margin: var(--sp-3) 0 var(--sp-1); }
.pdp__tax { font-size: .8rem; color: var(--ink-3); margin-bottom: var(--sp-4); }
.pdp__meta { font-size: .82rem; color: var(--ink-3); margin-bottom: var(--sp-4); }
.pdp__buy { display: flex; gap: var(--sp-3); align-items: stretch; margin: var(--sp-5) 0; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.qty button { border: none; background: var(--bg-2); width: 40px; font-size: 1.15rem; cursor: pointer; color: var(--ink); }
.qty button:hover { background: var(--bg-3); }
.qty input { width: 48px; text-align: center; border: none; font: inherit; padding: 11px 0; }
.opt-row { margin-bottom: var(--sp-4); }
.opt-row label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: var(--sp-2); }
.chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: var(--r);
  padding: 7px 14px; font: inherit; font-size: .85rem; cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-light); color: var(--brand); font-weight: 600; }

.tabs { border-bottom: 2px solid var(--line); display: flex; gap: var(--sp-1); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.tab {
  border: none; background: none; font: inherit; font-weight: 600; font-size: .9rem;
  padding: 11px 18px; cursor: pointer; color: var(--ink-3); border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabpanel[hidden] { display: none; }

.spec { width: 100%; border-collapse: collapse; font-size: .875rem; }
.spec th, .spec td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.spec th { width: 200px; color: var(--ink-3); font-weight: 600; }

/* ---------- Cart / checkout ---------- */
.cart-row {
  display: grid; grid-template-columns: 88px 1fr auto auto auto; gap: var(--sp-4);
  align-items: center; padding: var(--sp-4) 0; border-bottom: 1px solid var(--line);
}
.cart-row img { border-radius: var(--r-sm); border: 1px solid var(--line); }
.summary { border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp-5); background: var(--bg-2); position: sticky; top: var(--sp-4); }
.summary__row { display: flex; justify-content: space-between; padding: var(--sp-2) 0; font-size: .9rem; }
.summary__row--total { border-top: 2px solid var(--line); margin-top: var(--sp-3); padding-top: var(--sp-3); font-size: 1.15rem; font-weight: 800; }
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: var(--sp-2); }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { min-height: 120px; resize: vertical; }
.field__hint { font-size: .78rem; color: var(--ink-3); margin-top: var(--sp-1); }
.field--err input, .field--err select, .field--err textarea { border-color: var(--accent); }
.field__err { color: var(--accent); font-size: .78rem; margin-top: var(--sp-1); display: none; }
.field--err .field__err { display: block; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }

.notice {
  border: 1px solid var(--line); border-left: 4px solid var(--brand); background: var(--brand-light);
  padding: var(--sp-4); border-radius: var(--r); font-size: .875rem; margin-bottom: var(--sp-5);
}
.notice--warn { border-left-color: var(--warn); background: #fff8ed; }
.notice--ok { border-left-color: var(--ok); background: #edf7f1; }
.notice p:last-child { margin-bottom: 0; }

/* ---------- Prose (CMS pages) ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: var(--sp-6); }
.prose h3 { margin-top: var(--sp-5); }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: var(--sp-5); }
.prose th, .prose td { text-align: left; padding: 10px 12px; border: 1px solid var(--line); }
.prose th { background: var(--bg-2); font-weight: 600; }
.todo {
  background: #fff3cd; border: 1px dashed var(--warn); color: #7a4a00;
  padding: 2px 7px; border-radius: var(--r-sm); font-size: .82rem; font-weight: 600;
  display: inline; overflow-wrap: anywhere; word-break: break-word;
}

/* ---------- Footer ---------- */
.foot { background: var(--ink); color: #b9c2cd; margin-top: var(--sp-8); font-size: .875rem; }
.foot a { color: #b9c2cd; }
.foot a:hover { color: #fff; }
.foot__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); padding: var(--sp-7) 0 var(--sp-6); }
.foot h3 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: var(--sp-4); }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: var(--sp-2); }
.foot__legal { border-top: 1px solid #2b323c; padding: var(--sp-5) 0; font-size: .8rem; line-height: 1.7; color: #8e99a6; overflow-wrap: anywhere; }
.foot__legal strong { color: #b9c2cd; }
.pay { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-4); }
.pay span {
  background: #fff; color: var(--ink); border-radius: var(--r-sm); padding: 4px 10px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}

/* ---------- Cookie banner ---------- */
.cookie {
  position: fixed; left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4); z-index: 200;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: var(--sp-5); max-width: 560px; margin: 0 auto;
  display: none;
}
.cookie.is-open { display: block; }
.cookie h3 { font-size: 1rem; }
.cookie p { font-size: .85rem; margin-bottom: var(--sp-4); }
.cookie__actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero__inner { grid-template-columns: 1fr; }
  .with-side { grid-template-columns: 1fr; }
  .side { display: none; }
  .pdp { grid-template-columns: 1fr; gap: var(--sp-5); }
  .foot__grid { grid-template-columns: repeat(2, 1fr); }
  .trust__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .masthead .wrap { flex-wrap: wrap; gap: var(--sp-3); }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .mast-actions { margin-left: auto; }
  .nav__toggle {
    display: block; width: 100%; background: var(--brand); color: #fff; border: none;
    font: inherit; font-weight: 600; padding: 12px var(--sp-4); text-align: left; cursor: pointer;
  }
  .nav__list { display: none; flex-direction: column; }
  .nav.is-open .nav__list { display: flex; }
  .nav__item { border-top: 1px solid rgba(255,255,255,.14); }
  .mega { position: static; box-shadow: none; border: none; padding: 0 0 var(--sp-3) var(--sp-5); background: var(--brand-dark); }
  .nav__item:hover .mega { display: none; }
  .cart-row { grid-template-columns: 64px 1fr; row-gap: var(--sp-2); }
  .row-2 { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 480px) {
  .grid--products { grid-template-columns: repeat(2, 1fr); }
  .foot__grid { grid-template-columns: 1fr; }
  .trust__grid { grid-template-columns: 1fr; }
  .hero { padding: var(--sp-6) 0; }
}

@media print {
  .util, .nav, .search, .cookie, .hero__cta { display: none; }
}
