/* 
========================================
  MG Herbal Skincare - Core Stylesheet
========================================
*/

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

/* --- CSS Variables --- */
:root {
  /* Colors */
  --primary-color: #2F4F4F; /* Dark Slate Gray (Herbal feel) */
  --secondary-color: #8FBC8F; /* Dark Sea Green */
  --accent-color: #D4AF37; /* Metallic Gold (Premium feel) */
  --text-dark: #333333;
  --text-light: #F5F5F5;
  --bg-color: #FAFAFA; /* Off-white for clean look */
  --card-bg: #FFFFFF;
  --border-color: #E0E0E0;
  --error-color: #D32F2F;
  --success-color: #388E3C;
  
  /* Typography */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Lato', sans-serif;
  
  /* Layout */
  --container-width: 1200px;
  --header-height: 80px;
  
  /* Transitions & Shadows */
  --transition: all 0.3s ease;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}



/* --- Resets & Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  scroll-behavior: smooth;
  font-family: var(--font-body);
  color: var(--text-dark);
  background-color: var(--bg-color);
  line-height: 1.6;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 80px 0;
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-gold { color: var(--accent-color); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  background-color: var(--primary-color);
  color: var(--text-light);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--text-light);
}

.btn-gold {
  background-color: var(--accent-color);
  color: var(--btn-gold-text);
}

.btn-gold:hover {
  background-color: #B89025;
  color: var(--text-light);
}

.btn-coral {
  background-color: #F05A4A;
  color: var(--text-light);
  border-radius: 50px;
  padding: 14px 32px;
}

.btn-coral:hover {
  background-color: #d94b3c;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* --- Header & Navigation --- */
header {
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo span {
  color: var(--accent-color);
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  color: var(--text-dark);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--accent-color);
  transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-icons {
  display: flex;
  gap: 20px;
  align-items: center;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--primary-color);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  color: var(--accent-color);
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--accent-color);
  color: var(--text-light);
  font-size: 0.7rem;
  font-weight: bold;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
}

/* --- Hero Slider & Marquee --- */
.hero-slider {
  position: relative;
  height: calc(100vh - var(--header-height));
  min-height: 600px;
  overflow: hidden;
  background-color: var(--primary-color);
}

.carousel-inner {
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  color: var(--text-light);
  padding: 0 8%;
  z-index: 1;
}

.carousel-item.active {
  opacity: 1;
  z-index: 2;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 15px 20px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s;
}

.carousel-control:hover {
  background: rgba(0, 0, 0, 0.7);
}

.carousel-control.prev {
  left: 20px;
}

.carousel-control.next {
  right: 20px;
}

