@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --bg-a: #eef2ff;
  --bg-b: #ecfdf5;
  --ink: #0f172a;
  --muted: #64748b;
  --indigo: #6366f1;
  --indigo-dark: #4f46e5;
  --violet: #8b5cf6;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.9);
  --rail: #1e1b4b;
  --rail-text: #c7d2fe;
  --serif: 'Libre Baskerville', Georgia, serif;
  --sans: 'Outfit', system-ui, sans-serif;
  --rail-w: 248px;
  --panel-w: 360px;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink);
  background: linear-gradient(135deg, var(--bg-a) 0%, var(--bg-b) 50%, #faf5ff 100%);
  background-attachment: fixed; min-height: 100vh;
}
body.panel-open, body.cart-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--indigo); text-decoration: none; }
a:hover { color: var(--violet); }

.app-shell { display: flex; min-height: 100vh; }

.rail {
  width: var(--rail-w); flex-shrink: 0; background: var(--rail); color: var(--rail-text);
  padding: 28px 20px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.rail-logo {
  font-family: var(--serif); font-size: 1.35rem; color: #fff; font-weight: 700; margin-bottom: 28px;
  line-height: 1.25;
}
.rail-logo span { color: #a5b4fc; }
.rail-logo:hover { color: #fff; text-decoration: none; }
.rail-search { margin-bottom: 24px; }
.rail-search input {
  width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid #4338ca;
  background: #312e81; color: #fff; font-family: var(--sans); font-size: 13px;
}
.rail-search input::placeholder { color: #818cf8; }
.rail-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.rail-nav a {
  padding: 10px 12px; border-radius: 10px; color: var(--rail-text); font-size: 14px; font-weight: 500;
}
.rail-nav a:hover, .rail-nav a.active { background: rgba(99, 102, 241, 0.35); color: #fff; text-decoration: none; }
.rail-nav .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: #6366f1; margin: 16px 0 8px 12px; }
.rail-foot { font-size: 12px; color: #6366f1; margin-top: auto; padding-top: 20px; }

.bag-rail {
  margin-top: 16px; width: 100%; padding: 12px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff;
  font-weight: 600; font-family: var(--sans); cursor: pointer; display: flex; align-items: center; justify-content: space-between;
}
.bag-rail:hover { filter: brightness(1.08); }
.bag-num {
  background: #fff; color: var(--indigo); min-width: 22px; height: 22px; border-radius: 999px;
  font-size: 12px; display: none; align-items: center; justify-content: center; font-weight: 700;
}
.bag-num.show { display: inline-flex; }

.main-stage { flex: 1; padding: 32px 40px 64px; min-width: 0; }

.promo-line {
  font-size: 13px; color: var(--muted); margin-bottom: 24px; padding: 10px 16px;
  background: var(--glass); backdrop-filter: blur(12px); border-radius: 999px; border: 1px solid var(--glass-border);
  display: inline-block;
}
.promo-line strong { color: var(--indigo); }

.hero-glass {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center;
  padding: 40px; border-radius: 28px; background: var(--glass); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); box-shadow: 0 24px 60px rgba(99, 102, 241, 0.12); margin-bottom: 40px;
}
.hero-glass h1 { font-family: var(--serif); font-size: clamp(1.85rem, 3vw, 2.5rem); margin: 0 0 16px; line-height: 1.2; }
.hero-glass p { color: var(--muted); margin: 0 0 24px; max-width: 42ch; }
.hero-glass img { border-radius: 20px; height: 280px; width: 100%; object-fit: cover; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px;
  border-radius: 14px; font-weight: 600; font-size: 14px; border: none; cursor: pointer; font-family: var(--sans);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-prim { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4); }
.btn-prim:hover { transform: translateY(-1px); color: #fff; }
.btn-soft { background: var(--white); color: var(--ink); border: 1px solid #e2e8f0; }
.btn-block { width: 100%; }

.section-title { font-family: var(--serif); font-size: 1.5rem; margin: 0 0 20px; }

.p-list { display: flex; flex-direction: column; gap: 16px; }
.p-row {
  display: grid; grid-template-columns: 160px 1fr auto; gap: 24px; align-items: center;
  padding: 20px 24px; background: var(--glass); backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border); border-radius: 20px; transition: box-shadow 0.2s;
}
.p-row:hover { box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08); }
.p-row.hidden { display: none; }
.p-row .pic { height: 140px; background: #fff; border-radius: 16px; padding: 12px; display: flex; align-items: center; justify-content: center; }
.p-row .pic img { max-height: 100%; object-fit: contain; }
.p-row h3 { font-family: var(--serif); font-size: 1.1rem; margin: 0 0 6px; font-weight: 700; }
.p-row h3 a { color: var(--ink); }
.p-row h3 a:hover { color: var(--indigo); text-decoration: none; }
.p-row .tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--violet); }
.p-row .meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.p-row .price { font-size: 1.35rem; font-weight: 700; color: var(--indigo); }
.p-row .price .was { font-size: 14px; color: var(--muted); text-decoration: line-through; font-weight: 400; margin-left: 8px; }
.p-row .actions { display: flex; flex-direction: column; gap: 8px; min-width: 140px; }

.catalog-tools { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; align-items: center; }
.catalog-tools select, .catalog-tools input[type=search] {
  padding: 10px 16px; border-radius: 12px; border: 1px solid #e2e8f0; background: var(--white); font-family: var(--sans);
}

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filter-chips label {
  padding: 8px 16px; border-radius: 999px; background: var(--white); border: 1px solid #e2e8f0;
  font-size: 13px; cursor: pointer; font-weight: 500;
}
.filter-chips input { display: none; }
.filter-chips input:checked + span { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.filter-chips label:has(input:checked) { background: var(--indigo); color: #fff; border-color: var(--indigo); }

.pdp-top { margin-bottom: 32px; }
.pdp-top h1 { font-family: var(--serif); font-size: 2.25rem; margin: 12px 0 8px; }
.pdp-split { display: grid; grid-template-columns: 1fr 380px; gap: 36px; align-items: start; }
.pdp-visual img {
  width: 100%; border-radius: 24px; background: var(--glass); padding: 24px;
  border: 1px solid var(--glass-border); box-shadow: 0 20px 50px rgba(99, 102, 241, 0.15);
}
.pdp-panel {
  background: var(--rail); color: #e0e7ff; border-radius: 24px; padding: 28px; position: sticky; top: 32px;
}
.pdp-panel .price { font-family: var(--serif); font-size: 2.25rem; color: #fff; margin-bottom: 8px; }
.pdp-panel .ship { font-size: 13px; color: #a5b4fc; margin-bottom: 20px; }
.pdp-panel select { width: 100%; padding: 12px; border-radius: 12px; margin-bottom: 12px; border: none; }
.pdp-panel .btn-prim { width: 100%; margin-bottom: 10px; }
.pdp-panel .btn-soft { width: 100%; background: transparent; color: #fff; border-color: #6366f1; }
.pdp-panel .btn-soft:hover { background: #312e81; color: #fff; }
.pdp-body { background: var(--glass); backdrop-filter: blur(12px); border-radius: 24px; padding: 32px; border: 1px solid var(--glass-border); margin-bottom: 48px; }
.pdp-body ul { padding-left: 1.2em; }
.pdp-body li { margin-bottom: 8px; }
.wish-link { background: none; border: none; color: #a5b4fc; cursor: pointer; font-family: var(--sans); font-size: 13px; margin-top: 12px; text-decoration: underline; }

.guide-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.guide-tile {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 20px; overflow: hidden;
  display: grid; grid-template-columns: 120px 1fr;
}
.guide-tile img { height: 100%; min-height: 120px; object-fit: cover; }
.guide-tile div { padding: 20px; }
.guide-tile h3 { font-family: var(--serif); margin: 0 0 8px; font-size: 1.05rem; }
.guide-tile p { margin: 0; font-size: 13px; color: var(--muted); }

.article-glass {
  max-width: 720px; background: var(--glass); backdrop-filter: blur(12px); border-radius: 24px;
  padding: 40px; border: 1px solid var(--glass-border); margin-top: 24px;
}
.article-glass .lead-img { width: 100%; height: 260px; object-fit: cover; border-radius: 16px; margin-bottom: 24px; }
.article-glass h1 { font-family: var(--serif); margin: 0 0 12px; }
.article-glass h2 { font-family: var(--serif); font-size: 1.15rem; margin: 24px 0 10px; }

.cart-grid { display: grid; grid-template-columns: 1fr 320px; gap: 28px; }
.cart-line {
  display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; align-items: center;
  padding: 16px; background: var(--glass); border-radius: 16px; border: 1px solid var(--glass-border); margin-bottom: 12px;
}
.cart-line img { width: 90px; height: 90px; object-fit: contain; background: #fff; border-radius: 12px; }
.cart-aside {
  background: var(--rail); color: #e0e7ff; border-radius: 24px; padding: 24px; position: sticky; top: 32px;
}
.cart-aside .row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.cart-aside .grand { font-family: var(--serif); font-size: 1.4rem; margin-top: 16px; padding-top: 16px; border-top: 1px solid #4338ca; }

.cart-panel {
  position: fixed; top: 0; right: 0; width: var(--panel-w); max-width: 100%; height: 100%;
  background: rgba(30, 27, 75, 0.95); backdrop-filter: blur(20px); color: #e0e7ff;
  z-index: 200; transform: translateX(100%); transition: transform 0.35s ease;
  display: flex; flex-direction: column; border-left: 1px solid #4338ca;
}
.cart-panel.open { transform: translateX(0); }
.panel-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 199; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.panel-backdrop.show { opacity: 1; pointer-events: auto; }
.panel-head { padding: 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #4338ca; }
.panel-head h2 { font-family: var(--serif); margin: 0; color: #fff; }
.panel-body { flex: 1; overflow-y: auto; padding: 16px 24px; }
.panel-item { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid #312e81; font-size: 14px; }
.panel-foot { padding: 20px 24px; border-top: 1px solid #4338ca; }
.panel-close { background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; }

.page-foot { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(99, 102, 241, 0.2); font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 24px; }
.page-foot a { color: var(--muted); margin-right: 16px; }

#toastBox { position: fixed; bottom: 24px; left: calc(var(--rail-w) + 24px); z-index: 300; }
.toast { background: var(--rail); color: #fff; padding: 14px 20px; border-radius: 14px; font-size: 14px; margin-top: 8px; box-shadow: 0 12px 32px rgba(0,0,0,0.2); }

.mobile-rail-toggle { display: none; position: fixed; bottom: 20px; left: 20px; z-index: 150; padding: 14px 18px; border-radius: 14px; background: var(--rail); color: #fff; border: none; font-weight: 600; }

@media (max-width: 960px) {
  .app-shell { flex-direction: column; }
  .rail { position: fixed; left: 0; top: 0; z-index: 180; transform: translateX(-100%); transition: transform 0.3s; width: min(280px, 85vw); }
  .rail.open { transform: translateX(0); }
  .main-stage { padding: 24px 20px 80px; }
  .hero-glass, .pdp-split, .cart-grid, .guide-cards { grid-template-columns: 1fr; }
  .p-row { grid-template-columns: 100px 1fr; }
  .p-row .actions { grid-column: 1 / -1; flex-direction: row; }
  .mobile-rail-toggle { display: block; }
  #toastBox { left: 24px; }
}
