/*
========================================
Asalkar Healthy Hub - Main Stylesheet
========================================
*/

/* --- 1. Root Variables & Base Styles --- */
:root {
  --primary: #2c5f2d;
  --primary-light: #52b69a;
  --primary-dark: #1b4332;
  --secondary: #b5e48c;
  --accent: #ffd60a;
  --accent-dark: #ffb700;
  --success: #28a745;
  --danger: #dc3545;
  
  --bg-light: #f8fffe;
  --bg-white: #ffffff;
  --text-dark: #2d3436;
  --text-light: #ffffff;
  --text-muted: #6c757d;
  --border-light: #e9ecef;
  
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  --gradient-hero: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 25px rgba(0,0,0,0.2);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.25);
  
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  overflow-x: hidden;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- 2. Animations & Preloader --- */
.loading-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: var(--gradient-primary); display: flex; justify-content: center; align-items: center; z-index: 9999; transition: opacity 0.5s ease; }
.loading-spinner { text-align: center; color: var(--text-light); }
.spinner { width: 50px; height: 50px; border: 4px solid rgba(255, 255, 255, 0.3); border-top: 4px solid var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.particles-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.particle { position: absolute; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; opacity: 0.6; animation: float 6s ease-in-out infinite; }
.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 8s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 6s; }
.particle:nth-child(3) { left: 70%; animation-delay: 4s; animation-duration: 10s; }
.particle:nth-child(4) { left: 80%; animation-delay: 6s; animation-duration: 7s; }
.particle:nth-child(5) { left: 90%; animation-delay: 8s; animation-duration: 9s; }
@keyframes float { 0%, 100% { transform: translateY(100vh); opacity: 0; } 50% { transform: translateY(-10vh) rotate(180deg); opacity: 0.6; } }

@keyframes bounce { 0%,100%{transform:translateY(0)} 40%{transform:translateY(-10px)} 60%{transform:translateY(-5px)} }

