/* Design System Redesign */
:root {
    --primary-color: #177c41; /* Darker green matching the mockup */
    --primary-light: #e8f5eb;
    --teal: #106670; /* The button color on top right */
    --teal-dark: #0b4e56;
    --text-dark: #333333;
    --text-light: #666666;
    --bg-main: #f9f9f9;
    --bg-card: #f0f0f0;
    --white: #ffffff;
    --border-color: #eaeaea;
    --red-badge: #d32f2f;
    --green-badge: #2e7d32;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Roboto', Arial, sans-serif; color: var(--text-dark); background-color: var(--white); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Buttons */
.btn { display: inline-block; padding: 8px 18px; border-radius: 6px; font-weight: 600; cursor: pointer; transition: var(--transition); border: none; font-size: 0.9rem; }
.btn-primary { background-color: var(--primary-color); color: var(--white); }
.btn-primary:hover { background-color: #126333; }
.btn-teal { background-color: var(--teal); color: var(--white); border-radius: 20px; padding: 8px 20px;}
.btn-teal:hover { background-color: var(--teal-dark); }
.btn-block { display: block; width: 100%; text-align: center; padding: 12px;}
.btn-outline-gray { border: 1px solid #ddd; background-color: var(--white); color: var(--text-dark); width: 100%; padding: 10px; font-weight: 600; border-radius: 6px; }
.btn-outline-gray:hover { background-color: #f5f5f5; border-color: #ccc;}
.btn-mau2 { background-color: #056c39; color: var(--white); width: 100%; padding: 10px; font-weight: 600; border-radius: 6px; transition: 0.2s; border: none;}
.btn-mau2:hover { background-color: #044b28; color: var(--white); }

/* Header */
.header { background-color: var(--white); box-shadow: 0 1px 5px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100; padding: 12px 0; }
.header-container { display: flex; justify-content: space-between; align-items: center; position: relative; }
.logo { display: flex; align-items: center; }
.nav ul { list-style: none; display: flex; gap: 25px; margin-left: 20px;}
.nav > ul > li { position: relative; }
.nav > ul > li.mega-dropdown { position: static; }
.nav a { font-weight: 600; font-size: 0.95rem; color: var(--text-dark); transition: color 0.2s; display: flex; align-items: center; gap: 5px; padding: 10px 0; }
.nav a:hover { color: var(--primary-color); }

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 250px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 200;
    padding: 10px 0;
    border: 1px solid var(--border-color);
}
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu li {
    width: 100%;
}
.dropdown-menu a {
    padding: 10px 20px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-dark);
    display: block;
    transition: 0.2s;
}
.dropdown-menu a:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding-left: 25px;
}

/* Mega Menu */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 200;
}
.mega-dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.mega-menu-inner {
    display: flex;
    min-height: 400px;
}
.mega-menu-left {
    width: 25%;
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    max-height: 500px;
    overflow-y: auto;
}
.mega-menu-right {
    width: 75%;
    padding: 20px 30px;
    background-color: #fcfcfc;
    border-radius: 0 8px 8px 0;
}
.mega-category-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
}
.mega-category-list li {
    padding: 0;
    width: 100%;
}
.mega-category-list a {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dark);
    font-weight: 600;
    transition: 0.2s;
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mega-category-list li.active a, .mega-category-list a:hover {
    background-color: #e8f5eb;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}
.mega-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}
.mega-product-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.mega-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: #d0d0d0;
}
.mega-product-img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
}
.mega-product-title {
    font-size: 0.85rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    flex-grow: 1;
    color: var(--text-dark);
}
.mega-product-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #056c39;
}

