/* ============================================================================
   Le Glam India — application stylesheet (dark / champagne-gold edition)

   Served by Propshaft (config/initializers + app/assets/config/manifest.js).
   Sections map to the page regions they style:

     :root            -> design tokens (colors, fonts). Change the theme here.
     Base / type      -> body, serif display headings, links, focus rings
     Header / nav     -> .site-header, .main-nav, .search-form, .compare-link
     Cards & grids    -> .product-grid, .product-card, .category-grid
     Category browse  -> .category-page (sidebar + results columns), .facet
     Product detail   -> .product-head, .specs-table
     Reviews          -> .review, .sub-score bars
     Compare matrix   -> .compare-matrix, .row-diff/.row-same (toggled by JS)
     Flash / footer   -> .flash, .site-footer, .ad-slot

   Palette: warm near-black surfaces + champagne gold, matching the logo
   asset app/assets/images/le-glam-logo.png (gold script on black — the
   header is pure black so the PNG's own background blends invisibly).
   ========================================================================== */

:root {
  /* Design tokens — champagne gold on warm charcoal. */
  --accent:      #e8c464;   /* primary gold (kept for legacy references) */
  --accent-dark: #b9962e;
  --gold-bright: #f6dfa0;
  --ink:         #f2ede2;   /* cream body text */
  --muted:       #a79e8d;
  --bg:          #0c0b09;   /* page background */
  --card:        #161310;   /* elevated surface (cards, tables) */
  --card-2:      #1d1915;   /* inset surface (tiles, table headers, bars) */
  --border:      rgba(232, 196, 106, 0.16);
  --border-soft: rgba(255, 255, 255, 0.07);
  --row-same:    #12100c;   /* dimmed identical compare rows */
  --serif: Georgia, "Playfair Display", "Times New Roman", serif;
}

* { box-sizing: border-box; }

/* --- Base ---------------------------------------------------------------- */
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  /* A quiet golden glow rising from the top — depth without a loud banner. */
  background: radial-gradient(1100px 500px at 50% -180px, #191510 0%, rgba(25, 21, 16, 0) 70%) var(--bg);
  line-height: 1.6;
}

/* Serif display headings give the beauty-editorial feel; body stays sans. */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: 0.01em; }
h1 { font-size: 34px; margin: 0 0 8px; color: var(--gold-bright); }
h2 { font-size: 22px; margin: 0 0 14px; }
h2::after { content: ""; display: block; width: 56px; height: 1px; margin-top: 8px;
            background: linear-gradient(90deg, var(--accent), transparent); }
