/* ==========================================================================
   Venila Crackers - design tokens & signature motif
   Palette: Diwali night sky, not the generic cream/terracotta AI palette.
   -------------------------------------------------------------------------
   --vc-night      #170B2E   deep indigo night sky (page background)
   --vc-night-2    #2A1650   lifted panel / card surface on dark sections
   --vc-marigold   #F5A524   marigold gold - primary accent, CTAs
   --vc-vermilion  #E2472B   vermilion spark - secondary accent, discounts
   --vc-ivory      #FBF4E4   warm ivory - light section background
   --vc-emerald    #2E9E6B   ember-green spark - success / in-stock
   ========================================================================== */

:root {
  --vc-night: #170b2e;
  --vc-night-2: #2a1650;
  --vc-marigold: #f5a524;
  --vc-vermilion: #e2472b;
  --vc-ivory: #fbf4e4;
  --vc-emerald: #2e9e6b;
  --vc-ink: #1b1330;
}

body {
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  background-color: var(--vc-ivory);
  color: var(--vc-ink);
}

.font-display {
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-optical-sizing: auto;
}

/* ---- Signature element: an animated sparkler trail ----
   A hand-placed arc of "embers" that lights up in sequence beneath the
   hero headline, evoking a sparkler being waved through the air - built
   from the product itself, not a stock gradient blob. */
.sparkler-trail {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  height: 1.5rem;
}

.sparkler-trail .ember {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--vc-marigold);
  box-shadow: 0 0 0 rgba(245, 165, 36, 0);
  opacity: 0.25;
  animation: ember-glow 2.4s ease-in-out infinite;
}

.sparkler-trail .ember:nth-child(1) { animation-delay: 0s; }
.sparkler-trail .ember:nth-child(2) { animation-delay: 0.15s; }
.sparkler-trail .ember:nth-child(3) { animation-delay: 0.3s; }
.sparkler-trail .ember:nth-child(4) { animation-delay: 0.45s; }
.sparkler-trail .ember:nth-child(5) { animation-delay: 0.6s; }
.sparkler-trail .ember:nth-child(6) { animation-delay: 0.75s; }
.sparkler-trail .ember:nth-child(7) { animation-delay: 0.9s; }
.sparkler-trail .ember:nth-child(8) { animation-delay: 1.05s; }

@keyframes ember-glow {
  0%   { opacity: 0.25; box-shadow: 0 0 0 rgba(245, 165, 36, 0); transform: scale(1); }
  15%  { opacity: 1; box-shadow: 0 0 10px 3px rgba(245, 165, 36, 0.65); transform: scale(1.35); }
  40%  { opacity: 0.35; box-shadow: 0 0 0 rgba(245, 165, 36, 0); transform: scale(1); }
  100% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
  .sparkler-trail .ember {
    animation: none;
    opacity: 0.85;
  }
}

.badge-discount {
  background: var(--vc-vermilion);
  color: white;
}

.btn-primary {
  background: var(--vc-marigold);
  color: var(--vc-ink);
}
.btn-primary:hover {
  background: #e0940f;
}

.nav-dark {
  background: var(--vc-night);
}


/* =========================================
   PRODUCTS PAGE
========================================= */

.products-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 100px;
}

.products-header {
    text-align: center;
    margin-bottom: 25px;
}

.products-header h1 {
    margin-bottom: 8px;
}

.products-header p {
    opacity: 0.75;
}

.product-search {
    display: flex;
    max-width: 700px;
    margin: 0 auto 25px;
    gap: 10px;
}

.product-search input {
    flex: 1;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.product-search button {
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 35px;
    justify-content: center;
}

.category-filters a {
    padding: 10px 16px;
    border-radius: 25px;
    text-decoration: none;
    background: #f1f1f1;
}

.category-filters a.active {
    background: #d62828;
    color: white;
}

.product-category-section {
    margin-bottom: 50px;
}

.category-title {
    margin-bottom: 20px;
}

.category-title h2 {
    margin-bottom: 5px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    overflow: hidden;
    transition: 0.2s;
}

.product-card:hover {
    transform: translateY(-3px);
}

.product-image {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 70px;
    background: #fafafa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details {
    padding: 18px;
}

.product-details h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.product-description {
    font-size: 14px;
    min-height: 40px;
    opacity: 0.7;
}

.unit-info {
    font-size: 13px;
    margin: 10px 0;
}

.price-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mrp {
    text-decoration: line-through;
    opacity: 0.55;
}

.discount {
    color: green;
    font-weight: bold;
    font-size: 13px;
}

.selling-price {
    font-size: 22px;
    font-weight: bold;
    margin: 8px 0 15px;
}

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.qty-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    font-size: 22px;
    cursor: pointer;
}

