:root {
  --ink: #10253f;
  --muted: #62748a;
  --line: #dde6ee;
  --soft: #f3f7fa;
  --accent: #f36f2c;
  --accent-dark: #ce4c12;
  --green: #147a50;
  --white: #fff;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #eef5f8 0, #fff 360px);
}

.shop-main a { color: inherit; text-decoration: none; }
.shop-main button,
.shop-main input,
.shop-main select,
.shop-main textarea,
.cart-drawer button,
.cart-drawer input,
.cart-drawer textarea { font: inherit; }

.shop-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand img { display: block; height: 42px; width: auto; }

.top-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.top-nav a, .cart-button, .icon-button, .primary {
  border: 0;
  cursor: pointer;
}

.top-nav a {
  padding: 10px 12px;
  border-radius: 8px;
}

.top-nav a:hover { background: var(--soft); color: var(--ink); }

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
}

.cart-button strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border-radius: 999px;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}

.cart-button.is-bumping strong {
  animation: cart-count-pop .52s cubic-bezier(.22, 1.3, .36, 1);
  color: #fff;
  background: var(--accent);
}

.shop-cart-mobile {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.header .nav-menu .mobile-submenu-static {
  display: none;
}

@media (min-width: 1101px) {
  .header .nav-menu .has-submenu > .submenu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 290px;
    padding: 12px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .98);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-strong);
    display: grid;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    height: auto;
    max-height: none;
    overflow: visible;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
    z-index: 50;
  }

  .header .nav-menu .has-submenu:hover > .submenu,
  .header .nav-menu .has-submenu:focus-within > .submenu,
  .header .nav-menu .has-submenu.open > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .header .nav-menu .has-submenu > .mobile-submenu-static {
    display: none !important;
  }

  .header .nav-menu {
    align-items: center;
  }
}

@media (max-width: 1100px) {
  .header .nav-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .header .nav-menu .has-submenu > .submenu {
    display: none !important;
  }

  .header .nav-menu .mobile-submenu-static {
    display: grid;
    gap: 6px;
    max-height: 0;
    margin-top: 0;
    padding: 0 8px;
    overflow: hidden;
    background: #f7fbfd;
    border: 0;
    border-radius: 18px;
    transition: max-height .25s ease, margin-top .25s ease, padding .25s ease, border-color .25s ease;
  }

  .header .nav-menu .has-submenu.open > .mobile-submenu-static {
    max-height: 560px;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--border);
  }

  .header .nav-menu .mobile-submenu-static-link {
    display: block;
    padding: 12px 14px;
    color: var(--muted);
    background: #fff;
    border-radius: 14px;
    font-weight: 800;
    text-decoration: none;
  }

  .header .nav-menu .mobile-submenu-static-link.active,
  .header .nav-menu .mobile-submenu-static-link:hover {
    color: var(--ink);
    background: #fff3ec;
  }

  .header .nav-mobile-only {
    display: grid;
    gap: 10px;
  }
}

.shop-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 76px;
}

