/* =========================================================
   Gisarg Caskets — Warm & Welcoming Theme
   Palette: warm ivory, deep charcoal, muted gold, soft sage
   ========================================================= */

   :root {
    --ivory:      #faf6ee;
    --ivory-2:    #f2ead9;
    --cream:      #ffffff;
    --charcoal:   #2a2523;
    --charcoal-2: #3d3733;
    --gold:       #b8912f;
    --gold-soft:  #d4af5a;
    --gold-light: #f0dda3;
    --sage:       #7e8e7d;
    --muted:      #6b625d;
    --line:       #e6dccb;
    --rose:       #b8736a;
    --shadow-sm:  0 1px 3px rgba(42,37,35,.06), 0 1px 2px rgba(42,37,35,.04);
    --shadow-md:  0 8px 24px rgba(42,37,35,.08);
    --shadow-lg:  0 20px 48px rgba(42,37,35,.12);
    --radius:     14px;
    --radius-sm:  8px;
    --font-serif: "Cormorant Garamond", Georgia, serif;
    --font-sans:  "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  }
  
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--charcoal);
    background: var(--ivory);
    -webkit-font-smoothing: antialiased;
  }
  
  img { max-width: 100%; height: auto; display: block; }
  a { color: var(--gold); text-decoration: none; transition: color .2s; }
  a:hover { color: var(--gold-soft); }
  
  h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--charcoal);
    line-height: 1.2;
    margin: 0 0 .5em;
    letter-spacing: .2px;
  }
  h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
  h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
  h3 { font-size: 1.35rem; }
  
  .container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
  .skip-link { position:absolute; left:-9999px; }
  .skip-link:focus { left:12px; top:12px; background:#fff; padding:8px 12px; z-index:999; }
  .muted { color: var(--muted); }
  
  /* ---------------- Topbar ---------------- */
  .topbar {
    background: var(--charcoal);
    color: var(--ivory-2);
    font-size: 13px;
  }
  .topbar__inner {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; padding: 8px 22px; flex-wrap: wrap;
  }
  .topbar a { color: var(--gold-light); }
  .topbar .dot { color: var(--gold); margin: 0 8px; }
  
  /* ---------------- Header ---------------- */
  .site-header { background: var(--cream); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm); }
  .header__inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; gap: 16px; }
  
  .brand { display: flex; align-items: center; gap: 12px; color: var(--charcoal); }
  .brand__mark {
    display: grid; place-items: center;
    width: 46px; height: 46px; border-radius: 12px;
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    color: var(--charcoal); font-family: var(--font-serif); font-weight: 700; font-size: 26px;
    box-shadow: var(--shadow-sm);
  }
  .brand__text { display: flex; flex-direction: column; line-height: 1.1; }
  .brand__text strong { font-family: var(--font-serif); font-size: 20px; letter-spacing: 2px; }
  .brand__text small { font-size: 11px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
  
  .site-nav { display: flex; align-items: center; gap: 26px; }
  .site-nav a { color: var(--charcoal-2); font-size: 15px; font-weight: 500; position: relative; }
  .site-nav a:hover, .site-nav a.active { color: var(--gold); }
  .site-nav a.active::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
    height: 2px; background: var(--gold); border-radius: 2px;
  }
  .nav-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--charcoal); cursor: pointer; }
  
  /* ---------------- Buttons ---------------- */
  .btn {
    display: inline-block; padding: 12px 24px; border-radius: 50px;
    font-weight: 500; font-size: 15px; cursor: pointer; border: none;
    transition: transform .15s, box-shadow .2s, background .2s;
    text-align: center;
  }
  .btn--gold { background: linear-gradient(135deg, var(--gold), var(--gold-soft)); color: var(--charcoal); box-shadow: var(--shadow-sm); }
  .btn--gold:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); color: var(--charcoal); }
  .btn--dark { background: var(--charcoal); color: var(--ivory); }
  .btn--dark:hover { background: var(--charcoal-2); color: var(--ivory); }
  .btn--ghost { background: transparent; border: 1.5px solid var(--charcoal); color: var(--charcoal); }
  .btn--ghost:hover { background: var(--charcoal); color: var(--ivory); }
  .btn--sm { padding: 8px 18px; font-size: 14px; }
  
  /* ---------------- Flash ---------------- */
  .flash-stack { position: fixed; top: 90px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
  .flash { padding: 12px 18px; border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow-md); font-size: 14px; max-width: 340px; }
  .flash--success { border-left: 4px solid #4a8b5e; }
  .flash--error   { border-left: 4px solid var(--rose); }
  .flash--info    { border-left: 4px solid var(--gold); }
  .flash--warning { border-left: 4px solid #c98b2b; }
  
  /* ---------------- Footer ---------------- */
  .site-footer { background: var(--charcoal); color: var(--ivory-2); margin-top: 80px; }
  .footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1.2fr; gap: 40px; padding: 60px 22px 40px; }
  .footer__col h4 { color: var(--gold-light); font-family: var(--font-sans); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px; }
  .footer__col ul { list-style: none; padding: 0; margin: 0; }
  .footer__col li { margin-bottom: 8px; }
  .footer__col a { color: var(--ivory-2); font-size: 15px; }
  .footer__col a:hover { color: var(--gold-light); }
  .footer__col address { font-style: normal; font-size: 15px; }
  .footer__brand .brand__text strong { color: var(--ivory); }
  .footer__brand .brand__text small { color: var(--gold-soft); }
  .footer__parent { margin-top: 14px; font-size: 13px; color: #a89c92; }
  .footer__bottom { border-top: 1px solid #46403b; }
  .footer__bottom-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 18px 22px; font-size: 13px; color: #a89c92; }
  
  /* ---------------- Sections / Cards (shared) ---------------- */
  .section { padding: 72px 0; }
  .section--alt { background: var(--ivory-2); }
  .section__head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
  .section__head p { color: var(--muted); font-size: 17px; }
  
  .grid { display: grid; gap: 28px; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  
  .card {
    background: var(--cream); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .25s;
    border: 1px solid var(--line);
  }
  .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
  .card__img { aspect-ratio: 4/3; background: var(--ivory-2); object-fit: cover; width: 100%; }
  .card__body { padding: 22px; }
  .card__body h3 { margin-bottom: 6px; }
  .card__body .price { color: var(--gold); font-weight: 600; font-size: 16px; margin-top: 10px; }
  
  /* ---------------- Hero ---------------- */
  .hero {
    position: relative;
    background: linear-gradient(135deg, var(--charcoal) 0%, #4a423d 100%);
    color: var(--ivory);
    padding: 100px 0 120px;
    overflow: hidden;
  }
  .hero::before {
    content: ''; position: absolute; inset: 0;
    background:
      radial-gradient(circle at 15% 20%, rgba(184,145,47,.25), transparent 45%),
      radial-gradient(circle at 85% 80%, rgba(212,175,90,.18), transparent 50%);
    pointer-events: none;
  }
  .hero__inner { position: relative; max-width: 720px; }
  .hero h1 { color: var(--ivory); margin-bottom: 20px; }
  .hero h1 em { font-style: italic; color: var(--gold-light); }
  .hero p { font-size: 19px; color: #ddd3c6; margin-bottom: 32px; max-width: 560px; }
  .hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
  
  /* ---------------- Responsive ---------------- */
  @media (max-width: 900px) {
    .footer__grid { grid-template-columns: 1fr 1fr; }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 720px) {
    .topbar__inner { justify-content: center; text-align: center; font-size: 12px; }
    .nav-toggle { display: block; }
    .site-nav {
      display: none; position: absolute; top: 100%; left: 0; right: 0;
      background: var(--cream); flex-direction: column; padding: 20px 22px; gap: 16px;
      box-shadow: var(--shadow-md); border-top: 1px solid var(--line);
    }
    .site-nav.open { display: flex; }
    .grid--3, .grid--4, .grid--2, .footer__grid { grid-template-columns: 1fr; }
    .hero { padding: 70px 0 90px; }
    .section { padding: 56px 0; }
  }

  /* ---------------- Homepage Slider ---------------- */
.hero-slider {
  position: relative;
  height: 80vh;
  min-height: 600px;
  overflow: hidden;
  background: var(--charcoal);
}

/* THE FIX: Force all slides to sit exactly on top of each other, hidden by default */
.slide {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  visibility: hidden; /* Ensures it doesn't block clicks */
  transition: opacity 0.8s ease-in-out, visibility 0.8s;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

/* Only the active slide is visible */
.slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

/* THE FIX: A dark gradient overlay so the white text pops beautifully */
.slide::before {
  content: ''; 
  position: absolute; 
  top: 0; left: 0; right: 0; bottom: 0;
  /* Darkens the left side heavily for text, fades to the right */
  background: linear-gradient(90deg, rgba(20, 18, 16, 0.95) 0%, rgba(20, 18, 16, 0.7) 45%, rgba(20, 18, 16, 0.2) 100%);
  z-index: -1;
}

.slide__content {
  position: absolute; 
  top: 50%; 
  left: 5%; /* Keep it away from the very edge */
  right: 5%;
  transform: translateY(-50%); 
  color: var(--ivory);
  max-width: 650px; 
  z-index: 10;
}

.slide__content h1 { 
  color: var(--ivory); 
  font-size: clamp(2.5rem, 5vw, 4rem); 
  margin-bottom: 20px; 
  line-height: 1.1;
}
.slide__content h1 em { 
  font-style: italic; 
  color: var(--gold-light); 
}
.slide__content p { 
  font-size: 18px; 
  color: #e0d8cc; 
  margin-bottom: 30px; 
}

.slider-nav {
  position: absolute; 
  bottom: 40px; 
  left: 5%; /* Aligned with text */
  display: flex; 
  gap: 12px; 
  z-index: 10;
}

.slider-dot {
  width: 12px; 
  height: 12px; 
  border-radius: 50%;
  background: rgba(255,255,255,.4); 
  border: 2px solid transparent;
  cursor: pointer; 
  transition: all .3s;
}
.slider-dot.active { 
  background: var(--gold); 
  transform: scale(1.2); 
}

/* ---------------- Products Page ---------------- */
.products-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
}
.sidebar {
  background: var(--cream);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  position: sticky;
  top: 100px;
}
.sidebar h3 {
  font-size: 18px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.filter-list { list-style: none; padding: 0; margin: 0; }
.filter-list li { margin-bottom: 8px; }
.filter-list a {
  display: block; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--charcoal-2); font-size: 15px; transition: all .2s;
}
.filter-list a:hover, .filter-list a.active {
  background: var(--ivory-2); color: var(--gold); font-weight: 500;
}

/* ---------------- Product Detail ---------------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  margin-top: 40px;
}
.product-gallery { position: sticky; top: 100px; }
.product-main-img {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-md);
  border: 1px solid var(--line); object-fit: cover; aspect-ratio: 4/3;
}
.product-info h1 { font-size: 2.5rem; margin-bottom: 10px; }
.product-price { font-size: 1.8rem; color: var(--gold); font-weight: 600; font-family: var(--font-serif); margin: 20px 0; }
.product-desc { font-size: 16px; color: var(--charcoal-2); line-height: 1.8; margin-bottom: 30px; }

/* ---------------- Custom Builder ---------------- */
.builder-container {
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-top: 40px;
}
.builder-steps {
  display: flex; background: var(--ivory-2); border-bottom: 1px solid var(--line);
}
.step-tab {
  flex: 1; padding: 18px; text-align: center; font-weight: 500;
  color: var(--muted); border-bottom: 3px solid transparent;
}
.step-tab.active { color: var(--gold); border-bottom-color: var(--gold); background: var(--cream); }
.builder-body { padding: 40px; }
.builder-step { display: none; }
.builder-step.active { display: block; animation: fadeIn .4s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.option-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 30px;
}
.option-card {
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; cursor: pointer; transition: all .2s; position: relative;
}
.option-card:hover { border-color: var(--gold-soft); }
.option-card.selected { border-color: var(--gold); background: var(--ivory); box-shadow: var(--shadow-sm); }
.option-card.selected::after {
  content: '✓'; position: absolute; top: 10px; right: 14px; color: var(--gold); font-weight: bold; font-size: 18px;
}
.option-card input[type="radio"] { position: absolute; opacity: 0; }
.option-title { font-weight: 600; display: block; margin-bottom: 4px; }
.option-price { font-size: 13px; color: var(--muted); }

.builder-footer {
  padding: 20px 40px; background: var(--ivory-2); border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.live-total { font-size: 1.4rem; font-family: var(--font-serif); font-weight: 600; color: var(--charcoal); }
.live-total span { color: var(--gold); }

@media (max-width: 900px) {
  .products-layout { grid-template-columns: 1fr; }
  .product-detail { grid-template-columns: 1fr; gap: 30px; }
  .product-gallery { position: relative; top: 0; }
  .builder-steps { flex-direction: column; }
  .builder-body { padding: 20px; }
}

/* ---------------- Product Gallery ---------------- */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.gallery-main {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ivory-2);
  aspect-ratio: 4/3;
  position: relative;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.thumb:hover {
  opacity: 1;
  border-color: var(--gold-soft);
}

.thumb.active {
  border-color: var(--gold);
  opacity: 1;
  box-shadow: var(--shadow-sm);
}

/* Protect images from basic right-click saving without breaking clicks */
img {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
}

/* Optional: To stop right-click ONLY on images, add this */
img {
  pointer-events: auto; /* Ensure images are clickable */
}