.quantity {
    font-size: 20px;
    font-weight: bold;
    min-width: 25px;
    text-align: center;
}


/* =========================================
   STICKY CART
========================================= */

.cart-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

    padding: 14px 25px;

    display: flex;
    justify-content: center;
    gap: 40px;
    align-items: center;

    background: #222;
    color: white;

    z-index: 999;
}

.cart-summary button {
    background: #d62828;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
}


.no-products {
    text-align: center;
    padding: 60px 20px;
}


/* MOBILE */

@media (max-width: 600px) {

    .product-search {
        flex-direction: column;
    }

    .product-search button {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        gap: 12px;
        padding: 12px;
        font-size: 14px;
    }

    .cart-summary button {
        padding: 9px 12px;
    }

}


/* =========================================
   CART PAGE
========================================= */

.cart-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 100px;
}

.cart-page-header {
    text-align: center;
    margin-bottom: 30px;
}

.cart-page-header h1 {
    margin-bottom: 8px;
}

#cart-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 25px;
    align-items: start;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 20px;
    align-items: center;

    padding: 20px;

    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
}

.cart-item-info h3 {
    margin: 0 0 5px;
}

.cart-item-info p {
    margin: 0;
    opacity: 0.65;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-item-quantity button {
    width: 32px;
    height: 32px;

    border: none;
    border-radius: 50%;

    cursor: pointer;
    font-size: 18px;
}

.cart-item-total {
    font-size: 18px;
    font-weight: bold;
}

.remove-cart-item {
    border: none;
    background: transparent;

    color: #d62828;
    font-size: 20px;

    cursor: pointer;
}

.cart-summary-card {
    background: white;

    border: 1px solid #e5e5e5;
    border-radius: 12px;

    padding: 25px;

    position: sticky;
    top: 20px;
}

.cart-summary-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;

    padding: 12px 0;

    border-bottom: 1px solid #eee;
}

.total-row {
    font-size: 20px;
    border-bottom: none;
}

.checkout-btn {
    width: 100%;

    margin-top: 20px;

    padding: 14px;

    border: none;
    border-radius: 8px;

    background: #d62828;
    color: white;

    font-size: 16px;
    font-weight: bold;

    cursor: pointer;
}

.clear-cart-btn {
    width: 100%;

    margin-top: 10px;

    padding: 10px;

    background: transparent;

    border: 1px solid #ccc;
    border-radius: 8px;

    cursor: pointer;
}

.empty-cart {
    text-align: center;

    padding: 70px 20px;

    background: white;

    border: 1px solid #eee;
    border-radius: 12px;
}

.continue-shopping {
    display: inline-block;

    margin-top: 20px;

    padding: 12px 20px;

    background: #d62828;
    color: white;

    text-decoration: none;
    border-radius: 8px;
}


@media (max-width: 768px) {

    #cart-content {
        grid-template-columns: 1fr;
    }

    .cart-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cart-summary-card {
        position: static;
    }

}

.download-cart-btn {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    background: #1f7a4d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.download-cart-btn:hover {
    opacity: 0.9;
}


/* Checkout */

.checkout-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.checkout-card h2 {
    margin-bottom: 20px;
}

.checkout-card input {
    width: 100%;
    padding: 13px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 15px;
    box-sizing: border-box;
}

.checkout-card input:focus {
    outline: none;
    border-color: #e2472b;
}

#checkout-form {
    max-width: 900px;
    margin: auto;
}

.checkout-btn {
    display: inline-block;
    width: 100%;
    border: none;
    cursor: pointer;
    text-align: center;
}