.hero {
  display: block;
  padding: 34px 0 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.shop-main h1,
.shop-main h2,
.shop-main h3,
.shop-main p,
.cart-drawer h2,
.cart-drawer p { margin-top: 0; }

.shop-main h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(2.15rem, 5vw, 4.8rem);
  line-height: .95;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.dev-note {
  display: inline-flex;
  max-width: 760px;
  margin: 18px 0 0;
  padding: 12px 14px;
  color: var(--accent-dark);
  background: #fff3ec;
  border: 1px solid #ffd5c0;
  border-radius: 8px;
  font-weight: 900;
  line-height: 1.45;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px 230px;
  gap: 12px;
  margin: 18px 0 22px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shop-main label,
.cart-drawer label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 800;
}

.shop-main input,
.shop-main select,
.shop-main textarea,
.cart-drawer input,
.cart-drawer textarea {
  width: 100%;
  padding: 12px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd7e3;
  border-radius: 8px;
}

.shop-main textarea,
.cart-drawer textarea { resize: vertical; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 372px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(16, 37, 63, .06);
}

.product-image {
  display: grid;
  height: 156px;
  place-items: center;
  color: var(--accent-dark);
  background: linear-gradient(135deg, #fff3ec, #eaf4f8);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image span {
  font-size: 3rem;
  font-weight: 900;
}

.product-body {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  color: var(--muted);
  background: var(--soft);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 900;
}

.pill.sale { color: #fff; background: var(--accent); }
.pill.stock { color: var(--green); background: #e7f6ee; }

.product-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.product-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: auto;
}

.price {
  font-size: 1.38rem;
  font-weight: 900;
}

.old-price {
  color: #8b98a7;
  font-weight: 800;
  text-decoration: line-through;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px 18px;
}

.qty {
  width: 74px;
  text-align: center;
}

.shop-main .primary,
.cart-drawer .primary {
  min-height: 46px;
  padding: 12px 18px;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 900;
}

.shop-main .primary:hover,
.cart-drawer .primary:hover { background: var(--accent-dark); }

.shop-main .primary:disabled,
.cart-drawer .primary:disabled {
  cursor: wait;
  opacity: .68;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  justify-content: flex-end;
  background: rgba(16, 37, 63, .42);
}

.cart-drawer.is-open { display: flex; }

.cart-panel {
  width: min(480px, 100%);
  height: 100%;
  overflow: auto;
  padding: 22px;
  background: #fff;
}

.cart-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.cart-head h2 { margin: 0; }

.icon-button {
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: var(--soft);
  border-radius: 8px;
  font-size: 1.6rem;
}

.cart-items {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}

.cart-line strong { display: block; }
.cart-line small { color: var(--muted); }

.line-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.line-actions button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 1.2rem;
  font-weight: 900;
}

.checkout-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.form-message {
  margin: 0;
  color: var(--green);
  font-weight: 800;
}

.cart-notice {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 2300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(16, 37, 63, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity .2s ease, transform .2s ease;
}

.cart-notice.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.cart-notice.is-animated {
  animation: cart-notice-pop .42s cubic-bezier(.18, .9, .22, 1.15);
}

.cart-notice::before {
  content: "✓";
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-weight: 900;
}

.cart-notice-copy {
  flex: 1;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cart-notice-copy span {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 900;
}

.cart-notice-copy strong {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(243, 111, 44, .28);
  font-size: 1.08rem;
  line-height: 1;
  animation: cart-notice-number .52s cubic-bezier(.22, 1.3, .36, 1);
}

.cart-notice-copy small {
  flex: 1;
  min-width: 0;
  color: var(--green);
  font-size: .82rem;
  font-weight: 900;
}

.cart-notice button {
  min-height: 40px;
  padding: 9px 12px;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.empty {
  grid-column: 1 / -1;
  padding: 34px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

@keyframes cart-count-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.42); }
  70% { transform: scale(.92); }
  100% { transform: scale(1); }
}

@keyframes cart-notice-pop {
  0% { transform: translateY(18px) scale(.96); opacity: 0; }
  60% { transform: translateY(-3px) scale(1.02); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes cart-notice-number {
  0% { transform: scale(.7) translateY(6px); }
  45% { transform: scale(1.35) translateY(-2px); }
  100% { transform: scale(1) translateY(0); }
}

@media (max-width: 900px) {
  .hero, .toolbar { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .shop-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    justify-content: space-between;
  }

  .top-nav a { padding-inline: 4px; }
  .shop-main { width: min(100% - 22px, 1180px); padding-top: 22px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { min-height: auto; }
  .cart-drawer {
    align-items: flex-end;
    justify-content: center;
  }
  .cart-panel {
    width: 100%;
    height: min(88vh, 720px);
    border-radius: 22px 22px 0 0;
  }
  .cart-head {
    position: sticky;
    top: -22px;
    z-index: 2;
    margin: -22px -22px 18px;
    padding: 18px 22px 12px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 420px) {
  .cart-notice {
    gap: 8px;
  }

  .cart-notice-copy {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .cart-notice-copy strong {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .cart-notice button {
    padding-inline: 10px;
    font-size: .88rem;
  }
}
