@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --dark: #0f172a;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-hero: linear-gradient(to right, #f0fdfa 0%, #e0f2fe 100%);
    --white: #ffffff;
    --border: #e2e8f0;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f4f7f6;
    color: var(--text-dark);
    line-height: 1.6;
}

a { text-decoration: none; }
ul { list-style: none; }

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* === MAIN NAVBAR === */
.main-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.5rem 0;
    box-shadow: 0 4px 20px -2px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}
.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}
.nav-links {
    display: flex;
    gap: 2rem;
}
.nav-links a {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--primary); }
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-icon {
    color: var(--text-dark);
    font-size: 1.2rem;
    cursor: pointer;
}
.login-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: color 0.3s;
}
.login-link:hover { color: var(--primary); }

/* Navbar additions */
.nav-center-search {
    flex-grow: 1;
    max-width: 500px;
    margin: 0 2rem;
}
.global-search-form {
    display: flex;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.global-search-form input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 0.6rem 1.2rem;
    outline: none;
    font-size: 0.9rem;
}
.global-search-form button {
    background: transparent;
    border: none;
    padding: 0 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s;
}
.global-search-form button:hover {
    color: var(--primary);
}
.btn-prescription {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #e0f2fe;
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}
.btn-prescription:hover {
    background: var(--primary);
    color: white;
}

/* === USER DROPDOWN === */
.user-dropdown-container {
    position: relative;
    display: inline-block;
    margin-left: 1rem;
}
.user-dropdown-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary);
    padding: 0.5rem 0;
    transition: color 0.2s;
}
.user-dropdown-button:hover {
    color: var(--primary-hover);
}
.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    min-width: 200px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    border: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-dropdown-item {
    padding: 0.8rem 1.2rem;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}
.user-dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}
.user-dropdown-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: var(--text-light);
}
.user-dropdown-item:hover i {
    color: var(--primary);
}
.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

/* === HERO SECTION === */
.hero {
    background: var(--bg-hero);
    padding: 6rem 0 10rem 0;
    text-align: center;
    position: relative;
}
/* Wavy bottom border using SVG data URI */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='1' d='M0,128L48,138.7C96,149,192,171,288,165.3C384,160,480,128,576,133.3C672,139,768,181,864,186.7C960,192,1056,160,1152,144C1248,128,1344,128,1392,128L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}
.hero h1 {
    font-size: 3.5rem;
    color: var(--text-dark);
    font-weight: 800;
    margin-bottom: 2rem;
    line-height: 1.2;
}
.hero-search {
    background: var(--white);
    max-width: 800px;
    margin: 0 auto 2rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}
.hero-search select {
    border: none;
    background: transparent;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    color: var(--text-light);
    border-right: 1px solid var(--border);
    outline: none;
    cursor: pointer;
}
.hero-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    outline: none;
}
.hero-search button {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    padding: 0 1.5rem;
    color: var(--text-light);
    cursor: pointer;
}
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    position: relative;
    z-index: 10;
}
.btn-dark {
    background: var(--dark);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
}
.btn-white {
    background: var(--white);
    color: var(--text-dark);
    padding: 0.8rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* === FEATURES ROW === */
.features-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: -3rem; /* overlap wavy border */
    position: relative;
    z-index: 10;
    margin-bottom: 4rem;
}
.feature-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.feature-icon {
    font-size: 2rem;
}
.feature-content h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}
.feature-content p {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* === PROMO ROW === */
.promo-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 5rem;
}
.promo-card {
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 180px;
}
.bg-blue { background: #e0f2fe; }
.bg-pink { background: #fce7f3; }
.bg-green { background: #dcfce7; }
.bg-yellow { background: #fef9c3; }

.promo-card h5 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}
.promo-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    max-width: 60%;
}
.promo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
}
.promo-link-icon {
    background: var(--dark);
    color: white;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.6rem;
}
.promo-img {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.5;
}

/* === SECTION HEADERS === */
.section-header-center {
    text-align: center;
    margin-bottom: 3rem;
}
.section-header-center h4 {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.section-header-center h2 {
    font-size: 2rem;
    font-weight: 800;
}

/* === CATEGORIES === */
.categories-section {
    margin-bottom: 5rem;
}
.categories-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}
.category-circle {
    width: 100px;
    height: 100px;
    background: #fff8f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    transition: transform 0.3s;
}
.category-item:hover .category-circle {
    transform: translateY(-5px);
}
.category-name {
    font-weight: 600;
    font-size: 0.9rem;
}

/* === DAILY PRODUCTS === */
.products-section {
    background: var(--bg-light);
    padding: 5rem 0;
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}
.product-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
}
.product-card:hover {
    box-shadow: 0 15px 35px rgba(13, 148, 136, 0.1);
    transform: translateY(-5px);
    border-color: rgba(13, 148, 136, 0.3);
}
.product-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: #f43f5e;
    color: white;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 99px;
    font-weight: 700;
    z-index: 10;
}
.product-image {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
}
.product-image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
.product-cat {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 0.2rem;
}
.product-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    line-height: 1.3;
    min-height: 2.6em;
}
.product-stars {
    color: #fbbf24;
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
}
.product-price-row {
    margin-top: auto;
    margin-bottom: 1rem;
}
.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}
.product-price strike {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-left: 0.5rem;
    font-weight: 400;
}
.add-cart {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
    cursor: pointer;
}
.add-cart-icon {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.9rem;
    transition: background 0.3s;
}
.add-cart:hover .add-cart-icon {
    background: var(--primary-hover);
}

