/* ==================== Base Styles & Variables ==================== */
:root {
  --primary-red: #e12c36; /* Your brand red */
  --secondary-dark: #333;
  --text-color: #555;
  --light-bg: #f8f8f8;
  --white: #fff;
  --border-color: #eee;
  --transition-speed: 0.3s ease;
  --max-width: 1200px;
  --primary-red-rgb: 225, 44, 54;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-bg);
}

/* Prevents scrolling when mobile nav is open */
body.no-scroll {
  overflow: hidden;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem; /* Padding for mobile screens */
}

a {
  color: var(--primary-red);
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--secondary-dark);
}

ul {
  list-style: none;
}

/* ==================== Utility Classes ==================== */

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--transition-speed),
    color var(--transition-speed);
  border: none;
}

.btn-primary {
  background-color: var(--primary-red);
  color: var(--white);
}

.btn-primary:hover {
  background-color: #b8232c; /* Darker red on hover */
  color: var(--white);
}

.btn-secondary {
  background-color: var(--secondary-dark);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: #555;
}

.btn-add-to-cart {
  background-color: var(--primary-red);
  color: var(--white);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  width: 100%; /* Full width on product cards */
}

.btn-add-to-cart:hover {
  background-color: #b8232c;
}

/* ==================== Header & Navbar ==================== */
.main-header {
  background-color: var(--white);
  padding: 0.5rem 0 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky; /* Make header sticky */
  top: 0;
  z-index: 1000;
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  flex-shrink: 0;
}

.logo a {
  color: var(--primary-red);
  text-decoration: none;
}

/* Mobile Navigation */
.main-nav {
  display: block; /* Always block for the slide effect */
  position: fixed;
  top: 0;
  left: -100%; /* Off-screen by default */
  width: 75%; /* Slightly wider */
  max-width: 300px; /* Cap max width on larger mobile devices */
  height: 100vh;
  background-color: var(--secondary-dark);
  color: var(--white);
  padding-top: 5rem; /* Space for logo/header if needed */
  transition: left var(--transition-speed);
  z-index: 1050; /* Higher than other content, below overlay */
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.main-nav.active {
  left: 0; /* Slide in */
}

/* Overlay that appears when mobile nav is open */
.main-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040; /* Below nav, above main content */
  display: none; /* Hidden by default */
}

.main-nav-overlay.active {
  /* display: block; Show when nav is active */
}

.nav-links {
  padding: 0;
  margin-top: 1rem; /* Space from top padding */
}

.nav-links li {
  margin-bottom: 0.5rem;
}

/* Mobile Navigation - active link style (no underline animation here) */
.nav-links a {
  display: block;
  padding: 0.8rem 1.5rem;
  color: var(--white);
  font-size: 1.1rem;
  transition: background-color var(--transition-speed);
  white-space: nowrap;
  position: relative; /* Needed for ::after pseudo-element positioning */
}

.nav-links a:hover,
.nav-links a.active {
  background-color: var(--primary-red);
  color: var(--white);
  /* Mobile active state, background color is enough */
}

.nav-icons {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-shrink: 0; /* Prevent icons from shrinking */
}

.nav-icons div {
  font-size: 1.4rem;
  cursor: pointer;
  position: relative;
  color: var(--secondary-dark);
}

.cart-icon a {
  color: black; /* Default color */
  text-decoration: none;
  transition: color 0.3s ease;
}

.cart-icon a:hover {
  color: #EC3237; /* Hover color */
}

.cart-icon i {
  margin-right: 5px; /* optional spacing */
}

.cart-count {
  background-color: var(--primary-red);
  color: var(--white);
  font-size: 0.7rem;
  border-radius: 50%;
  padding: 0.2em 0.4em;
  position: absolute;
  top: -5px;
  right: -10px;
  line-height: 1;
}

.hamburger-menu {
  display: block; /* Always visible on mobile */
  font-size: 1.5rem; /* Make it a bit larger */
  z-index: 1060; /* Higher than nav and overlay so it's always clickable */
  position: relative; /* To ensure z-index works reliably */
}