/* --- 3. Header & Navigation --- */
.header { background: rgba(27, 67, 50, 0.85); backdrop-filter: blur(10px); position: fixed; top: 0; left: 0; right: 0; z-index: 1000; transition: var(--transition); }
.header-container { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; max-width: 1200px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 15px; color: var(--text-light); text-decoration: none; }
.logo img { height: 50px; width: 50px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.logo span { font-size: 1.5rem; font-weight: 700; white-space: nowrap; }
.nav-menu { display: flex; list-style: none; gap: 0.5rem; align-items: center; }
.nav-link { color: var(--text-light); text-decoration: none; font-weight: 500; position: relative; transition: all 0.2s ease; padding: 0.5rem 1rem; border-radius: 20px; white-space: nowrap; }
.nav-link:hover { color: var(--accent); background: rgba(255, 255, 255, 0.1); }
.auth-btn { background-color: var(--accent); color: var(--primary-dark); font-weight: 600; }
.auth-btn:hover { background-color: var(--accent-dark); color: var(--primary-dark); }
.hamburger { display: none; flex-direction: column; cursor: pointer; }
.hamburger span { width: 25px; height: 3px; background: var(--text-light); margin: 3px 0; transition: var(--transition); border-radius: 2px; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

/* --- 4. Hero Section --- */
.hero { background: var(--gradient-hero); color: var(--text-light); padding: 120px 0 80px; min-height: 100vh; display: flex; align-items: center; position: relative; overflow: hidden; }
.hero-content { max-width: 1200px; margin: 0 auto; padding: 0 2rem; text-align: center; z-index: 2; }
.hero-title { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700; margin-bottom: 1.5rem; line-height: 1.2; }
.hero-subtitle { font-size: 1.25rem; margin-bottom: 3rem; opacity: 0.9; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-stats { display: flex; justify-content: center; gap: 3rem; margin-top: 3rem; flex-wrap: wrap; }
.stat-item { text-align: center; padding: 1.5rem; background: rgba(255, 255, 255, 0.1); border-radius: var(--border-radius-lg); backdrop-filter: blur(10px); transition: var(--transition); border: 1px solid rgba(255, 255, 255, 0.2); }
.stat-item:hover { transform: translateY(-10px); }
.stat-item i { font-size: 2rem; color: var(--accent); margin-bottom: 0.5rem; }
.stat-number { display: block; font-size: 2.5rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.9rem; opacity: 0.8; }

/* --- 5. Generic Sections & Content --- */
.section-title { text-align: center; font-size: 2.5rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 3rem; position: relative; }
.section-title::after { content: ''; position: absolute; bottom: -10px; left: 50%; width: 80px; height: 4px; background: var(--primary-light); transform: translateX(-50%); border-radius: 2px; }
.features, .products, .newsletter { padding: 80px 0; }
.features { background: var(--bg-white); }
.products { background: var(--bg-light); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 3rem; }
.feature-card { text-align: center; padding: 2.5rem 1.5rem; background: var(--bg-white); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-md); transition: var(--transition); border: 1px solid var(--border-light); }
.feature-card:hover { transform: translateY(-15px); box-shadow: var(--shadow-xl); border-color: var(--primary-light); }
.feature-icon { width: 80px; height: 80px; margin: 0 auto 1.5rem; background: var(--gradient-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--text-light); }
.feature-card:hover .feature-icon { transform: scale(1.1) rotate(5deg); }
.feature-card h3 { font-size: 1.5rem; font-weight: 600; color: var(--primary-dark); margin-bottom: 1rem; }
.feature-card p { color: var(--text-muted); line-height: 1.6; }

/* --- 6. Products Section --- */
.product-filter { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.filter-btn { padding: 0.75rem 1.5rem; border: 2px solid var(--primary); background: transparent; color: var(--primary); border-radius: 25px; cursor: pointer; transition: var(--transition); font-weight: 500; }
.filter-btn:hover, .filter-btn.active { background: var(--primary); color: var(--text-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.products-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 3rem; }
.product-card { background: var(--bg-white); border-radius: var(--border-radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); border: 1px solid var(--border-light); position: relative; }
.product-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); }
.card-image { position: relative; overflow: hidden; height: 250px; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: all 0.5s ease; }
.product-card:hover .card-image img { transform: scale(1.1); }
.card-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; opacity: 0; transition: var(--transition); }
.product-card:hover .card-overlay { opacity: 1; }
.card-actions { display: flex; gap: 1rem; }
.wishlist-btn { width: 45px; height: 45px; border: 2px solid var(--text-light); background: transparent; color: var(--text-light); border-radius: 50%; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.wishlist-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--text-dark); transform: scale(1.1); }
.popular-badge, .bulk-badge, .premium-badge { position: absolute; top: 15px; right: 15px; padding: 0.5rem 1rem; border-radius: var(--border-radius); font-size: 0.8rem; font-weight: 600; z-index: 2; color: var(--text-light); }
.popular-badge { background: var(--accent); color: var(--text-dark); }
.bulk-badge { background: #17a2b8; }
.premium-badge { background: var(--gradient-primary); }
.card-content { padding: 1.5rem; }
.card-content h3 { font-size: 1.25rem; font-weight: 600; color: var(--primary-dark); margin-bottom: 0.5rem; }
.product-description { color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; min-height: 45px; }
.price-section { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.price { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.price-per-ml, .price-per-kg { font-size: 0.9rem; color: var(--text-muted); background: var(--bg-light); padding: 0.25rem 0.5rem; border-radius: var(--border-radius); }
.add-to-cart-btn { width: 100%; padding: 0.75rem 1.5rem; background: var(--gradient-primary); color: var(--text-light); border: none; border-radius: var(--border-radius); cursor: pointer; font-weight: 600; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.add-to-cart-btn:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* --- 7. Newsletter Section --- */
.newsletter { background: var(--gradient-primary); color: var(--text-light); }
.newsletter-content { text-align: center; max-width: 600px; margin: 0 auto; }
.newsletter-content h2 { font-size: 2rem; margin-bottom: 1rem; }
.newsletter-content p { font-size: 1.1rem; margin-bottom: 2rem; opacity: 0.9; }
.newsletter-form { display: flex; gap: 1rem; max-width: 400px; margin: 0 auto; }
.newsletter-form input { flex: 1; padding: 0.75rem 1rem; border: none; border-radius: var(--border-radius); font-size: 1rem; }
.newsletter-form button { padding: 0.75rem 1.5rem; background: var(--accent); color: var(--text-dark); border: none; border-radius: var(--border-radius); cursor: pointer; font-weight: 600; transition: var(--transition); }
.newsletter-form button:hover { background: var(--accent-dark); transform: translateY(-2px); }

/* --- 8. Footer (About Section) --- */
.about { background: var(--bg-white); color: var(--text-dark); padding: 80px 20px 0; }
.about-content { max-width: 1200px; margin: 0 auto; text-align: center; }
.about-hero-section { margin-bottom: 50px; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin: 40px 0; }
.about-card { background: var(--bg-white); padding: 30px; border-radius: var(--border-radius-lg); box-shadow: var(--shadow-md); transition: var(--transition); position: relative;  }
.about-card.animate { opacity: 1; transform: translateY(0); animation: slideInUp 0.8s ease forwards; }
.about-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-xl); }
.about-card p { color: var(--text-dark); font-size: 18px; line-height: 1.8; text-align: left; }
.highlight { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 600; }
.about .social-links { display: flex; justify-content: center; gap: 1rem; margin: 2rem 0; }
.about .social-link { width: 50px; height: 50px; background: var(--bg-light); color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 1.2rem; transition: var(--transition); border: 1px solid var(--border-light); }
.about .social-link:hover { background: var(--primary); color: var(--text-light); transform: scale(1.1); }

/* Added "Why Choose Us" section inside footer */
.footer-features-section { margin: 60px 0; text-align: center; }
.footer-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-top: 40px; }
.footer-feature-item { background: rgba(240, 248, 240, 0.7); padding: 30px 20px; border-radius: 15px; transition: all 0.3s ease; transform: translateY(20px); }
.footer-feature-item.animate { opacity: 1; transform: translateY(0); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.footer-feature-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.footer-feature-icon { font-size: 3em; margin-bottom: 15px; display: block; animation: bounce 2s ease-in-out infinite; }
.footer-feature-item h3 { color: var(--primary-dark); margin-bottom: 15px; font-size: 1.2rem; }

/* Copyright Bar */
.copyright { background-color: var(--primary-dark); color: rgba(255, 255, 255, 0.8); padding: 20px; margin-top: 40px; text-align: center; font-size: 0.9rem; }

/* --- 9. Floating Elements & Cart --- */
.back-to-top { position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px; background: var(--gradient-primary); color: var(--text-light); border: none; border-radius: 50%; cursor: pointer; font-size: 1.2rem; transition: var(--transition); opacity: 0; visibility: hidden; transform: translateY(20px); z-index: 1000; }
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-5px); }