/* Form Styles Override for App.razor */
a { text-decoration: none !important; }

/* === CART STYLES === */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: var(--bg-light);
}

.add-cart {
    border: none;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--bg-light);
    color: var(--text-dark);
    font-weight: 600;
    padding: 1rem;
    border-radius: 12px;
    transition: all 0.3s;
    margin-top: 1rem;
}

.add-cart .add-cart-icon {
    background: transparent;
    color: inherit;
    font-size: 1.1rem;
}

.add-cart:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.2);
}
.add-cart.added {
    background: var(--success);
    color: white;
}

/* === MOBILE RESPONSIVENESS === */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}

.grid-responsive-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.grid-responsive-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; }
.cart-grid-responsive { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }

@media (max-width: 1024px) {
    .features-row, .promo-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Navbar */
    .mobile-menu-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 1rem;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
        gap: 1rem;
        border-top: 1px solid var(--border);
    }
    .nav-center-search {
        display: none; /* Hide global search on very small screens, or we can make it full width */
    }
    .nav-links-open {
        display: flex !important;
    }
    .nav-actions .login-link {
        display: inline-block;
        margin-right: 1rem;
    }
    
    /* Responsive Grids */
    .grid-responsive-2, .grid-responsive-3, .grid-responsive-4, .cart-grid-responsive {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    .features-row, .promo-row {
        grid-template-columns: 1fr;
    }
    
    /* Flex responsive */
    .flex-responsive {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1.5rem !important;
    }
    
    /* Trust Banner */
    .trust-banner-scroll {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    
    /* Typography Adjustments */
    .hero-title-responsive {
        font-size: 2.8rem !important;
    }
    .hero-btn-responsive {
        padding: 0.8rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    /* Advancing Science Section */
    .science-badge {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        margin: 0.5rem auto;
    }
    .science-container {
        height: auto !important;
        flex-direction: column;
        gap: 1rem;
        padding: 2rem 0;
    }
    
    /* Search Bar */
    .hero-search {
        flex-direction: column;
        border-radius: 12px !important;
        padding: 0 !important;
        overflow: hidden;
    }
    .hero-search input, .hero-search select, .hero-search button {
        width: 100%;
        border: none !important;
        border-bottom: 1px solid var(--border) !important;
        padding: 1rem !important;
    }
    .hero-search button {
        border-bottom: none !important;
        background: var(--primary) !important;
        color: white !important;
    }
    }
}

/* === SHARED BLOG STYLES === */
.blogs-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: flex-start; }
.blogs-grid > .blog-card { flex: 0 0 calc(33.333% - 1.34rem); width: calc(33.333% - 1.34rem); }
@media (max-width: 992px) { .blogs-grid > .blog-card { flex: 0 0 calc(50% - 1rem); width: calc(50% - 1rem); } }
@media (max-width: 768px) { .blogs-grid > .blog-card { flex: 0 0 100%; width: 100%; } }
.blog-card { background: var(--white); border-radius: 16px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.blog-card:hover { transform: translateY(-8px); box-shadow: 0 12px 25px rgba(0,0,0,0.1); }
.blog-image { height: 220px; overflow: hidden; background: #f1f5f9; }
.blog-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.blog-card:hover .blog-image img { transform: scale(1.05); }
.blog-content { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.blog-meta { display: flex; gap: 1.5rem; font-size: 0.85rem; color: var(--text-light); margin-bottom: 1rem; font-weight: 500; }
.blog-meta i { color: var(--primary); margin-right: 0.3rem; }
.blog-title { font-size: 1.25rem; font-weight: 700; color: var(--dark); margin-bottom: 0.75rem; line-height: 1.4; }
.blog-excerpt { color: var(--text-light); font-size: 0.95rem; line-height: 1.6; margin-bottom: 1.5rem; flex-grow: 1; }
.read-more { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--primary); font-weight: 600; font-size: 0.95rem; transition: gap 0.3s ease; }
.blog-card:hover .read-more { gap: 0.8rem; }