/* ===============================
   🌈 Theme Colors & Base
   =============================== */
:root {
  --purple: #6f42c1;
  --purple-dark: #5b34a0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background-color: #ffffff;
  color: #212529;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

nav {
  flex-shrink: 0;
}

main {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Ensure containers don't add extra space */
main > * {
  margin-bottom: 0 !important;
}

/* Remove extra space from all containers */
.container, .container-fluid {
  margin-bottom: 0 !important;
}

footer {
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
  margin-bottom: 0 !important;
}

.text-purple {
  color: var(--purple) !important;
}

/* ===============================
   🔘 Buttons
   =============================== */
.btn-purple {
  background-color: var(--purple);
  color: #fff;
  border: none;
  transition: all 0.3s ease;
}
.btn-purple:hover {
  background-color: var(--purple-dark);
  transform: scale(1.05);
}

.btn-outline-purple {
  border: 1px solid var(--purple);
  color: var(--purple);
  background: transparent;
  transition: all 0.3s ease;
}
.btn-outline-purple:hover {
  background-color: var(--purple);
  color: #fff;
}

/* ===============================
   🏷️ Discount Badge (Green)
   =============================== */
.badge-discount {
  background-color: #28a745 !important;
  color: white !important;
  font-weight: 600;
  padding: 0.35em 0.6em;
  border-radius: 4px;
  font-size: 0.75rem;
  display: inline-block;
}

/* Override Bootstrap success badge */
.badge.badge-discount {
  background-color: #28a745 !important;
}

span.badge-discount {
  background-color: #28a745 !important;
}

/* ===============================
   📸 Image Container with Overlay Badge
   =============================== */
.image-overlay-container {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 4px;
}

.image-overlay-container img {
  width: 100%;
  display: block;
}

/* ===============================
   🪶 Product Cards (Meesho Style)
   =============================== */
.product-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-radius: 0;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: transparent;
  border: none;
  min-height: auto;
}

.product-card:hover {
  transform: scale(1.02);
  box-shadow: none;
}

.product-image {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background-color: #ffffff;
  padding: 8px;
  border-radius: 0;
  border: none;
  transition: transform 0.2s ease;
  display: block;
}

.product-card:hover .product-image {
  transform: scale(1.05);
  box-shadow: none;
}

/* Image container constraints */
.product-card a div.position-relative {
  display: block;
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.card-img-top {
  height: 220px !important;
  object-fit: contain !important;
  background-color: #ffffff !important;
  padding: 8px !important;
}

/* Product card body styling */
.product-card .card-body {
  background: transparent;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0;
  gap: 6px;
  border-radius: 0;
  min-height: 0;
}

.product-card .card-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  line-height: 1.3;
  margin-bottom: 0;
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  flex-shrink: 0;
}

/* Price block styling */
.price-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.price-block .fw-bold {
  font-size: 0.95rem;
}

/* Product detail page price styling */
.price-block h4 {
  margin-bottom: 0 !important;
  display: block;
  width: 100%;
}

.price-block .text-decoration-line-through {
  display: block;
  margin-left: 0 !important;
  margin-top: 4px;
}

.price-block .text-success {
  display: block;
  margin-top: 6px !important;
}

/* Product detail section price styling */
.price-detail-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.price-value {
  margin: 0 !important;
  font-size: 1.5rem;
}

.price-original {
  font-size: 0.95rem;
  margin: 0 !important;
}

.price-save {
  margin: 0 !important;
  font-weight: 500;
}

.price-block .badge {
  align-self: flex-start;
}

/* ===============================
   🏷️ Category Cards (Meesho Style - Horizontal Scroll)
   =============================== */

/* Hide scrollbar but keep functionality */
#categoryScroll {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;     /* Firefox */
}

#categoryScroll::-webkit-scrollbar {
  display: none;  /* Chrome, Safari and Opera */
}

.category-wrapper {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 0;
  border-radius: 0;
  overflow: visible;
}

.category-card {
  display: flex;
  flex-direction: column;
  border-radius: 0;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: white;
  height: 100%;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  border: none;
}