.search-bar { position: relative; flex-grow: 1; max-width: 350px; margin: 0 20px; }
.search-bar input { width: 100%; padding: 10px 15px 10px 40px; border-radius: 20px; border: 1px solid #eee; background-color: #f5f5f5; outline: none; font-family: inherit; font-size: 0.9rem;}
.search-bar input:focus { border-color: #ccc; background-color: var(--white);}
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #888; font-size: 0.9rem; }

/* Hero Banner */
.hero-banner { padding: 30px 0; text-align: center; background-color: var(--white); }
.banner-img { width: 100%; max-width: 1200px; height: auto; display: block; margin: 0 auto; border-radius: 12px;}
.zalo-widget { position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px; background-color: #0068ff; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.8rem; box-shadow: 0 4px 15px rgba(0,104,255,0.4); cursor: pointer; animation: bounce 2s infinite; z-index: 9999; }
.zalo-widget:hover { background-color: #005ce6; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 40% {transform: translateY(-10px);} 60% {transform: translateY(-5px);} }

/* Sections */
.products-section { padding: 40px 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.section-title { font-size: 1.4rem; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 10px; }
.view-all { font-size: 0.85rem; color: var(--primary-color); font-weight: 600; }
.section-subtitle { font-size: 0.9rem; color: var(--text-light); margin-bottom: 25px; }

/* Grid */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card { background: var(--white); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; position: relative; padding: 15px; transition: var(--transition); }
.product-card:hover { box-shadow: var(--shadow-hover); border-color: #d0d0d0; transform: translateY(-3px);}

.product-img-wrapper { background-color: var(--bg-card); border-radius: 8px; padding: 20px; text-align: center; margin-bottom: 15px; position: relative; height: 200px; display: flex; align-items: center; justify-content: center;}
.product-image { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply;}
.badge { position: absolute; top: 10px; left: 10px; color: white; font-size: 0.65rem; font-weight: 700; padding: 4px 8px; border-radius: 4px; }
.badge.hot { background-color: var(--red-badge); }
.badge.aus { background-color: var(--green-badge); }

.product-category { font-size: 0.65rem; color: #888; text-transform: uppercase; margin-bottom: 8px; font-weight: 700; letter-spacing: 0.5px;}
.product-title { font-size: 0.95rem; font-weight: 700; line-height: 1.4; margin-bottom: 12px; flex-grow: 1; color: var(--text-dark); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-size: 1.1rem; font-weight: 700; color: var(--primary-color); margin-bottom: 15px; }

/* Health Guide */
.health-guide-section { padding: 40px 0 60px; background-color: var(--bg-main); border-top: 1px solid var(--border-color); margin-top: 20px; }
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.blog-card { background: var(--white); border-radius: 12px; overflow: hidden; border: 1px solid var(--border-color); box-shadow: 0 2px 8px rgba(0,0,0,0.02);}
.blog-img-wrapper { height: 220px; overflow: hidden; }
.blog-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.blog-card:hover img { transform: scale(1.05); }
.blog-content { padding: 20px; }
.blog-category { font-size: 0.7rem; color: #1976d2; font-weight: 700; display: block; margin-bottom: 12px; }
.blog-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; line-height: 1.4; }
.blog-desc { font-size: 0.9rem; color: var(--text-light); margin-bottom: 15px; line-height: 1.6;}
.read-more { font-size: 0.9rem; color: var(--primary-color); font-weight: 600; }
.read-more:hover { text-decoration: underline; }

/* Footer */
.footer { background-color: #e9ecef; color: var(--text-dark); padding: 50px 0 30px; }
.footer-container { display: grid; grid-template-columns: 2fr 1.5fr 1.5fr; gap: 40px; margin-bottom: 40px; }
.footer-logo { font-size: 1.2rem; font-weight: 700; margin-bottom: 15px; color: var(--text-dark); }
.footer-col h3 { margin-bottom: 20px; font-size: 1.1rem; color: var(--text-dark); font-weight: 700;}
.footer-col p { font-size: 0.9rem; color: #555; margin-bottom: 10px; line-height: 1.6;}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 12px; }
.footer-col a { font-size: 0.9rem; color: #555; }
.footer-col a:hover { color: var(--primary-color); }
.footer-bottom { text-align: center; border-top: 1px solid #dcdcdc; padding-top: 20px; font-size: 0.85rem; color: #777; }

/* Bestseller Frame */
#products-hot .container {
    background-color: #e3f0e6;
    border-radius: 12px;
    padding: 50px 20px 30px 20px;
    border: 2px solid #c9e3cf;
    box-shadow: 0 15px 40px rgba(5,108,57,0.1);
    position: relative;
    margin-top: 30px;
}

#products-hot .container::before,
#products-hot .container::after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    color: #177c41;
    opacity: 0.04;
    z-index: 0;
    pointer-events: none;
}

#products-hot .container::before {
    content: "\e47b"; /* fa-pills */
    font-size: 200px;
    top: -20px;
    left: -40px;
    transform: rotate(20deg);
}

#products-hot .container::after {
    content: "\e556"; /* fa-capsules (viên nang) */
    font-size: 250px;
    bottom: -50px;
    right: -40px;
    transform: rotate(-15deg);
}

#products-hot .section-header, 
#products-hot .section-subtitle, 
#products-hot .product-grid {
    position: relative;
    z-index: 1;
}

/* Aus, USA, JP, CA, FR Products Frame */
#products-aus .container,
#products-usa .container,
#products-jp .container,
#products-ca .container,
#products-fr .container {
    background-color: #f4f9fc;
    border-radius: 12px;
    padding: 50px 20px 30px 20px;
    border: 2px solid #e3eff5;
    box-shadow: 0 15px 40px rgba(16, 102, 112, 0.05);
    position: relative;
    margin-top: 30px;
}

#products-aus .container::before,
#products-aus .container::after,
#products-usa .container::before,
#products-usa .container::after,
#products-jp .container::before,
#products-jp .container::after,
#products-ca .container::before,
#products-ca .container::after,
#products-fr .container::before,
#products-fr .container::after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    color: #106670;
    opacity: 0.04;
    z-index: 0;
    pointer-events: none;
}

#products-aus .container::before,
#products-usa .container::before,
#products-jp .container::before,
#products-ca .container::before,
#products-fr .container::before {
    content: "\f072"; /* fa-plane */
    font-size: 200px;
    top: -20px;
    left: -40px;
    transform: rotate(25deg);
}

#products-aus .container::after,
#products-usa .container::after,
#products-jp .container::after,
#products-ca .container::after,
#products-fr .container::after {
    content: "\e47b"; /* fa-pills */
    font-size: 250px;
    bottom: -50px;
    right: -40px;
    transform: rotate(-15deg);
}

#products-aus .section-header, 
#products-aus .section-subtitle, 
#products-aus .product-grid,
#products-usa .section-header, 
#products-usa .section-subtitle, 
#products-usa .product-grid,
#products-jp .section-header, 
#products-jp .section-subtitle, 
#products-jp .product-grid,
#products-ca .section-header, 
#products-ca .section-subtitle, 
#products-ca .product-grid,
#products-fr .section-header, 
#products-fr .section-subtitle, 
#products-fr .product-grid {
    position: relative;
    z-index: 1;
}

.section-title-centered {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 10px 40px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Slider Logic */
.slider-wrapper {
    position: relative;
    width: 100%;
}

.product-grid.slider {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding-bottom: 20px; /* For shadow */
    scrollbar-width: none; /* Firefox */
}

.product-grid.slider::-webkit-scrollbar {
    display: none; /* Chrome */
}

.product-grid.slider .product-card {
    flex: 0 0 calc(25% - 12px);
    min-width: 240px;
    scroll-snap-align: start;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 5;
    color: #555;
    transition: 0.2s;
}

.slider-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.slider-btn.prev-btn {
    left: -22px;
}

.slider-btn.next-btn {
    right: -22px;
}

/* Seasonal Diseases */
.seasonal-section {
    padding: 60px 0 20px 0;
    background-color: var(--bg-main);
}
.seasonal-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.disease-container {
    background: transparent;
}
.disease-tabs {
    display: flex;
    gap: 0;
    background: transparent;
    padding: 0 10px;
    overflow-x: auto;
    scrollbar-width: none;
}
.disease-tabs::-webkit-scrollbar { display: none; }
.disease-tab-btn {
    padding: 15px 35px;
    background: white;
    border: none;
    font-size: 1.05rem;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    border-radius: 12px 12px 0 0;
    transition: 0.3s;
    white-space: nowrap;
    margin-right: 5px;
}
.disease-tab-btn.active {
    background: #056c39;
    color: white;
}
.disease-content-layout {
    display: flex;
    background: #056c39;
    padding: 25px;
    border-radius: 12px;
    gap: 20px;
    min-height: 420px;
    box-shadow: 0 10px 30px rgba(5,108,57,0.3);
}
.disease-info-box {
    flex: 0 0 32%;
    background: white;
    border-radius: 15px;
    padding: 40px 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.02);
}
.disease-info-box::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 80px; height: 80px;
    background: #eef5e9;
    border-radius: 20px 0 15px 0;
    clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}