a { color: var(--accent); }
a:hover { color: var(--gold-bright); }
::selection { background: var(--accent); color: #14110b; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.block { margin: 36px 0; }
.muted { color: var(--muted); }

/* --- Header -------------------------------------------------------------- */
/* Pure black so the gold-script logo PNG (own black background) melts in.  */
.site-header {
  background: #050403;
  color: var(--ink);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 44px; width: auto; display: block; }
/* Home masthead variant — big, centered (see .brand-row below). */
.logo-big img { height: 120px; width: auto; display: block; }
.main-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.main-nav a { color: #cfc7b8; text-decoration: none; font-size: 13px;
              text-transform: uppercase; letter-spacing: 0.08em; }
.main-nav a:hover { color: var(--gold-bright); }
.search-form { flex: 1; display: flex; gap: 6px; min-width: 200px; }
.search-form input[type="search"],
.search-form input[type="text"] {
  flex: 1; padding: 9px 12px; border: 1px solid var(--border-soft); border-radius: 4px;
  background: #0f0d0a; color: var(--ink);
}
.search-form input::placeholder { color: #6f695d; }
.search-form input:focus { border-color: var(--accent); outline: none; }
.search-form input[type="submit"],
.search-form button {
  background: linear-gradient(180deg, var(--gold-bright), var(--accent));
  color: #171208; border: 0; padding: 9px 16px; border-radius: 4px; cursor: pointer;
  font-weight: 600; letter-spacing: 0.02em;
}
.search-form input[type="submit"]:hover,
.search-form button:hover { filter: brightness(1.06); }
.search-form.big { max-width: 560px; margin: 16px 0; }
/* Compare pill — count badge only (no "/max"); lights up gold when ready. */
.compare-link {
  color: var(--ink); text-decoration: none; font-size: 14px; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px 6px 16px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.compare-link:hover { border-color: var(--accent); color: var(--gold-bright); }
.compare-count-badge {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card-2); color: var(--gold-bright); font-size: 12px; font-weight: 700;
}
/* Non-empty basket -> gold fill + soft pulse: "ready to view". */
.compare-link.has-items {
  background: linear-gradient(180deg, var(--gold-bright), var(--accent));
  border-color: var(--accent); color: #171208; font-weight: 600;
  animation: compare-glow 2.2s ease-in-out infinite;
}
.compare-link.has-items .compare-count-badge { background: rgba(23, 18, 8, .18); color: #171208; }
.compare-link.has-items:hover { color: #171208; filter: brightness(1.05); }
@keyframes compare-glow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(232, 196, 106, .18); }
  50%      { box-shadow: 0 0 0 8px rgba(232, 196, 106, .07); }
}

/* Hero */
.hero { padding: 48px 0 10px; text-align: center; }
.hero h1 { font-size: 44px; margin: 0 0 8px; }
.hero h1::after { content: ""; display: block; width: 120px; height: 1px; margin: 14px auto 0;
                  background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.tagline { color: var(--muted); font-size: 17px; margin: 0 auto; max-width: 640px; }

/* Cards */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.product-card {
  background: var(--card); border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.product-card:hover { border-color: var(--border); transform: translateY(-2px);
                      box-shadow: 0 10px 24px rgba(0, 0, 0, .45); }
.card-link { text-decoration: none; color: inherit; display: block; }
/* Warm paper tile: catalogue product shots ship on white — framed, not slapped on dark. */
.card-image {
  height: 150px; display: flex; align-items: center; justify-content: center;
  background: #f4f0e7; border-radius: 6px; overflow: hidden;
}
.card-image img { max-width: 100%; max-height: 150px; object-fit: contain; }
.no-image { color: var(--accent); font-family: var(--serif); font-size: 15px; letter-spacing: .06em; }
.card-name { margin: 8px 0 2px; font-size: 15px; color: var(--ink); }
.card-brand { margin: 0; color: var(--muted); font-size: 13px; }
.card-price { margin: 0; font-weight: 600; color: var(--gold-bright); }
.card-cats { margin: 0; color: var(--muted); font-size: 12px; }
.badge-added {
  color: var(--gold-bright); background: rgba(232, 196, 106, .12);
  border: 1px solid var(--border); font-size: 12px; padding: 4px 10px;
  border-radius: 999px; display: inline-block; text-align: center;
}
/* The badge doubles as an in-place REMOVE control once the product is in the
   compare basket (button_to renders it as a button inside a small form). */
.badge-added-form { display: inline-block; margin: 0; }
button.badge-added { cursor: pointer; font-family: inherit; }
button.badge-added:hover { color: #f0a493; border-color: #7a3a2e; background: rgba(185, 28, 28, .14); }

/* Buttons */
.btn {
  display: inline-block; background: linear-gradient(180deg, var(--gold-bright), var(--accent));
  color: #171208; border: 0; padding: 9px 16px; border-radius: 4px; font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer; letter-spacing: .02em;
}
.btn:hover { filter: brightness(1.07); color: #171208; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-ghost:hover { background: rgba(232, 196, 106, .1); }
.btn-danger { background: transparent; color: #e2836f; border: 1px solid #7a3a2e; }
.btn-danger:hover { background: rgba(185, 28, 28, .15); color: #f0a493; }

/* Category grid (home) */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.category-card { background: var(--card); border: 1px solid var(--border-soft); border-radius: 10px; padding: 14px 18px; }
.category-card h3 { margin: 0 0 8px; font-size: 17px; }
.category-card h3 a { color: var(--gold-bright); text-decoration: none; }
.category-card h3 a:hover { color: var(--accent); }
.category-children { margin: 0; padding-left: 18px; }
.category-children li { margin: 3px 0; }
.category-children a { color: var(--muted); text-decoration: none; }
.category-children a:hover { color: var(--gold-bright); }

/* Category browse layout */
.category-page { display: grid; grid-template-columns: 250px 1fr; gap: 26px; align-items: start; margin-top: 24px; }
@media (max-width: 760px) { .category-page { grid-template-columns: 1fr; } }
.filter-sidebar { background: var(--card); border: 1px solid var(--border-soft); border-radius: 10px; padding: 16px; }
.filter-form h3 { margin: 0 0 10px; font-size: 16px; }
.facet { border: 0; padding: 0 0 12px; margin: 0 0 12px; border-bottom: 1px solid var(--border-soft); }
.facet legend { font-weight: 600; font-size: 12px; margin-bottom: 6px; color: var(--muted);
                text-transform: uppercase; letter-spacing: .08em; }
.facet-option { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 2px 0; color: #d8d1c2; }
input[type="checkbox"] { accent-color: var(--accent); }
.price-fields { display: flex; gap: 8px; flex-direction: column; font-size: 13px; }
.price-fields input {
  width: 100%; padding: 6px 8px; background: #0f0d0a; color: var(--ink);
  border: 1px solid var(--border-soft); border-radius: 4px;
}
.filter-actions { display: flex; gap: 8px; }
.chip {
  display: inline-block; background: rgba(232, 196, 106, .1); color: var(--gold-bright);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 13px;
  text-decoration: none; margin: 0 6px 6px 0;
}
.chip:hover { background: rgba(232, 196, 106, .18); }
.subcats { margin: 4px 0 10px; }
.result-count { color: var(--muted); font-size: 13px; }
.empty-state { color: var(--muted); font-style: italic; padding: 12px 0; }

/* Product detail */
.product-detail { margin-top: 24px; }
.product-head { display: grid; grid-template-columns: 300px 1fr; gap: 28px; }
@media (max-width: 700px) { .product-head { grid-template-columns: 1fr; } }
.product-image { background: #f4f0e7; border: 1px solid var(--border-soft); border-radius: 10px; padding: 14px; }
.product-image img { width: 100%; max-height: 300px; object-fit: contain; }
.product-head-info h1 { margin: 6px 0 4px; }
.product-head-info .brand { color: var(--muted); margin: 0; letter-spacing: .04em;
                            text-transform: uppercase; font-size: 13px; }
.product-head-info .price { font-size: 24px; font-weight: 700; margin: 10px 0; color: var(--gold-bright); }
.product-head-info .rating { color: var(--accent); }
.breadcrumbs { color: var(--muted); font-size: 13px; }
.compare-actions { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
.description { margin-top: 22px; color: #d8d1c2; max-width: 70ch; }
.specs-table, .compare-matrix table { width: 100%; border-collapse: collapse; background: var(--card); }
.specs-table { border: 1px solid var(--border-soft); border-radius: 8px; overflow: hidden; margin-top: 22px; }
.specs-table th { text-align: left; background: var(--card-2); width: 180px; color: var(--muted);
                  font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.specs-table th, .specs-table td { border-bottom: 1px solid var(--border-soft); padding: 9px 12px; font-size: 14px; }

/* Reviews */
.review { background: var(--card); border: 1px solid var(--border-soft); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.review-head { display: flex; justify-content: space-between; align-items: center; }
.review-title { font-weight: 600; color: var(--gold-bright); font-size: 16px; }
.review-author { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.review-rating { color: var(--accent); }
.review-preview-content { color: var(--ink); font-size: 14px; line-height: 1.5; margin: 10px 0; }
.review-preview-cta { margin-top: 12px; }
.review-preview-cta .btn { font-size: 13px; padding: 6px 14px; }
.review-thumb { margin: 10px 0; }
.review-thumb img { max-width: 100%; height: auto; border-radius: 6px; }
.sub-score-preview { margin-top: 8px; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.review-card { background: var(--card); border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.review-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.review-card-img { width: 100%; height: 140px; object-fit: cover; background: var(--card-2); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--muted); }
.review-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.review-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.review-card-author { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.review-card-title { font-weight: 600; color: var(--gold-bright); font-size: 15px; }
.review-card-rating { color: var(--accent); font-size: 14px; }
.review-card-highlight { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.review-card-excerpt { font-size: 13px; color: var(--ink); line-height: 1.4; flex: 1; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.review-card-link { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; align-self: flex-start; }
.review-card-link:hover { color: var(--gold-bright); }
.review-detail { max-width: 800px; margin: 0 auto; }
.review-detail .review-head { margin-bottom: 20px; }
.review-detail .review-meta { display: flex; gap: 12px; align-items: center; }
.review-detail .review-published { color: var(--muted); font-size: 13px; }
.review-detail .sub-scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 18px; margin: 16px 0; }
.review-detail .sub-score { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.review-detail .sub-score-bar { flex: 1; height: 8px; background: var(--card-2); border-radius: 4px; overflow: hidden; }
.review-detail .sub-score-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold-bright)); }
.review-detail .sub-score-value { width: 40px; text-align: right; }
.review-detail .review-content { color: var(--ink); line-height: 1.6; margin: 16px 0; }
.review-detail .review-image { margin: 12px 0; }
.review-detail .review-image img { max-width: 100%; height: auto; border-radius: 8px; }
.review-related-products { margin-top: 32px; }
.empty-state { color: var(--muted); font-size: 14px; }

/* Compare */
.compare-controls { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #d8d1c2; }
.compare-matrix { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 10px; }
.compare-matrix table { width: auto; min-width: 100%; }
.compare-matrix th, .compare-matrix td { padding: 9px 12px; font-size: 14px; border-bottom: 1px solid var(--border-soft); }
.compare-matrix .spec-label-col { text-align: left; background: var(--card-2); }
.compare-matrix th.product-col, .compare-matrix td.product-col { text-align: center; min-width: 170px; }
.compare-matrix th.product-col { border-bottom: 2px solid var(--accent); }
.compare-matrix th.product-col a { color: var(--gold-bright); text-decoration: none; }
  .compare-matrix .empty { border: 0; }
  /* Product thumbnail in the matrix header (the image lives in the header <th>,
     not as a body row). Matches the card-image placeholder palette. */
  .compare-matrix th.product-col .matrix-thumb {
    width: 100%; max-width: 110px; height: 110px; object-fit: contain;
    margin: 0 auto 6px; display: block; border-radius: 8px;
    background: #f4f0e7; border: 1px solid var(--border-soft);
  }
  .compare-matrix th.product-col .matrix-thumb-placeholder {
    display: flex; align-items: center; justify-content: center;
    color: var(--accent); font-family: var(--serif); font-size: 15px;
    letter-spacing: .06em;
  }
/* Per-product removal (matrix header) — explicit pill so it's discoverable. */
.remove-form { margin: 6px 0 0; }
.remove-btn {
  background: transparent; border: 1px solid var(--border-soft); border-radius: 999px;
  color: var(--muted); cursor: pointer; font-size: 12px; padding: 3px 11px;
  font-family: inherit; transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.remove-btn:hover { color: #f0a493; border-color: #7a3a2e; background: rgba(185, 28, 28, .12); }
/* JS contract: highlight_differences.js sets hidden on .row-same rows —
   these rules only style them, never change display. */
.row-same td, .row-same th { background: var(--row-same); color: var(--muted); font-weight: 400; }
.row-diff td { font-weight: 600; color: var(--gold-bright); }

/* Flash */
.flash { padding: 10px 16px; margin: 10px auto; max-width: 1100px; border-radius: 6px; font-size: 14px; }
.flash.notice { background: rgba(232, 196, 106, .12); color: var(--gold-bright); border: 1px solid var(--border); }
.flash.alert { background: rgba(185, 28, 28, .16); color: #f0a493; border: 1px solid #7a3a2e; }

/* Footer & ads */
.site-footer {
  margin-top: 56px; border-top: 1px solid var(--border-soft); padding: 24px 0 34px;
  text-align: center; color: var(--muted); font-size: 13px;
}
.ad-slot {
  min-height: 90px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: 8px; margin: 18px 0; color: var(--muted); font-size: 13px;
}

/* --- Home masthead, below-header search, collapsible categories ----------- */
/* Home: big centered logo over a slim nav strip (search lives below). */
.site-header.masthead { padding: 0 0 0; }
.brand-row { display: flex; justify-content: center; padding: 22px 0 14px; }
.nav-row {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  border-top: 1px solid var(--border-soft); padding: 10px 16px;
}
.nav-row .main-nav { flex: 1; }
/* Home: centered search bar between header and main content. */
.home-search { display: flex; justify-content: center; margin-top: 28px; }
.home-search .search-form.big { margin: 0; width: 100%; }

/* Collapsible category cards (native <details> — no JS). */
details.category-card { padding: 0; overflow: hidden; }
details.category-card summary {
  list-style: none; cursor: pointer; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--gold-bright);
}
details.category-card summary::-webkit-details-marker { display: none; }
details.category-card summary .cat-count {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--card-2); border: 1px solid var(--border-soft);
  border-radius: 999px; padding: 2px 9px; margin-left: auto; margin-right: 12px;
}
details.category-card summary::after { content: "▸"; color: var(--muted); transition: transform .18s ease; }
details.category-card[open] summary { border-bottom: 1px solid var(--border-soft); }
details.category-card[open] summary::after { transform: rotate(90deg); color: var(--accent); }
details.category-card .category-children { padding: 10px 18px 14px; margin: 0; }
details.category-card .category-children a { font-size: 14px; }

/* Home intro line — sits directly below the search bar. */
.home-intro { max-width: 620px; margin: 20px auto 0; text-align: center;
              color: var(--muted); font-family: var(--serif); font-style: italic;
              font-size: 16px; line-height: 1.7; }
/* Semantics without visuals (home h1 lives here while the masthead shows the logo). */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  font-size: 13px;
}

/* Price preset buttons */
.price-preset-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.price-preset {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.15s ease;
}
.price-preset:hover {
  border-color: var(--accent);
  color: var(--gold-bright);
}
.price-preset.active {
  background: var(--accent);
  color: #14110b;
  border-color: var(--accent);
  font-weight: 600;
}
.price-custom {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.price-custom label {
  font-size: 12px;
  color: var(--muted);
}
.price-custom input[type="number"] {
  width: 70px;
  padding: 5px 6px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink);
  font-size: 13px;
}