.carousel-indicators {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.carousel-indicators .indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.carousel-indicators .indicator.active {
  background: var(--accent-color);
}

.marquee-wrapper {
  background-color: #FFFFFF;
  color: #666666;
  padding: 12px 0;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid #EEEEEE;
  display: flex;
}

.marquee {
  display: flex;
  width: max-content;
  animation: scroll-marquee 40s linear infinite;
}

.marquee:hover {
  animation-play-state: paused;
}

.marquee-content {
  display: flex;
  gap: 50px;
  padding-right: 50px;
}

.marquee-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.marquee-item i {
  color: #F05A4A;
  font-size: 1.1rem;
}

@keyframes scroll-marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.hero-content {
  max-width: 650px;
  animation: fadeInDown 1s ease-out forwards;
}

.hero-content h1 {
  font-size: 4rem;
  color: var(--text-light);
  text-shadow: 2px 2px 8px rgba(0,0,0,0.6);
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

.top-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

.hero-list {
  list-style: none;
  margin: 0 0 2rem 0;
  padding: 0;
}

.hero-list li {
  margin-bottom: 12px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Product Cards --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 2rem;
}

.product-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.product-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: var(--accent-color);
  color: var(--text-light);
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: var(--radius-sm);
  z-index: 2;
}

.product-image {
  height: 250px;
  overflow: hidden;
  position: relative;
  background-color: #f0f0f0;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-action {
  position: absolute;
  bottom: -50px;
  left: 0;
  width: 100%;
  background: rgba(255,255,255,0.9);
  padding: 10px;
  display: flex;
  justify-content: center;
  transition: var(--transition);
  z-index: 2;
}

.product-card:hover .product-action {
  bottom: 0;
}

.product-info {
  padding: 20px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-category {
  font-size: 0.85rem;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.product-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.product-title a:hover {
  color: var(--primary-color);
}

.product-price {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-top: auto;
}

/* --- Features Section --- */
.features {
  background-color: var(--primary-color);
  color: var(--text-light);
  padding: 60px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  text-align: center;
}

.feature-item i {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 15px;
}

.feature-item h3 {
  color: var(--text-light);
  font-size: 1.2rem;
}

/* --- Shop Collection Header --- */
.shop-collection-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 0 15px;
}

.shop-collection-header h1 {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  color: #3E2723;
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.shop-collection-header p {
  font-size: 1.1rem;
  color: #5D4037;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

.hide-mobile {
  display: block;
}

@media (max-width: 768px) {
  .shop-collection-header h1 {
    font-size: 2.5rem;
  }
  .hide-mobile {
    display: none;
  }
  .shop-collection-header {
    margin-bottom: 2rem;
  }
}

/* --- Footer --- */
footer {
  background-color: #1A2E2E; /* Darker green */
  color: var(--text-light);
  padding: 60px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h3 {
  color: var(--accent-color);
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.footer-col p {
  color: #ccc;
  font-size: 0.9rem;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #ccc;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent-color);
  padding-left: 5px;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255,255,255,0.1);
  border-radius: 50%;
  color: var(--text-light);
}

.social-links a:hover {
  background-color: var(--accent-color);
  color: #1A2E2E;
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  color: #999;
}

.developer-credit {
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: #aaa;
}

.developer-credit a {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.developer-credit a:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* --- Responsive Design --- */
@media (max-width: 900px) {
  .hero-content h1 {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  /* --- Modern Mobile Side Drawer --- */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden off-screen by default */
    left: auto; /* Override desktop left */
    width: clamp(280px, 75vw, 400px); /* Responsive width */
    height: 100vh;
    background-color: var(--card-bg);
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(80px, 10vh, 120px) 2rem 2rem;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow-y: auto; /* Enable scrolling if menu items are tall */
    will-change: right;
  }
  
  .nav-links.active {
    right: 0; /* Slide in */
  }

  .nav-links a {
    width: 100%;
    padding: 1rem 0; /* At least 44px touch target */
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    display: block;
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-links a::after {
    display: none; /* Remove desktop hover underline effect for mobile */
  }
  
  .nav-links a:hover,
  .nav-links a:focus {
    color: var(--accent-color);
    padding-left: 10px; /* Slight visual feedback */
  }

  /* Overlay for background darkening */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Ensure mobile toggle is above the drawer */
  .mobile-menu-btn {
    display: block;
    z-index: 1001;
    position: relative;
    transition: transform 0.3s ease;
  }

  .mobile-menu-btn.active {
    color: var(--error-color);
    transform: rotate(90deg);
  }
  /* Mobile Header Alignment */
  .nav-icons {
    gap: 8px;
  }
  .header-clock {
    display: none !important;
  }
  .logo {
    font-size: 1.1rem;
    gap: 5px;
  }
  .logo img {
    height: 30px !important;
  }
  
  .icon-btn {
    font-size: 1.1rem;
  }
  .cart-count {
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    font-size: 0.65rem;
  }
  .mobile-menu-btn {
    font-size: 1.3rem;
  }

  /* Global Section & Container Spacing */
  .container,
  .section,
  .shop-collection-header {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .section {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  /* Typography Scaling */
  h1 { font-size: 1.6rem !important; }
  h2 { font-size: 1.4rem !important; }
  h3 { font-size: 1.2rem !important; }
  .hero-content h1 {
    font-size: 1.8rem !important;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .hero-list li {
    font-size: 0.9rem;
  }

  /* 3-Column Mobile Product Grid (Highly Optimized) */
  .product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
    margin-top: 1rem;
  }

  .product-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 6px;
  }

  .product-image {
    aspect-ratio: 1 / 1;
    height: auto;
    overflow: hidden;
    position: static !important;
  }

  .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Scaled-down Product Info for 3 columns */
  .product-info {
    padding: 6px 4px 0px 4px; /* Space for always-visible button below */
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  
  .product-category {
    font-size: 9px;
    margin-bottom: 2px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .product-title {
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 26px; /* 2 lines approx */
  }

  /* Ratings */
  .product-info > div:not(.product-price):not(.product-action) {
    min-height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 9px;
    margin-bottom: 4px;
    transform: scale(0.85);
  }

  .product-price {
    font-size: 12px;
    margin-top: auto;
    margin-bottom: 40px; /* Make room for the button */
    text-align: center;
  }

  .product-badge {
    top: 4px;
    left: 4px;
    padding: 2px 4px;
    font-size: 0.6rem;
    border-radius: 3px;
  }
  
  .product-action {
    padding: 4px;
    bottom: 0; /* Always visible */
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 6px 6px;
  }

  .product-action .btn {
    padding: 6px 4px;
    font-size: 9px;
    width: 100%;
    text-align: center;
    letter-spacing: 0;
    border-radius: 4px;
  }
}

/* Theme fixes */
:root {
  --text-muted: #666666;
  --newsletter-bg: rgba(255, 255, 255, 0.95);
  --btn-gold-text: #333333;
}

/* --- WhatsApp Floating Action Button --- */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background-color: #25D366;
  color: #FFFFFF !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
  z-index: 9990;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
  color: #FFFFFF !important;
}

.whatsapp-float .whatsapp-tooltip {
  position: absolute;
  right: 66px;
  background-color: #222222;
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-body);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 18px;
    right: 18px;
    width: 48px;
    height: 48px;
    font-size: 26px;
  }
}