.category-card:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  position: relative;
  text-decoration: none;
}

.category-card .card-img-top {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: transparent;
  padding: 0;
  border: none;
}

/* Category label overlay at bottom */
.category-label {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(2px);
  padding: 8px 4px;
  z-index: 5;
}

.category-label h6 {
  color: #212529;
  font-size: 0.75rem;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 6px;
}

.category-card .card-body h6 {
  margin-bottom: 0;
  font-size: 0.8rem;
  line-height: 1.3;
  font-weight: 500;
  color: #333;
}

.category-card .card-body small {
  font-size: 0.7rem;
  color: #6f42c1;
  display: none;
}

/* Placeholder div for categories without images */
.category-card .card-img-top.bg-purple {
  border-radius: 50%;
}

/* Deal card styling (Deals of the Day) */
/* Now uses product-card class - no additional styling needed */

/* ===============================
   💰 Price & Discount (Meesho Style)
   =============================== */
.price-block {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.price-block .text-decoration-line-through {
  color: #999;
  font-size: 0.8rem;
  text-decoration: line-through;
}

.price-block .badge {
  background-color: #f05849 !important;
  color: white;
  font-size: 0.7rem;
  border-radius: 2px;
  padding: 2px 4px;
  font-weight: 500;
}

/* ===============================
   🛒 Stable Add-to-Cart Button
   =============================== */
.product-card .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 38px;              /* fixed height for desktop */
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

/* Centered, fixed-width text block (prevents resize on Add → Added ✓) */
.product-card .btn .btn-text {
  display: inline-block;
  width: 65px;               /* keeps Add / Added ✓ same width */
  text-align: center;
  transition: opacity 0.25s ease;
}

/* Spinner overlay (centered) */
.product-card .btn .spinner-border {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Loading state */
.product-card .btn.loading .spinner-border {
  opacity: 1;
}
.product-card .btn.loading .btn-text {
  opacity: 0.5;
}

/* Disabled & glow feedback */
.product-card .btn:disabled {
  pointer-events: none;
  opacity: 0.9;
}
.product-card .btn-glow {
  box-shadow: 0 0 10px rgba(111, 66, 193, 0.5);
}

/* ===============================
   ⚡ Shimmer Loading Effect
   =============================== */
.shimmer-card {
  background-color: #f6f7f8;
  border-radius: 10px;
  padding: 10px;
  animation: shimmer 1.5s infinite linear;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer-img {
  height: 220px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  margin-bottom: 10px;
}
.shimmer-line {
  height: 12px;
  background-color: #ecebeb;
  border-radius: 6px;
  margin-bottom: 6px;
}
.shimmer-line.medium { width: 80%; }
.shimmer-line.short { width: 60%; }

/* ===============================
   ✨ Fade & Transition Animations
   =============================== */
.fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ===============================
   🎯 Dropdown Styling
   =============================== */
.dropdown-item {
  transition: all 0.2s ease;
  padding: 10px 16px;
}

.dropdown-item:hover {
  background-color: #f8f3ff;
  color: var(--purple);
}

.dropdown-item.active {
  background-color: var(--purple);
  color: white;
}

.dropdown-menu {
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
}

.dropdown-toggle::after {
  transition: transform 0.2s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

/* ===============================
   📱 Responsive Tweaks
   =============================== */
@media (max-width: 768px) {
  .product-card img { height: 220px !important; object-fit: contain !important; }
  .product-image { height: 220px !important; object-fit: contain !important; }
  .card-img-top { height: 220px !important; object-fit: contain !important; }
  .product-card { min-height: 320px; }
  h6.card-title { font-size: 0.9rem; }

  .product-card .btn {
    font-size: 0.85rem;
    height: 34px;           /* slightly smaller fixed height for mobile */
  }

  /* Mobile responsive adjustments */
  .col-12 {
    width: 100%;
  }

  /* Cart responsive */
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-item .item-total {
    margin-top: 10px;
  }

  /* Checkout responsive */
  .btn-lg {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  /* Sticky positioning fix for mobile */
  .card[style*="sticky"] {
    position: relative !important;
    top: 0 !important;
  }

  /* Table responsive */
  .table-responsive {
    font-size: 0.85rem;
  }

  .table td, .table th {
    padding: 0.5rem;
  }

  /* Dropdown fix */
  .dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
  }

  form.d-flex {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Text truncation */
  .min-width-0 {
    min-width: 0;
  }

  .text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Sidebar to dropdown on mobile */
  .d-md-none {
    display: block !important;
  }

  .d-none.d-md-block {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .container, .container-fluid {
    padding: 0.75rem;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }
  h4 { font-size: 1rem; }
  h5 { font-size: 0.95rem; }
  h6 { font-size: 0.9rem; }

  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .py-5 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .py-4 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
  .py-3 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }

  /* Extra small adjustments */
  .gap-4 { gap: 0.75rem !important; }
  .mb-4 { margin-bottom: 0.75rem !important; }

  /* Images on mobile */
  .img-fluid { max-width: 100%; height: auto; }
}

@media (min-width: 769px) and (max-width: 991px) {
  /* Tablet adjustments */
  .col-md-3 { flex: 0 0 calc(50% - 0.5rem); }
  .col-md-6 { flex: 0 0 100%; }
}

/* ===============================
   ⭐ Star Rating Styles
   =============================== */
.text-warning {
  color: #ffc107 !important;
}

.text-muted {
  color: #6c757d !important;
}

.star-rating {
  font-size: 1.3rem;
  letter-spacing: 2px;
  display: inline-flex;
  gap: 2px;
}

.star-filled {
  color: #ffc107 !important;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.star-empty {
  color: #d9d9d9 !important;
  font-weight: bold;
}

/* ===============================
   🎄 CHRISTMAS HERO SECTION
   =============================== */

.christmas-hero {
  position: relative;
  overflow: hidden;
}

/* Snowfall Animation */
.snowfall-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.snowflake {
  position: absolute;
  top: -10px;
  color: #fff;
  font-size: 1.5em;
  opacity: 0.8;
  animation: snowfall linear infinite;
}

@keyframes snowfall {
  to {
    transform: translateY(100vh) translateX(var(--offset));
    opacity: 0;
  }
}

/* Glowing Lights Animation */
.lights-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.light {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  opacity: 0;
  animation: pulse 3s ease-in-out infinite;
}

.light-red {
  background: radial-gradient(circle, #ff4757, rgba(255, 71, 87, 0));
  left: 10%;
  top: 15%;
  animation-delay: 0s;
}

.light-green {
  background: radial-gradient(circle, #2ed573, rgba(46, 213, 115, 0));
  left: 30%;
  top: 25%;
  animation-delay: 0.5s;
}

.light-yellow {
  background: radial-gradient(circle, #ffd700, rgba(255, 215, 0, 0));
  left: 50%;
  top: 10%;
  animation-delay: 1s;
}

.light-blue {
  background: radial-gradient(circle, #00d4ff, rgba(0, 212, 255, 0));
  left: 70%;
  top: 30%;
  animation-delay: 1.5s;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 30px currentColor;
  }
}

/* Bounce Animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Twinkle Animation */
@keyframes twinkle {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Slide In Down */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide In Up */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Countdown Timer Styling */
.countdown-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  min-width: 70px;
}

.countdown-number {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.countdown-label {
  font-size: 0.75rem;
  color: #fff;
  opacity: 0.8;
  margin-top: 4px;
  font-weight: 600;
}

/* Hero Content Z-index */
.hero-content {
  position: relative;
  z-index: 3;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .countdown-box {
    min-width: 60px;
    padding: 10px 12px;
  }

  .countdown-number {
    font-size: 1.25rem;
  }

  .countdown-label {
    font-size: 0.65rem;
  }

  .christmas-hero {
    min-height: 600px !important;
  }
}

@media (max-width: 576px) {
  .countdown-box {
    min-width: 50px;
    padding: 8px 10px;
  }

  .countdown-number {
    font-size: 1rem;
  }

  .countdown-label {
    font-size: 0.6rem;
  }

  .christmas-hero {
    min-height: 700px !important;
  }
}

