/* ===== chrono-tsh v8 — Structure 3 colonnes, palette v7, animations Emil Kowalski ===== */

:root {
  --bg-primary: #f7f9fc;
  --bg-secondary: #eef4fa;
  --bg-warm: #e3edf7;
  --ink: #0f172a;
  --ink-soft: #334155;
  --ink-muted: #64748b;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-light: #60a5fa;
  --line: #dbeafe;
  --line-strong: #bfdbfe;
  --white: #ffffff;
  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-ui: 'DM Sans', system-ui, sans-serif;
  --radius-sm: 4px; /* keep */
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-soft: 0 2px 16px rgba(28, 25, 23, 0.06);
  --shadow-medium: 0 8px 40px rgba(28, 25, 23, 0.1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--ink);
  line-height: 1.65;
  font-size: 20px;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
#site-header {
  background: rgba(247, 249, 252, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
/* Logo d'origine : 923x108, tres allonge — on borne aussi la largeur pour
   qu'il ne pousse pas la recherche hors de l'entete sur petit ecran. */
.store-logo img { max-height: 56px; width: auto; max-width: 100%; display: block; }
.logo-text {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 0.95;
}
.logo-text .tsh {
  font-family: var(--font-display);
  font-size: 2.18rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--ink);
}
.logo-text .editions {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 5px;
  color: var(--accent);
  font-weight: 600;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.header-search {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.search-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.98rem;
  background: var(--white);
  width: 180px;
  transition: width 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  width: 220px;
}
.search-btn {
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.98rem;
  font-family: var(--font-ui);
  transition: background 0.15s var(--ease-out), transform 0.1s var(--ease-out);
}
.search-btn:hover { background: var(--accent-dark); }
.search-btn:active { transform: scale(0.96); }
.cart-link {
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-ui);
  font-size: 1.03rem;
}
.cart-count {
  background: var(--accent);
  color: var(--white);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.86rem;
}

/* ===== NAVBAR ===== */
.main-menu {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  padding: 0;
  border-top: 1px solid var(--line);
}
.menu-item {
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 1.03rem;
  font-weight: 500;
  border-right: 1px solid var(--line);
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
.menu-item:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}
.menu-item.active {
  background: var(--accent);
  color: var(--white);
}

/* ===== BODY WRAPPER — 3 colonnes ===== */
#bodyWrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  gap: 1rem;
  align-items: start;
}

/* ===== SIDEBOXES ===== */
.sidebox {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s var(--ease-out);
}
.sidebox:hover { box-shadow: var(--shadow-medium); }
.sidebox-heading {
  background: var(--bg-secondary);
  color: var(--ink);
  padding: 0.5rem 0.75rem;
  font-size: 0.98rem;
  font-family: var(--font-ui);
  font-weight: 600;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.sidebox-heading a { color: var(--ink); text-decoration: none; }
.sidebox-content {
  padding: 0.6rem 0.75rem;
  font-size: 0.98rem;
  font-family: var(--font-body);
  color: var(--ink-soft);
  line-height: 1.8;
}
.sidebox-content a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s var(--ease-out);
}
.sidebox-content a:hover { color: var(--accent); }
.cat-link {
  display: block;
  padding: 0.25rem 0;
  border-bottom: 1px dotted var(--line);
  font-size: 0.98rem;
}
.cat-link:last-child { border-bottom: none; }
.cat-link.active { color: var(--accent); font-weight: 600; }
.small-text {
  font-size: 0.86rem;
  color: var(--ink-muted);
  margin: 0.5rem 0;
}
.quick-search-input {
  width: 80%;
  padding: 0.4rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  transition: border-color 0.2s var(--ease-out);
}
.quick-search-input:focus {
  outline: none;
  border-color: var(--accent);
}
.quick-search-btn {
  padding: 0.4rem 0.5rem;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.92rem;
}

/* ===== CONTENU CENTRAL ===== */
#bodyContent { min-width: 0; }
.content-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
}
.content-heading {
  font-family: var(--font-display);
  font-size: 1.26rem;
  color: var(--ink);
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.5rem;
  margin-top: 0;
}

/* ===== PRESENTATION BLOCK ===== */
.presentation-block {
  text-align: center;
  padding: 1rem 0;
}
.presentation-text {
  font-family: var(--font-body);
  font-size: 1.09rem;
  line-height: 1.8;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

/* ===== HERO IMAGES (dépliant + chrono gif) ===== */
.hero-images {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}
.hero-image-item {
  text-align: center;
}
.hero-image-item img {
  max-width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.hero-image-item img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-medium);
}
.hero-image-caption {
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
  font-family: var(--font-ui);
}