/* ==================== Hero Carousel ==================== */
 .hero-carousel {
            position: relative;
            width: 100%;
            height: 60vh; /* Default height for larger screens */
            overflow: hidden;
            margin-bottom: 2rem;
        }

        .carousel-inner {
            display: flex;
            width: 100%;
            height: 100%;
            transition: transform 0.5s ease-in-out;
        }

        .carousel-item {
            min-width: 100%;
            height: 100%;
            background-size: cover; /* Default for larger screens */
            background-position: center;
            background-repeat: no-repeat;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--white);
            text-align: center;
            position: relative;
        }

        .carousel-item::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(147, 117, 117, 0.3); /* Subtle overlay for better text readability */
        }

        .carousel-content {
            position: relative;
            z-index: 2;
            padding: 1rem;
            max-width: 80%;
        }

        .carousel-control {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background-color: rgba(0, 0, 0, 0.5);
            color: var(--white);
            border: none;
            padding: 0.8rem 1.2rem;
            font-size: 1.5rem;
            cursor: pointer;
            z-index: 10;
            transition: background-color var(--transition-speed);
        }

        .carousel-control:hover {
            background-color: rgba(0, 0, 0, 0.7);
        }

        .carousel-control.prev {
            left: 10px;
            border-radius: 0 5px 5px 0;
        }

        .carousel-control.next {
            right: 10px;
            border-radius: 5px 0 0 5px;
        }

        /* Mobile responsiveness */
        @media (max-width: 768px) {
            .hero-carousel {
                height: 40vh; /* Reduced height for mobile */
            }
            
            .carousel-item {
                /* background-size: contain; Show full image without cropping */
                background-color: #f0f0f0; /* Background color for letterboxing */
            }
        }

        @media (max-width: 480px) {
            .hero-carousel {
                height: 20vh; /* Even smaller height for very small screens */
            }
            
            .carousel-control {
                padding: 0.5rem 0.8rem;
                font-size: 1.2rem;
            }
              .carousel-item {
                background-size: cover; /* Show full image without cropping */
                background-color: #f0f0f0; /* Background color for letterboxing */
            }
        }




/* ==================== Product Category Sections ==================== */
.content-area {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.product-category {
  margin-bottom: 3rem;
  background-color: var(--white);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.product-category h2 {
  text-align: center;
  color: var(--primary-red);
  margin-bottom: 2rem;
  font-size: 1.6rem;
  position: relative;
}

.product-category h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background-color: var(--primary-red);
  margin: 0.5rem auto 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(180px, 1fr)
  ); /* Responsive grid */
  gap: 1.5rem;
}

.product-card {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition-speed);
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-card img {
  max-width: 100%;
  height: 160px; /* Fixed height for consistent look */
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.8rem;
}

.product-card h3 {
  font-size: 1.2rem;
  color: var(--secondary-dark);
  margin-bottom: 0.5rem;
}

.product-card .product-description {
  font-size: 0.85rem;
  color: var(--text-color);
  height: 3em; /* Limit height to show 2-3 lines */
  overflow: hidden; /* Hide overflow text */
  text-overflow: ellipsis; /* Add ellipsis for hidden text */
  margin-bottom: 0.8rem;
  padding: 0 0.5rem; /* Small horizontal padding */
}

.product-card .price {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--primary-red);
  margin-bottom: 0.8rem;
}

.product-category .view-all {
  text-align: center;
  margin-top: 2.5rem;
}

/* ==================== Footer ==================== */
.main-footer {
  background-color: var(--secondary-dark);
  color: var(--white);
  padding: 3rem 0 1rem;
  font-size: 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: var(--primary-red);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.footer-section ul {
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--white);
  transition: color var(--transition-speed);
}

.footer-section a:hover {
  color: var(--primary-red);
}

.footer-section p {
  margin-bottom: 0.5rem;
}

.footer-section i {
  margin-right: 0.5rem;
}

.social-links a {
  display: inline-block;
  color: var(--white) !important; /* Changed to white */
  font-size: 1.3rem;
  margin-right: 1rem;
  transition: color var(--transition-speed) !important;
}

.social-links a:hover {
  color: var(
    --primary-red
  ) !important; /* Changes to your primary red on hover */
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  text-align: center;
}

/* ==================== Media Queries for Responsiveness ==================== */

