/* ============================================================================
   Le Glam India — application stylesheet

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

     :root            -> design tokens (colors). Change the palette here.
     Header / nav     -> .site-header, .main-nav, .search-form, .compare-link
     Cards & grids    -> .product-grid, .product-card (home/browse/search)
     Category browse  -> .category-page (sidebar + results columns)
     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
   ========================================================================== */

:root {
  /* Design tokens — brand pink on a warm neutral background. */
  --accent: #d6336c;
  --accent-dark: #a81e4e;
  --ink: #222;
  --muted: #6b7280;
  --bg: #faf7f5;
  --card: #ffffff;
  --border: #ece5e0;
  --row-same: #f3f0ec;   /* subtle shade for identical compare rows */
}

* { box-sizing: border-box; }

/* --- Base ---------------------------------------------------------------- */
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

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

/* --- Header -------------------------------------------------------------- */
.site-header {
  background: var(--ink);
  color: #fff;
  padding: 14px 0;
}
.header-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo { color: #fff; text-decoration: none; font-weight: 700; font-size: 22px; }
.logo em { color: var(--accent); font-style: normal; }
.main-nav { display: flex; gap: 14px; flex-wrap: wrap; }
.main-nav a { color: #e5e7eb; text-decoration: none; font-size: 14px; }
.main-nav a:hover { color: #fff; text-decoration: underline; }
.search-form { flex: 1; display: flex; gap: 6px; min-width: 200px; }
.search-form input[type="search"],
.search-form input[type="text"] { flex: 1; padding: 8px 10px; border: 0; border-radius: 4px; }
.search-form input[type="submit"] { background: var(--accent); color: #fff; border: 0; padding: 8px 14px; border-radius: 4px; cursor: pointer; }
.search-form.big { max-width: 560px; margin: 16px 0; }
.compare-link { color: #fff; text-decoration: none; font-size: 14px; white-space: nowrap; }
.compare-link:hover { color: #f9a8c9; }

/* Hero */
.hero { padding: 40px 0 12px; }
.hero h1 { font-size: 38px; margin: 0 0 6px; }
.tagline { color: var(--muted); font-size: 18px; margin: 0; }

/* 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); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.card-link { text-decoration: none; color: inherit; display: block; }
.card-image { height: 140px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 6px; overflow: hidden; }
.card-image img { max-width: 100%; max-height: 140px; object-fit: contain; }
.no-image { color: var(--muted); font-size: 13px; text-align: center; }
.card-name { margin: 6px 0 2px; font-size: 15px; }
.card-brand { margin: 0; color: var(--muted); font-size: 13px; }
.card-price { margin: 0; font-weight: 600; }
.card-cats { margin: 0; color: var(--muted); font-size: 12px; }
.badge-added { color: #166534; background: #dcfce7; font-size: 12px; padding: 4px 8px; border-radius: 999px; display: inline-block; text-align: center; }

/* Buttons */
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; padding: 8px 14px; border-radius: 4px; font-size: 14px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-dark); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-ghost:hover { background: #fce7ef; }
.btn-danger { background: #b91c1c; }
.btn-danger:hover { background: #991b1b; }

/* Category grid */
.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); border-radius: 8px; padding: 14px 18px; }
.category-card h3 { margin: 0 0 8px; }
.category-card h3 a { color: var(--ink); 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(--accent); }
/* 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); border-radius: 8px; padding: 14px; }
.filter-form h3 { margin: 0 0 10px; }
.facet { border: 0; padding: 0 0 12px; margin: 0 0 12px; border-bottom: 1px solid var(--border); }
.facet legend { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.facet-option { display: flex; gap: 6px; align-items: center; font-size: 13px; padding: 2px 0; }
.price-fields { display: flex; gap: 8px; flex-direction: column; font-size: 13px; }
.price-fields input { width: 100%; padding: 5px 8px; }
.filter-actions { display: flex; gap: 8px; }
.chip { display: inline-block; background: #fde3ee; color: var(--accent-dark); border-radius: 999px; padding: 4px 12px; font-size: 13px; text-decoration: none; margin: 0 6px 6px 0; }
.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: 24px; }
@media (max-width: 700px) { .product-head { grid-template-columns: 1fr; } }
.product-image { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.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; }
.product-head-info .price { font-size: 22px; font-weight: 700; margin: 8px 0; }
.product-head-info .rating { color: #b45309; }
.breadcrumbs { color: var(--muted); font-size: 13px; }
.compare-actions { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.description { margin-top: 20px; }
.specs-table, .compare-matrix table { width: 100%; border-collapse: collapse; background: #fff; }
.specs-table th { text-align: left; background: var(--row-same); width: 180px; }
.specs-table th, .specs-table td { border: 1px solid var(--border); padding: 8px 10px; font-size: 14px; }

/* Reviews */
.review { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.review-head { display: flex; justify-content: space-between; }
.review-author { font-weight: 600; }
.review-rating { color: #b45309; }
.sub-scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 18px; margin-top: 10px; }
.sub-score { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sub-score-label { min-width: 70px; }
.sub-score-bar { flex: 1; background: var(--row-same); height: 8px; border-radius: 999px; overflow: hidden; }
.sub-score-fill { display: block; background: var(--accent); height: 100%; }
.sub-score-value { width: 34px; text-align: right; }

/* Compare */
.compare-controls { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.compare-matrix { overflow-x: auto; }
.compare-matrix table { width: auto; min-width: 100%; }
.compare-matrix .spec-label-col { text-align: left; background: var(--row-same); }
.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 .empty { border: 0; }
.remove-btn { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; }
.remove-btn:hover { color: #b91c1c; }
.row-same td, .row-same th { background: #faf7f5; color: var(--muted); }
.row-diff td { font-weight: 600; }

/* Flash */
.flash { padding: 10px 16px; margin: 10px auto; max-width: 1100px; border-radius: 6px; font-size: 14px; }
.flash.notice { background: #dcfce7; color: #166534; }
.flash.alert { background: #fee2e2; color: #991b1b; }

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