.floating-cart { position: fixed; bottom: 100px; right: 30px; z-index: 1000; }
.cart-btn { width: 60px; height: 60px; background: var(--accent); color: var(--text-dark); border: none; border-radius: 50%; cursor: pointer; font-size: 1.5rem; transition: var(--transition); position: relative; box-shadow: var(--shadow-lg); }
.cart-btn:hover { background: var(--accent-dark); transform: scale(1.1); }
.cart-count { position: absolute; top: -5px; right: -5px; background: var(--danger); color: var(--text-light); border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: bold; }
.cart-count.bounce { animation: bounce 0.5s ease; }

.cart-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; opacity: 0; visibility: hidden; transition: var(--transition); }
.cart-modal.show { opacity: 1; visibility: visible; }
.cart-modal-content { position: fixed; top: 0; right: 0; width: 100%; max-width: 400px; height: 100%; background: var(--bg-white); box-shadow: var(--shadow-xl); transform: translateX(100%); transition: var(--transition); display: flex; flex-direction: column; }
.cart-modal.show .cart-modal-content { transform: translateX(0); }
.cart-modal-content h2 { padding: 1.5rem; border-bottom: 1px solid var(--border-light); font-size: 1.5rem; color: var(--primary-dark); }
.close-cart-btn { position: absolute; top: 1.5rem; right: 1.5rem; background: none; border: none; font-size: 2rem; color: var(--text-muted); cursor: pointer; transition: all 0.2s ease; }
.close-cart-btn:hover { color: var(--danger); transform: rotate(90deg); }
.cart-items-container { flex-grow: 1; overflow-y: auto; padding: 1rem; }
.cart-empty-message { text-align: center; color: var(--text-muted); padding: 2rem; }
.cart-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border-light); }
.cart-item img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--border-radius); }
.cart-item-details { flex-grow: 1; }
.cart-item-details h3 { font-size: 1rem; font-weight: 500; margin-bottom: 0.25rem; }
.cart-item-price { color: var(--primary); font-weight: 600; }
.cart-item-quantity { display: flex; align-items: center; gap: 0.5rem; }

