:root {
  --ink: #17191f;
  --muted: #5f6470;
  --pink: #cf5c8a;
  --pink-dark: #a9416d;
  --pink-soft: #f5cede;
  --pink-wash: #fae7ef;
  --paper: #fff8fb;
  --surface: #fff;
  --line: #e2ced8;
  --green: #287f55;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: clip; background: var(--paper); color: var(--ink); font-family: Montserrat, sans-serif; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.shop-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 78px;
  padding: 10px clamp(16px, 5vw, 72px);
  border-bottom: 2px solid var(--ink);
  background: rgba(250, 231, 239, .94);
  backdrop-filter: blur(12px);
}
.shop-logo img { display: block; width: 164px; height: 52px; object-fit: contain; mix-blend-mode: multiply; }
.shop-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.shop-nav a { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; text-transform: uppercase; }
.cart-jump, .app-link {
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 4px 0 rgba(23, 25, 31, .16);
}
.app-link { display: inline-flex; align-items: center; background: var(--ink); color: #fff; }
.cart-jump span { display: inline-grid; min-width: 20px; place-items: center; }

.shop-hero { padding: 72px clamp(18px, 6vw, 96px) 42px; text-align: center; }
.shop-hero > span { color: var(--pink-dark); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.shop-hero h1 { margin: 12px 0; font-family: "Cabin Sketch", cursive; font-size: 72px; line-height: .95; letter-spacing: 0; }
.shop-hero p { max-width: 680px; margin: 20px auto 0; color: var(--muted); line-height: 1.6; }

.checkout-notice {
  width: min(1320px, calc(100% - 36px));
  margin: 0 auto 24px;
  padding: 14px 16px;
  border: 2px solid #2d7751;
  border-radius: 6px;
  background: #e8f7ed;
  color: #155132;
  font-weight: 800;
}
.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  width: min(1320px, calc(100% - 36px));
  margin: 0 auto;
  padding-bottom: 80px;
  align-items: start;
}
.catalog { min-width: 0; }
.catalog-group { position: relative; isolation: isolate; padding: 30px 24px; overflow: visible; }
.catalog-group + .catalog-group { margin-top: 34px; }
.catalog-group.offers, .catalog-group.hardware { background: transparent; }
.catalog-group.offers::before {
  content: "";
  position: absolute;
  inset: 7% -2%;
  z-index: -2;
  border-radius: 42%;
  background:
    radial-gradient(circle at 18% 42%, rgba(230, 119, 169, .56), transparent 46%),
    radial-gradient(circle at 72% 30%, rgba(247, 197, 220, .88), transparent 48%),
    radial-gradient(circle at 56% 84%, rgba(191, 91, 142, .38), transparent 52%);
  background-size: 165% 165%;
  filter: blur(30px);
  animation: offer-pink-drift 12s ease-in-out infinite;
}
@keyframes offer-pink-drift {
  0%, 100% { background-position: 0% 45%; transform: scale(1); }
  50% { background-position: 100% 55%; transform: scale(1.04); }
}
.shop-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.shop-toolbar h2, .cart-panel h2 { margin: 0; font-family: "Cabin Sketch", cursive; font-size: 34px; letter-spacing: 0; }
.shop-toolbar p { max-width: 460px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: right; }

.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.catalog-group.addons { padding-block: 12px; }
.addon-products { grid-template-columns: 1fr; }
.addon-products .product { display: grid; grid-template-columns: minmax(190px, 240px) minmax(0, 1fr); }
.addon-products .product-media { min-height: 230px; aspect-ratio: auto; }
.addon-products .product-body { padding: 22px; }
.addon-products .product h3 { font-size: 22px; }
.addon-products .product p { max-width: 680px; }
.product {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(23, 25, 31, .18);
  border-radius: 7px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 12px 30px rgba(111, 45, 79, .12);
  transition: transform .2s ease, box-shadow .2s ease;
}
.product:hover { transform: translateY(-3px); box-shadow: 0 18px 38px rgba(111, 45, 79, .17); }
.catalog-group.offers .product { border: 0; backdrop-filter: blur(8px); }
.product.featured { outline: 5px solid rgba(207, 92, 138, .2); }
.product-media { position: relative; aspect-ratio: 4 / 3; background: #f8edf2; }
.product-media img { width: 100%; height: 100%; padding: 14px; object-fit: contain; }
.product-kind {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.product-body { display: flex; flex: 1; flex-direction: column; padding: 16px; }
.product h3 { margin: 0; font-size: 18px; }
.product p { margin: 9px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.product ul { display: grid; gap: 7px; margin: 0 0 16px; padding: 0; list-style: none; }
.product li { position: relative; padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.product li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }
.price { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.price strong { font-family: "Cabin Sketch", cursive; font-size: 27px; }
.price span { color: var(--muted); font-size: 11px; font-weight: 700; }
.product button, .checkout-button {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--pink-soft);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 2px 3px 0 rgba(23, 25, 31, .18);
}
.product button:hover, .checkout-button:hover { background: #eeb4ce; }

.cart-panel {
  position: sticky;
  top: 98px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: #fff;
  box-shadow: 5px 6px 0 rgba(23, 25, 31, .16);
}
.cart-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.cart-count { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 900; }
.empty { padding: 32px 8px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.5; }
.cart-line { display: grid; grid-template-columns: 58px 1fr auto; gap: 10px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 58px; height: 58px; padding: 4px; object-fit: contain; background: #f8edf2; }
.cart-line strong { display: block; font-size: 13px; }
.cart-line small { color: var(--muted); font-size: 11px; }
.remove { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: #f6edf1; font-size: 21px; cursor: pointer; }
.quantity { display: flex; align-items: center; gap: 5px; margin-top: 7px; }
.quantity button { width: 29px; height: 29px; padding: 0; border: 1px solid var(--ink); border-radius: 4px; background: #fff; cursor: pointer; }
.quantity span { min-width: 22px; text-align: center; font-size: 12px; font-weight: 800; }
.promo { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-top: 18px; }
.promo input { min-width: 0; height: 44px; padding: 10px; border: 1px solid #c8adb9; border-radius: 5px; text-transform: uppercase; }
.promo button { border: 1px solid var(--ink); border-radius: 5px; background: var(--pink-wash); font-weight: 800; cursor: pointer; }
.promo-message, .form-message { min-height: 18px; margin: 7px 0 0; color: var(--pink-dark); font-size: 11px; font-weight: 800; }
.totals { display: grid; gap: 8px; margin-top: 16px; padding: 14px 0; border-block: 1px solid var(--line); font-size: 13px; }
.totals span { display: flex; justify-content: space-between; gap: 12px; }
.totals .total { padding-top: 8px; border-top: 1px dashed #bea2ae; font-size: 18px; font-weight: 900; }
.checkout-button:disabled { opacity: .5; cursor: wait; }
.checkout-help { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.checkout-dialog {
  width: min(700px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 22px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 8px 10px 0 rgba(23, 25, 31, .22);
}
.checkout-dialog::backdrop { background: rgba(20, 11, 17, .64); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; font-size: 22px; cursor: pointer; }
.checkout-dialog > span { color: var(--pink-dark); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.checkout-dialog h2 { margin: 5px 44px 6px 0; font-family: "Cabin Sketch", cursive; font-size: 34px; }
.checkout-dialog > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.checkout-dialog form { display: grid; gap: 13px; }
.checkout-dialog label { display: grid; gap: 6px; font-size: 12px; font-weight: 900; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.checkout-dialog input, .checkout-dialog textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #c8adb9; border-radius: 5px; }
.checkout-dialog textarea { resize: vertical; }
.checkout-dialog .terms { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.terms input { flex: 0 0 auto; width: 18px; min-height: 18px; height: 18px; margin: 0; }
.terms a { color: var(--pink-dark); font-weight: 800; }

.shop-legal { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 18px; padding: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; }
.shop-legal a { color: var(--ink); font-weight: 800; text-decoration: none; }
.shop-legal span { flex-basis: 100%; }

@media (max-width: 1100px) {
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shop-header { gap: 10px; min-height: 68px; padding: 8px 14px; }
  .shop-logo img { width: 132px; height: 46px; }
  .shop-nav { display: none; }
  .cart-jump { margin-left: auto; padding: 8px 11px; }
  .app-link { padding: 8px 11px; }
  .shop-hero { padding: 52px 18px 32px; }
  .shop-hero h1 { font-size: 54px; }
  .shop-layout { grid-template-columns: 1fr; width: min(calc(100% - 24px), 680px); }
  .cart-panel { position: static; max-height: none; grid-row: 1; scroll-margin-top: 82px; }
}
@media (max-width: 560px) {
  .shop-logo img { width: 116px; }
  .app-link { display: none; }
  .shop-toolbar { align-items: flex-start; flex-direction: column; }
  .shop-toolbar p { text-align: left; }
  .catalog-group { padding: 14px; }
  .products { grid-template-columns: 1fr; }
  .addon-products .product { display: flex; }
  .addon-products .product-media { min-height: 0; aspect-ratio: 4 / 3; }
  .shop-hero h1 { font-size: 45px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .catalog-group.offers::before { animation: none; }
  .product { transition: none; }
}
