/* Theo's Toy Shop - storefront styles (left sidebar layout) */
:root {
  --red: #e63946;
  --yellow: #ffb703;
  --blue: #2563eb;
  --dark: #1d2433;
  --dark-2: #273043;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #2a2f3a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --sidebar-w: 250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; display: block; }

.announcement {
  background: var(--yellow);
  color: #442c00;
  text-align: center;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.92rem;
}

/* ----- Layout: fixed left sidebar ----- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--dark);
  color: #dbe2ef;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-icon { font-size: 1.7rem; }
.brand-name { font-size: 1.12rem; font-weight: 800; line-height: 1.2; }

.side-nav { flex: 1; padding: 12px 0; }
.nav-section {
  padding: 14px 18px 6px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a93a6;
  font-weight: 700;
}
.side-nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  color: #cdd5e4;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
}
.side-nav a:hover { background: var(--dark-2); color: #fff; }
.side-nav a.sub { padding-left: 32px; font-size: 0.88rem; color: #a8b2c4; }
.side-nav a.active {
  background: var(--dark-2);
  color: #fff;
  border-left-color: var(--yellow);
  font-weight: 600;
}

.side-nav .parent-meta { display: flex; align-items: center; gap: 8px; }
.side-nav .chevron {
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid #8a93a6;
  transition: transform 0.15s ease;
}
.side-nav details.nav-acc { border: 0; }
.side-nav details.nav-acc > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  color: #cdd5e4;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
  cursor: pointer;
  list-style: none;
}
.side-nav details.nav-acc > summary::-webkit-details-marker { display: none; }
.side-nav details.nav-acc > summary::marker { content: ''; display: none; }
.side-nav details.nav-acc > summary:hover { background: var(--dark-2); color: #fff; }
.side-nav details.nav-acc.current > summary {
  color: #fff;
}
.side-nav details.nav-acc[open] > summary .chevron { transform: rotate(90deg); }
.side-nav details.nav-acc:not([open]) > a { display: none !important; }
.side-nav details.nav-acc[open] > a.sub { display: flex !important; }
.side-nav .count {
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 1px 8px;
}
.side-nav .cart-count { background: var(--red); color: #fff; }

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.85rem;
  color: #9aa4b8;
}

/* ----- Main column ----- */
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.menu-toggle {
  display: none;
  font-size: 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark);
}
.search { flex: 1; display: flex; max-width: 480px; }
.search input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 0.95rem;
}
.search button {
  padding: 9px 16px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 0 8px 8px 0;
  font-weight: 600;
  cursor: pointer;
}
.cart-link { margin-left: auto; font-weight: 600; color: var(--dark); white-space: nowrap; }
.account-btn {
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  padding: 8px 16px;
  border-radius: 8px;
  white-space: nowrap;
}
.account-btn:hover { filter: brightness(1.1); }

.content { flex: 1; padding: 28px 24px; max-width: 1180px; width: 100%; }

/* ----- Hero ----- */
.hero {
  background: linear-gradient(120deg, var(--red), #b5172a);
  color: #fff;
  border-radius: var(--radius);
  padding: 44px 36px;
  margin-bottom: 32px;
}
.hero h1 { font-size: 2rem; margin-bottom: 10px; }
.hero p { font-size: 1.06rem; opacity: 0.94; max-width: 560px; }
.hero .seo-intro { margin: 8px 0 0; }
.hero .seo-intro p { max-width: 720px; opacity: 1; }
.hero .seo-intro a { color: var(--yellow); }
.hero .btn { margin-top: 18px; }
.hero-help { margin-top: 14px; max-width: 560px; opacity: 0.95; font-size: 0.95rem; }

/* ----- Buttons / badges ----- */
.btn {
  display: inline-block;
  background: var(--yellow);
  color: #442c00;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.96rem;
}
.btn:hover { filter: brightness(1.05); }
.btn-primary { background: var(--red); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--dark); color: var(--dark); }
.badge-sale {
  background: var(--red); color: #fff;
  font-size: 0.72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}
.badge-out { background: var(--muted); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }

/* ----- Product grid ----- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 16px; }
.section-head h2 { font-size: 1.35rem; }
.section-head h1,
.section-head .page-h1 { font-size: 1.45rem; margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.09); transform: translateY(-2px); }
.card-img { aspect-ratio: 1; background: #fff; display: flex; align-items: center; justify-content: center; }
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-brand { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.card-title { font-size: 0.98rem; font-weight: 600; color: var(--dark); }
.card-price { margin-top: auto; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.06rem; color: var(--dark); }
.price-old { text-decoration: line-through; color: var(--muted); font-weight: 500; font-size: 0.9rem; }
.card .btn { margin-top: 10px; text-align: center; }

/* ----- Category tiles (home) ----- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cat-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  color: var(--dark);
  font-weight: 700;
}
.cat-tile:hover { border-color: var(--yellow); box-shadow: 0 6px 18px rgba(0,0,0,0.07); }
.cat-tile small { display: block; color: var(--muted); font-weight: 500; margin-top: 4px; }

/* ----- Product page ----- */
.product-page { display: grid; grid-template-columns: minmax(280px, 480px) 1fr; gap: 34px; align-items: start; }
.product-page .photo { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.product-page .photo > img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.thumbs .thumb {
  width: 68px; height: 68px; padding: 4px; border: 2px solid var(--border);
  border-radius: 8px; background: #fff; cursor: pointer;
}
.thumbs .thumb.active, .thumbs .thumb:hover { border-color: var(--red); }
.thumbs .thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-page h1 { font-size: 1.6rem; margin-bottom: 6px; }
.product-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; }
.product-price { font-size: 1.7rem; font-weight: 800; margin: 12px 0; display: flex; gap: 12px; align-items: center; }
.product-desc { margin-top: 18px; white-space: pre-line; }
.qty-row { display: flex; gap: 10px; align-items: center; margin: 16px 0; }
.qty-row input { width: 74px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; text-align: center; font-size: 1rem; }