/* ===== PROMO CARDS ===== */
.promo-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.25rem 0;
}
.promo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  text-decoration: none;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.promo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
  opacity: 0.8;
}
.promo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
  border-color: var(--accent);
}
.promo-card-highlight {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fbbf24;
}
.promo-card-highlight::before {
  background: #f59e0b;
}
.promo-card-highlight:hover {
  border-color: #f59e0b;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.2);
}
.promo-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.promo-card-highlight .promo-icon-wrap {
  background: rgba(245, 158, 11, 0.15);
}
.promo-icon-wrap svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.promo-card-highlight .promo-icon-wrap svg { stroke: #d97706; }
.promo-card h3 {
  font-size: 1.08rem;
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.5rem;
}
.promo-card p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 0.75rem;
  line-height: 1.5;
  flex-grow: 1;
}
.promo-badge {
  display: inline-block;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s var(--ease-out);
}
.promo-card:hover .promo-badge {
  transform: scale(1.05);
}
.promo-badge-blue {
  color: var(--white);
  background: var(--accent);
}
.promo-badge-gold {
  color: #92400e;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  border: 1px solid #f59e0b;
}
.promo-note {
  font-size: 0.86rem;
  color: var(--ink-muted);
  text-align: center;
  font-style: italic;
  margin-top: 0.75rem;
}
@media (max-width: 900px) {
  .promo-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .promo-cards { grid-template-columns: 1fr; }
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.product-card {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}
.product-link { text-decoration: none; color: inherit; display: block; }
.product-image {
  background: var(--white);
  text-align: center;
  padding: 0.5rem;
}
.product-image img {
  max-width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
}
.product-body { padding: 0.5rem 0.75rem; }
.product-body h3 {
  font-size: 0.98rem;
  font-family: var(--font-ui);
  color: var(--ink);
  margin: 0 0 0.25rem;
}
.product-card .btn { margin: 0.5rem; }
.product-price { font-size: 1.03rem; font-family: var(--font-ui); }
.old-price { text-decoration: line-through; color: var(--ink-muted); font-size: 0.92rem; }
.price { color: var(--accent); font-weight: 600; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.98rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.1s var(--ease-out), background 0.15s var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary {
  background: var(--bg-warm);
  color: var(--ink-soft);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--accent);
}
.btn-outline:hover { background: var(--bg-secondary); }
.btn-sm { font-size: 0.86rem; padding: 0.3rem 0.6rem; }

/* ===== FICHE TECHNIQUE ===== */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-family: var(--font-ui);
}
.info-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
  width: 30%;
}
.info-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  font-size: 0.98rem;
  color: var(--ink-soft);
}

/* ===== FOOTER ===== */
#site-footer {
  background: var(--ink);
  color: var(--line);
  text-align: center;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
  font-size: 0.92rem;
  font-family: var(--font-ui);
}
.footer-menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.footer-menu a { color: var(--line); text-decoration: none; }
.footer-menu a:hover { text-decoration: underline; color: var(--white); }
.footer-contact { line-height: 1.8; color: var(--ink-muted); }
.footer-contact a { color: var(--line); }
.copyright { margin-top: 1rem; color: var(--ink-muted); font-size: 0.86rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  #bodyWrapper { grid-template-columns: 1fr; }

  /* Une fois les colonnes empilees, le contenu principal doit venir EN PREMIER :
     l'ordre du DOM (gauche > contenu > droite) reléguerait sinon le produit,
     le panier ou le formulaire sous deux colonnes de navigation. */
  #bodyContent { order: 1; }
  #columnLeft  { order: 2; }
  #columnRight { order: 3; }

  #columnLeft, #columnRight {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-content: start;
  }
  .header-top { flex-direction: column; }
  .main-menu { flex-wrap: wrap; }

  /* Fiche produit : visuel au-dessus du texte plutot que 200px + 1fr */
  .product-detail-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 600px) {
  #bodyWrapper { padding: 0.5rem; }
  .main-menu { flex-direction: column; }
  .menu-item { border-right: none; border-bottom: 1px solid var(--line); }
  .product-grid { grid-template-columns: 1fr 1fr; }
  #columnLeft, #columnRight { grid-template-columns: 1fr; }

  /* Le champ de recherche se retracte au lieu de pousser le bouton hors ecran */
  .header-right { width: 100%; }
  .header-search { width: 100%; }
  .search-input, .search-input:focus { flex: 1 1 auto; width: auto; min-width: 0; }

  /* Les tableaux larges defilent DANS leur conteneur, sans elargir la page.
     On ne touche pas au display du <table> : le passer en block casserait
     la mise en page tabulaire. */
  #cart-items, #cart-summary, #order-cart, .content-box { max-width: 100%; overflow-x: auto; }
  .cart-table, .order-table, .info-table { font-size: 0.8rem; }
  .cart-table th, .cart-table td,
  .order-table th, .order-table td { padding: 0.4rem 0.3rem; }
  .info-table th { width: auto; }
}