/* Tablet and larger screens (e.g., > 768px) */
@media (min-width: 768px) {
  .main-header .container {
    display: grid;
    /* Adjusted grid columns: logo | main-nav (takes more space) | nav-icons */
    /* Increased fractional unit for main-nav to give it more room to justify right */
    grid-template-columns: 2fr auto auto; /* Give main nav 2 times more space */
    align-items: center; /* Center items vertically */
    gap: 1.5rem;
  }

  .main-nav {
    position: static; /* Not fixed */
    display: block; /* Always visible */
    width: auto;
    height: auto;
    background-color: transparent;
    color: var(--text-color);
    padding-top: 0;
    /* Changed text-align back to right */
    text-align: right; /* Align links to the right within its allocated grid space */
    box-shadow: none; /* No shadow on desktop */
  }

  .main-nav.active {
    left: auto;
  }

  .main-nav-overlay {
    display: none !important; /* Force hide overlay on desktop */
  }

  .nav-links {
    display: flex;
    justify-content: flex-end;
    margin-top: 0;
    gap: 1.5rem;
  }

  .nav-links li {
    margin-bottom: 0;
  }

  .nav-links a {
    padding: 0;
    color: var(--secondary-dark);
    background-color: transparent;
    white-space: nowrap;
    position: relative; /* Ensure position for the underline pseudo-element */
    /* To prevent text "jumping" when underline appears */
    padding-bottom: 7px; /* Make room for the underline */
  }

  /* Main underline element with enhanced animation */
  .nav-links a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px; /* Slightly thicker for better visibility */
    background: var(--primary-red); /* Solid red color */
    border-radius: 2px 2px 0 0; /* Rounded top edges */

    /* Enhanced animation properties */
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1); /* Smooth easing function */
  }

  /* Hover effect - slide in from left */
  .nav-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  /* Active state - permanent underline with subtle pulse effect */
  .nav-links a.active::after {
    transform: scaleX(1);
    transform-origin: left;
    animation: gentlePulse 2s ease-in-out infinite;
  }

  /* Additional hover effect for the text itself */
  .nav-links a:hover,
  .nav-links a.active {
    color: var(--primary-red);
    background-color: transparent;
  }

  /* Text color change on hover/active for desktop */
  .nav-links a:hover,
  .nav-links a.active {
    color: var(
      --primary-red
    ); /* Text color also changes to red on hover/active */
    background-color: transparent;
  }

  .hamburger-menu {
    display: none; /* Hide hamburger on larger screens */
  }

  .carousel-content h1 {
    font-size: 3.5rem;
  }

  .carousel-content p {
    font-size: 1.5rem;
  }

  .product-grid {
    grid-template-columns: repeat(
      auto-fit,
      minmax(220px, 1fr)
    ); /* More columns on tablet */
  }

  .footer-grid {
    grid-template-columns: repeat(
      auto-fit,
      minmax(200px, 1fr)
    ); /* Multi-column footer */
  }
}

/* Desktop and larger screens (e.g., > 1024px) */
@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }

  .logo {
    font-size: 1.8rem;
  }

  .nav-icons div {
    font-size: 1.4rem;
  }

  .hero-carousel {
    height: 70vh; /* Taller hero on desktop */
  }

  .carousel-content h1 {
    font-size: 4.5rem;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr); /* 4 columns for products */
  }
  .footer-grid {
    grid-template-columns: repeat(4, 1fr); /* 4 columns for footer */
  }
}

/* Toast / custom popup styles */
/* Fancy animated toast */
#toast-container {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    pointer-events: none;
    width: auto;
    max-width: calc(100% - 40px);
    padding: 0 10px;
}

/* Individual toast */
.fancy-toast {
    pointer-events: auto;
    position: relative;
    background: linear-gradient(180deg, rgba(var(--primary-red-rgb),0.98), rgba(0,0,0,0.85));
    color: #fff;
    padding: 14px 16px 12px 16px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.35);
    font-size: 14px;
    min-width: 220px;
    max-width: 560px;
    width: 100%;
    overflow: hidden;
    transform-origin: center;
    opacity: 0;
    will-change: transform, opacity;
}

/* entrance animation: bounce + settle */
@keyframes toastIn {
    0% { opacity: 0; transform: translateY(28px) scale(0.96) rotate(-1deg); }
    60% { opacity: 1; transform: translateY(-8px) scale(1.03) rotate(0.4deg); }
    85% { transform: translateY(3px) scale(0.995) rotate(-0.2deg); }
    100% { transform: translateY(0) scale(1) rotate(0); opacity: 1; }
}

/* exit animation: smooth drop + fade */
@keyframes toastOut {
    to { opacity: 0; transform: translateY(20px) scale(0.98); }
}

/* progress bar decreases left→right */
@keyframes progressLinear {
    from { width: 100%; }
    to { width: 0%; }
}

/* show/hide states */
.fancy-toast.show { animation: toastIn 480ms cubic-bezier(.2,.9,.3,1) both; }
.fancy-toast.hide { animation: toastOut 300ms ease forwards; }

/* content & close */
.fancy-toast .toast-content { display: block; margin-right: 30px; line-height: 1.25; }
.fancy-toast .toast-close {
    position: absolute;
    right: 8px;
    top: 6px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.9);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background .15s ease;
}
.fancy-toast .toast-close:hover { background: rgba(255,255,255,0.06); }

/* progress indicator */
.fancy-toast .toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 5px;
    background: linear-gradient(90deg, rgba(255,255,255,0.95), rgba(255,255,255,0.6));
    width: 100%;
    transform-origin: left;
}

/* stacked look: slightly scaled behind ones */
#toast-container .fancy-toast:nth-child(2) { transform: translateY(6px) scale(0.995); }
#toast-container .fancy-toast:nth-child(3) { transform: translateY(12px) scale(0.99); }

/* responsive adjustments */
@media (max-width: 480px) {
    .fancy-toast { min-width: 180px; font-size: 13px; padding: 12px 14px 10px 14px; border-radius: 10px; }
    #toast-container { bottom: 18px; }
}