.disease-desc {
    font-size: 1rem;
    line-height: 1.7;
    color: #4a5c37;
    margin-bottom: 30px;
    flex-grow: 1;
}
.disease-desc strong {
    font-weight: 700;
    color: #056c39;
}
.btn-discover {
    background: #056c39;
    color: white;
    align-self: flex-start;
    border-radius: 30px;
    padding: 12px 30px;
    font-weight: 600;
    z-index: 2;
    position: relative;
    font-size: 0.95rem;
    box-shadow: none;
}
.disease-robot-img {
    position: absolute;
    bottom: -15px;
    left: -15px;
    width: 140px;
    z-index: 3;
}
.disease-products-wrapper {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}
.disease-products-wrapper .product-grid.slider {
    padding-bottom: 5px;
    align-items: stretch;
}
.disease-products-wrapper .product-card {
    min-width: 200px;
    flex: 0 0 calc(33.333% - 10px);
    height: auto;
}
@media (max-width: 900px) {
    .disease-content-layout {
        flex-direction: column;
    }
    .disease-info-box {
        flex: none;
        min-height: 350px;
    }
    .disease-robot-img {
        width: 100px;
        bottom: 0;
        left: auto;
        right: 10px;
    }
    .disease-products-wrapper .product-card {
        min-width: 220px;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .header-container { flex-wrap: wrap; gap: 15px; justify-content: center;}
    .search-bar { order: 3; max-width: 100%; width: 100%; margin: 10px 0 0;}
    .nav ul { gap: 15px; margin: 0;}
    .product-grid, .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-container { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .product-grid, .blog-grid { grid-template-columns: 1fr; }
}

/* Category Top Grid for products.html */
.category-top-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 15px;
    margin-bottom: 40px;
}
.cat-grid-item {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-dark);
}
.cat-grid-item:hover, .cat-grid-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(23,124,65,0.15);
    transform: translateY(-3px);
}
.cat-grid-item i {
    font-size: 24px;
    color: var(--primary-color);
}
.cat-grid-item span {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
}
@media (max-width: 1024px) {
    .category-top-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 768px) {
    .category-top-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}
@media (max-width: 480px) {
    .category-top-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Sort Buttons */
.sort-btn-group {
    display: flex;
    gap: 10px;
}
.sort-btn {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: 0.2s;
}
.sort-btn:hover, .sort-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}