/* ----- Cart / forms / tables ----- */
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { background: #f1f3f8; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.table img.thumb { width: 56px; height: 56px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.cart-total { text-align: right; font-size: 1.25rem; font-weight: 800; margin: 18px 0; }

.ship-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; max-width: 640px; margin-bottom: 8px;
}
.ships-from { color: var(--muted); font-size: 0.86rem; margin: 8px 0 0; }
.table .ships-from { margin-top: 4px; }
.ship-note { color: var(--muted); font-size: 0.92rem; margin: 0 0 14px; }
.ship-note.ship-ok { color: #166534; }
.ship-note.ship-warn { color: #92400e; }
.ship-choice, .ship-rates { display: grid; gap: 8px; margin-bottom: 16px; }
.ship-radio {
  display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.ship-radio input { width: auto; margin: 0; }
.ship-radio em { font-style: normal; font-weight: 800; margin-left: 8px; color: var(--red, #c0392b); }
.ship-address .form-row { display: grid; grid-template-columns: 1.4fr 0.7fr 0.7fr; gap: 12px; }
.ship-address label { display: block; font-weight: 600; margin: 0 0 5px; font-size: 0.9rem; }
.ship-address input, .ship-address select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.96rem; font-family: inherit;
}
.ship-totals { border-top: 1px solid var(--border); padding-top: 12px; }
.ship-totals div { display: flex; justify-content: space-between; margin: 6px 0; }
.ship-grand { font-size: 1.15rem; font-weight: 800; }
@media (max-width: 700px) {
  .ship-address .form-row { grid-template-columns: 1fr; }
}

.form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 620px; }
.form label { display: block; font-weight: 600; margin: 14px 0 5px; font-size: 0.92rem; }
.form input, .form textarea, .form select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.96rem; font-family: inherit;
}
.form textarea { min-height: 100px; resize: vertical; }

.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.status-new { background: #dbeafe; color: #1e40af; }
.status-contacted { background: #fef3c7; color: #92400e; }
.status-paid { background: #dcfce7; color: #166534; }
.status-shipped { background: #ede9fe; color: #5b21b6; }
.status-done { background: #e5e7eb; color: #374151; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; }
.alert-success { background: #dcfce7; color: #14532d; }
.alert-error { background: #fee2e2; color: #7f1d1d; }
.empty-note { color: var(--muted); padding: 30px 0; }

.contact-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.contact-card h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}
.contact-card p, .contact-card a {
  font-weight: 700;
  color: var(--dark);
  font-size: 1.05rem;
  white-space: pre-line;
}
.contact-card a:hover { color: var(--blue); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.legal-updated { color: var(--muted); margin: -8px 0 22px; font-size: 0.9rem; }
.legal { max-width: 720px; }
.legal h3 { font-size: 1.08rem; margin: 22px 0 8px; }
.legal p, .legal li { margin-bottom: 10px; color: var(--text); }
.legal ul { padding-left: 20px; margin-bottom: 12px; }
.legal li { margin-bottom: 8px; }

.site-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-links a { margin-left: 14px; color: var(--muted); }
.footer-nap { width: 100%; margin-bottom: 4px; color: var(--text); font-weight: 600; }
.footer-legal { width: 100%; margin: 10px 0 0; font-size: 0.78rem; line-height: 1.45; color: var(--muted); }

.seo-intro { max-width: 720px; margin: 0 0 22px; line-height: 1.55; }
.seo-intro p { margin-bottom: 12px; }
.seo-intro a { color: var(--blue); }
.hero .seo-intro, .hero .seo-intro p { max-width: 640px; opacity: 1; }
.page-h1 { margin: 0 0 14px; font-size: 1.7rem; }
.seo-block { max-width: 720px; margin: 28px 0; }
.seo-block h2 { font-size: 1.25rem; margin-bottom: 8px; }
.seo-block p { line-height: 1.55; }
.seo-faq { max-width: 720px; margin: 32px 0; }
.seo-faq h2 { font-size: 1.25rem; margin-bottom: 12px; }
.seo-acc { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; background: var(--card); }
.seo-acc summary { cursor: pointer; font-weight: 700; }
.seo-acc p { margin: 10px 0 4px; line-height: 1.5; }
.crumbs { margin: 0 0 16px; font-size: 0.88rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.crumbs li:not(:last-child)::after { content: '›'; margin-left: 6px; }
.crumbs a { color: var(--muted); }

.checkout-guest {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 18px;
  max-width: 620px;
}
.checkout-guest h2 { font-size: 1.15rem; margin: 0 0 6px; }
.checkout-guest p { margin: 0; color: var(--text); }
.checkout-guest .muted { color: var(--muted); margin-top: 8px; }
.account-optional { margin: 10px 0 18px; color: var(--muted); max-width: 620px; }

.expert-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 62;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--dark);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px 12px 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(29, 36, 51, 0.28);
}
.expert-fab:hover { filter: brightness(1.08); }
.expert-fab-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--yellow); color: #442c00;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900;
}
.expert-panel {
  position: fixed;
  right: 18px;
  bottom: 80px;
  z-index: 61;
  width: min(400px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 110px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(29, 36, 51, 0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.expert-panel.is-open {
  display: flex;
}
.expert-panel[hidden] {
  display: none !important;
}
.expert-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 10px;
  background: var(--dark);
  color: #fff;
}
.expert-head p { margin: 4px 0 0; font-size: 0.82rem; color: #cdd5e4; font-weight: 500; }
.expert-close {
  flex-shrink: 0;
  background: #fff;
  border: 0;
  color: var(--dark);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 999px;
  min-height: 36px;
}
.expert-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; }
.expert-chips button {
  border: 1px solid var(--border); background: var(--bg); border-radius: 999px;
  padding: 5px 10px; font: inherit; font-size: 0.8rem; cursor: pointer;
}
.expert-log { flex: 1; overflow-y: auto; padding: 10px 12px; display: grid; gap: 10px; min-height: 160px; }
.expert-msg { padding: 10px 12px; border-radius: 12px; font-size: 0.92rem; }
.expert-you { background: #e8eefc; justify-self: end; max-width: 90%; }
.expert-bot { background: var(--bg); border: 1px solid var(--border); }
.expert-bot p { margin: 0 0 8px; }
.expert-bot p:last-child { margin-bottom: 0; }
.expert-pending { color: var(--muted); font-style: italic; }
.expert-item {
  display: flex; gap: 10px; margin-top: 10px; padding: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; color: inherit;
}
.expert-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #eee; }
.expert-item strong { display: block; color: var(--dark); }
.expert-item em { font-style: normal; font-weight: 800; color: var(--red); }
.expert-item small { display: block; color: var(--muted); margin-top: 2px; }
.expert-bang {
  display: inline-block; background: var(--yellow); color: #442c00;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px; margin-bottom: 4px;
}
.expert-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--border); }
.expert-form textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; resize: none; }
.expert-form .btn { align-self: end; }

/* ----- Mobile: sidebar becomes drawer ----- */
.nav-overlay { display: none; }
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-overlay {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 30;
  }
  .menu-toggle { display: block; }
  .product-page { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .content { padding: 20px 16px; }
}