/* Flipkart-like order success popup (bottom-right slide-in) */
#fk-toast-container {
    position: fixed;
    right: 18px;
    bottom: 24px;
    z-index: 120000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: calc(100% - 36px);
}

.fk-toast {
    pointer-events: auto;
    display: flex;
    gap: 12px;
    align-items: center;
    background: linear-gradient(180deg,#ffffff,#f7fbff);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 18px 40px rgba(2,6,23,0.18);
    min-width: 280px;
    max-width: 420px;
    border-left: 6px solid #28a745; /* success accent */
    transform: translateX(110%);
    opacity: 0;
    overflow: hidden;
    transition: transform 420ms cubic-bezier(.2,.9,.25,1), opacity 420ms ease;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.fk-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.fk-toast.hide {
    transform: translateX(110%);
    opacity: 0;
}

.fk-toast .fk-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(180deg,#e9fff1,#d7f7e5);
    display:flex;
    align-items:center;
    justify-content:center;
    color: #0a7a2e;
    font-size: 18px;
    box-shadow: 0 6px 18px rgba(10,122,46,0.12);
}

.fk-toast .fk-body {
    flex: 1 1 auto;
    min-width: 0;
}

.fk-toast .fk-title {
    font-weight: 700;
    color: #0b3a2b;
    font-size: 14px;
    margin-bottom: 4px;
}

.fk-toast .fk-sub {
    font-size: 13px;
    color: #374151;
    opacity: 0.95;
    line-height: 1.2;
}

/* actions (view order / close) */
.fk-toast .fk-actions {
    display:flex;
    gap:8px;
    margin-top:8px;
}

.fk-toast .fk-btn {
    background: #0b78ff;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.fk-toast .fk-btn.secondary {
    background: transparent;
    border: 1px solid rgba(15,23,42,0.08);
    color: #0b3a2b;
}

/* small order id text */
.fk-toast .fk-oid {
    display: inline-block;
    font-size: 12px;
    color: #6b7280;
    margin-left: 6px;
}

/* progress bar along bottom */
.fk-toast .fk-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(11,120,255,0.95), rgba(40,167,69,0.95));
    width: 100%;
    transform-origin: left;
    transition: width linear;
}

/* pause overlay when hovered */
.fk-toast:hover { cursor: default; }
@media (max-width: 480px) {
    #fk-toast-container { right: 12px; bottom: 12px; }
    .fk-toast { min-width: 220px; max-width: 92vw; padding: 10px; }
}

/* Centered Order Success modal (sciff-like) */
#order-success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 18, 26, 0.54);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 140000;
    pointer-events: auto;
    padding: 20px;
}

.order-success-modal {
    width: min(620px, 96%);
    background: linear-gradient(180deg,#ffffff,#fbfdff);
    border-radius: 14px;
    padding: 26px;
    box-shadow: 0 30px 80px rgba(3,10,25,0.48);
    transform: translateY(24px) scale(0.98);
    opacity: 0;
    transition: transform 420ms cubic-bezier(.2,.9,.25,1), opacity 420ms ease;
    position: relative;
    overflow: visible;
}

.order-success-modal.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Big check icon */
.order-success-icon {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 25%, #e9fff1, #d7f7e5 50%, #b7f0c7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -72px auto 6px auto;
    box-shadow: 0 14px 30px rgba(10,122,46,0.12);
    border: 6px solid rgba(255,255,255,0.6);
    font-size: 36px;
    color: #0a7a2e;
}

/* Text */
.order-success-title {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: #07231a;
    margin-top: 6px;
}

.order-success-sub {
    text-align: center;
    color: #32434a;
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.3;
}

/* Order id row */
.order-success-oid {
    display: inline-block;
    background: rgba(11,120,255,0.06);
    color: #0b3a2b;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    margin-left: 8px;
    font-size: 13px;
}

/* Actions */
.order-success-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.order-success-actions .btn {
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    border: none;
}

.order-success-actions .btn-primary {
    background: #0b78ff;
    color: #fff;
}

.order-success-actions .btn-secondary {
    background: transparent;
    border: 1px solid rgba(11,23,42,0.08);
    color: #0b3a2b;
}

/* Confetti (small decorative squares) */
.order-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
}
.order-confetti .c {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0.95;
    border-radius: 2px;
    transform: translateY(-8px) rotate(20deg);
    animation: confettiFall linear forwards;
}
@keyframes confettiFall {
    from { transform: translateY(-12px) rotate(0deg); opacity: 1; }
    to   { transform: translateY(40px) rotate(220deg); opacity: 0; }
}

/* Responsive tweaks */
@media (max-width:480px) {
    .order-success-icon { width:68px; height:68px; margin-top:-56px; font-size:28px; }
    .order-success-title { font-size:18px; }
    .order-success-modal { padding:18px; border-radius:12px; }
}