/* ✅ THE DEFINITIVE FIX: Using a more specific selector to guarantee styles are applied. */
.cart-item-quantity .quantity-input {
    width: 40px;
    text-align: center;
    border: 1px solid var(--border-light);
    background-color: var(--bg-white);
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    -moz-appearance: textfield;
}
.cart-item-quantity .quantity-input::-webkit-outer-spin-button,
.cart-item-quantity .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-btn { width: 25px; height: 25px; border: 1px solid var(--border-light); background: var(--bg-light); cursor: pointer; font-weight: bold; transition: all 0.2s ease; }
.quantity-btn:hover { background: var(--primary); color: var(--text-light); }
.remove-item-btn { background: none; border: none; color: var(--danger); font-size: 1.2rem; cursor: pointer; transition: all 0.2s ease; }
.remove-item-btn:hover { transform: scale(1.2); }
.cart-footer { padding: 1.5rem; border-top: 1px solid var(--border-light); background: var(--bg-light); }
.cart-total { display: flex; justify-content: space-between; align-items: center; font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; }
.checkout-btn { width: 100%; padding: 0.75rem; background: var(--success); color: var(--text-light); border: none; border-radius: var(--border-radius); font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.checkout-btn:hover { opacity: 0.9; }

/* --- 10. Responsive Design --- */
@media (max-width: 768px) {
  .hamburger { display: flex; cursor: pointer; padding: 5px; }
  .nav-menu { position: fixed; top: 81px; left: 0; width: 100%; background: var(--primary-dark); flex-direction: column; padding: 2rem 0; transition: var(--transition); transform: translateY(-150%); }
  .nav-menu.active { transform: translateY(0); }
  .hero-stats { flex-direction: column; gap: 1.5rem; }
  .features-grid, .products-grid, .about-grid, .footer-features-grid { grid-template-columns: 1fr; }
  .newsletter-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .header-container { padding: 1rem; }
  .hero { padding: 100px 0 60px; }
  .hero-title { font-size: 2rem; }
  .section-title { font-size: 2rem; }
  .product-filter { gap: 0.5rem; }
  .filter-btn { padding: 0.5rem 1rem; font-size: 0.9rem; }
  .cart-modal-content { max-width: 100%; }
}


/* --- 11. Contact Page --- */

.contact-page-main {
    padding: 120px 20px 60px; /* Add padding to account for fixed header */
    background-color: var(--bg-light);
}

.contact-container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

.contact-form-wrapper,
.contact-info-wrapper {
    padding: 40px;
    opacity: 1;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.contact-form-wrapper.visible,
.contact-info-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}
.contact-info-wrapper.visible {
    transition-delay: 0.2s;
}


.contact-form-wrapper {
    border-right: 1px solid var(--border-light);
}

.contact-form-wrapper .section-title {
    text-align: left;
    margin-bottom: 15px;
}
.contact-form-wrapper .section-title::after {
    left: 0;
    transform: translateX(0);
}

.contact-form-wrapper p {
    margin-bottom: 30px;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--primary-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.2);
}

.contact-submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.contact-submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

#responseMsg {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}
#responseMsg.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb;}
#responseMsg.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb;}
#responseMsg.info { background-color: #cce5ff; color: #004085; border: 1px solid #b8daff;}


.contact-info-wrapper {
    background: var(--primary-dark);
    color: var(--text-light);
}

.contact-info-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    display: inline-block;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    font-size: 1rem;
}
.info-item i {
    font-size: 1.5rem;
    color: var(--accent);
    margin-right: 20px;
    width: 30px;
    text-align: center;
}

.map-container {
    width: 100%;
    height: 250px;
    margin-top: 40px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.map-container iframe {
    width: 100%;
    height: 100%;
}

/* Responsive adjustments for contact page */
@media (max-width: 900px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
    .contact-form-wrapper {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
}

/* Style for out-of-stock / pre-order buttons */
.add-to-cart-btn.pre-order {
    background: var(--accent-dark); /* A distinct orange/yellow color */
}
.add-to-cart-btn.pre-order:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}