@font-face {
    font-family: 'Sarabun';
    src: url('../fonts/Sarabun-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Sarabun';
    src: url('../fonts/Sarabun-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Sarabun';
    src: url('../fonts/Sarabun-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Sarabun';
    src: url('../fonts/Sarabun-BoldItalic.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
}

@font-face {
    font-family: 'Sarabun';
    src: url('../fonts/Sarabun-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Sarabun';
    src: url('../fonts/Sarabun-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

:root {
    --primary-color: #1b8844;
    --nav-color: #00b050;
    --hover-color: #146332;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --bg-light: #f5f5f5;
    --white: #ffffff;
    --red: #d32f2f;
    --orange: #ff9800;
}

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

body {
    font-family: 'Sarabun', sans-serif;
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.5;
    background-color: #f4f6f9;
    /* Soft background common in e-commerce */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Banner */
.header-banner {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.header-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* Top Bar */
.top-bar {
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    color: var(--text-light);
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 33px;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-small {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.text-green {
    color: var(--primary-color);
    font-weight: 500;
}

.text-underline {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.divider {
    color: #ccc;
    margin: 0 4px;
}

.flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    cursor: pointer;
    opacity: 0.5;
}

.flag.active {
    opacity: 1;
}

.top-bar-right strong {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 14px;
}

/* Main Header */
.main-header {
    background: #005824;
    color: var(--white);
    padding-top: 25px;
}

.header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 15px;
}

.header-inner .logo {
    margin-top: -5px;
    /* Adjusting logo to visually center with the 44px search box */
}

.logo {
    display: block;
    width: 220px;
}

.logo img {
    width: 125%;
    height: auto;
    margin-left: -25px;
}

/* Search Area */
.search-area {
    flex: 1;
    max-width: 650px;
    margin: 0 40px;
    position: relative;
    margin-top: 18px;
}

.search-box {
    display: flex;
    height: 44px;
    background-color: var(--white);
    border-radius: 6px;
    overflow: hidden;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 0 20px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    color: var(--text-color);
}

.search-btn {
    width: 60px;
    background-color: #54b435;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.search-btn:hover {
    background-color: #489b2c;
}

.search-suggestions {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 14px;
}

.search-suggestions a {
    color: var(--white);
    font-weight: 400;
    transition: opacity 0.2s;
}

.search-suggestions a:hover {
    opacity: 0.8;
}

/* Smart Search Dropdown */
.search-suggest-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: none; /* Hiện bằng JS */
    overflow: hidden;
    color: var(--text-color);
}

.suggest-section-title {
    padding: 10px 15px;
    background: #f8f9fa;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
    border-bottom: 1px solid #eee;
}

.suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.suggest-item:hover {
    background: #f9f9f9;
}

.suggest-item:last-child {
    border-bottom: none;
}

.suggest-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
}

.suggest-info {
    flex: 1;
    min-width: 0;
}

.suggest-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.suggest-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--red);
}

.suggest-consult {
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
}

.suggest-view-all {
    display: block;
    padding: 12px;
    text-align: center;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    border-top: 1px solid #eee;
    transition: background 0.2s;
}

.suggest-view-all:hover {
    background: #f0fdf4;
}

.suggest-category {
    padding: 10px 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.suggest-category:hover {
    background: #f9f9f9;
}

.suggest-category i {
    color: var(--primary-color);
    font-size: 12px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 18px;
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    padding: 0 15px;
    height: 44px;
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333333;
    background-color: var(--white);
    font-size: 14px;
    font-weight: 500;
    padding: 0 15px;
    height: 44px;
    border-radius: 6px;
    border: none;
    transition: background-color 0.2s;
}

.cart-btn:hover {
    background-color: #0b381c;
}

.login-btn:hover {
    background-color: #f0f0f0;
}

.icon-cart {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.icon-user {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: invert(36%) sepia(87%) saturate(583%) hue-rotate(107deg) brightness(87%) contrast(92%);
    /* Makes it green approximately */
}

/* Navigation */
.main-nav {
    background: linear-gradient(to right, #005824 0%, #179347 100%);
    border-top: none;
    position: relative;
    overflow: visible;
}

.nav-inner {
    display: flex;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.nav-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    overflow: visible;
    position: relative;
}

.nav-item {
    list-style: none;
}

.nav-item.nav-item-simple {
    position: relative;
}

.nav-list li a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    /* color: var(--white); */
    font-size: 17px;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.nav-list li a:hover {
    color: #000;
    background-color: var(--white);
    border-radius: 6px 6px 0 0;
    opacity: 1;
}

.nav-list li a:hover .arrow-down {
    color: #000;
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Dropdown Menu Styles */

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 100%;
    max-width: 1200px;
    transform: translateX(-50%);
    background: var(--white);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    translate: 0 -10px;
    transition: all 0.3s ease;
    color: var(--text-color);
    z-index: 1000;
    margin: 0;
    padding: 0;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    translate: 0 0;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    translate: 0 0;
}

.dropdown-content {
    display: flex;
    gap: 15px;
    padding: 8px 15px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Dropdown Sidebar */
.dropdown-sidebar {
    width: 250px;
    flex-shrink: 0;
    border-right: 1px solid #f1f1f1;
    padding: 0;
    max-height: 480px;
    overflow-y: auto;
}

/* Custom Scrollbar cho Sidebar */
.dropdown-sidebar::-webkit-scrollbar {
    width: 4px;
}
.dropdown-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.dropdown-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
.dropdown-sidebar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.dropdown-categories {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dropdown-cat-item {
    display: flex;
    align-items: center;
    padding: 6px 15px;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f1f1;
}

.dropdown-cat-item:first-child {
    border-top: 1px solid #e0e0e0;
}

.dropdown-cat-item span {
    font-size: 15px;
    font-weight: 500;
}

.dropdown-cat-item:hover,
.dropdown-cat-item.active {
    background-color: #f8f9fa;
    color: #000;
}

.dropdown-cat-item.active span {
    font-weight: 600;
}

/* Simple Dropdown */
.dropdown-menu.dropdown-simple {
    width: 260px;
    min-width: unset;
    left: 0;
    transform: none;
    border-radius: 0 8px 8px 8px;
}

.dropdown-simple .dropdown-content {
    padding: 0;
    max-width: none;
}

.dropdown-simple-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.dropdown-simple-item {
    border-bottom: 1px solid #e0e0e0;
}

.dropdown-simple-item:last-child {
    border-bottom: none;
}

.dropdown-simple-item a {
    display: block;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-simple-item a:hover {
    background-color: #f8f9fa;
    color: #000;
}

/* Dropdown Products */
.dropdown-products {
    flex: 1;
    min-width: 0;
    padding: 10px 15px;
    background-color: #f8f9fa;
}

/* Sub-nav Pills */
.dropdown-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.subnav-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #333;
    font-size: 13px;
    transition: all 0.2s;
    text-decoration: none;
}

.subnav-pill img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.subnav-pill:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-color: #ccc;
}

.dropdown-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.header-title-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-products-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.separator {
    color: #ccc;
    font-size: 18px;
}

.view-all {
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    text-decoration: none;
}

.header-nav-arrows {
    display: flex;
    gap: 8px;
}

.nav-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 12px;
    transition: all 0.2s;
}

.nav-arrow:hover {
    background: #f0f0f0;
    color: #333;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.product-card {
    background: var(--white);
    border-radius: 12px;
    padding: 15px;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f1f1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.product-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
    border-color: #0b7a3e;
}

.product-image {
    position: relative;
    width: 100%;
    height: 180px;
    margin-bottom: 15px;
    background-color: transparent;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discount-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #eb7c23;
    color: #fff;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 0 0 12px 0;
    z-index: 2;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card h5 {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
    min-height: 42px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card h5 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-card h5 a:hover {
    color: #156835; /* Hover sang màu xanh thương hiệu */
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.price-old {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
}

.price-new {
    font-size: 18px;
    font-weight: 700;
    color: #eb7c23; /* Flash Sale Orange */
}

.btn-add-cart {
    width: 100%;
    height: 46px;
    background-color: #156835; 
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
}

.btn-add-cart:hover {
    background-color: #0e4d26;
    box-shadow: 0 6px 15px rgba(21, 104, 53, 0.3);
    transform: scale(1.02);
}

.btn-add-cart:disabled {
    background-color: #d1d5db;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-consult {
    background-color: #2563eb;
}

.btn-consult:hover {
    background-color: #1d4ed8;
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.25);
}

.catalog-rx-note {
    color: #6b7280;
    font-size: 14px;
}

.price-new small {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .dropdown-content {
        flex-direction: column;
    }

    .dropdown-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .dropdown-categories {
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
    }

    .dropdown-cat-item {
        min-width: 150px;
    }
}


.arrow-down {
    width: 12px;
    height: 12px;
    object-fit: contain;
    color: var(--white);
    font-size: 12px;
    transition: transform 0.3s ease;
}

/* ================= Hero Section ================= */
.hero-section {
    padding-top: 20px;
    padding-bottom: 20px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
}

.hero-slider {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.slider-images {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
    height: 100%;
}

.main-slide {
    min-width: 100%;
    width: 100%;
    height: auto;
    display: block;
}

.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.slider-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: background-color 0.2s;
}

.slider-btn:hover {
    background-color: rgba(255, 255, 255, 1);
}

.slider-btn img {
    width: 14px;
    height: 14px;
}

.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active,
.dot:hover {
    background-color: var(--primary-color);
}

.hero-side-banners {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.side-banner {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
}

.side-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ================= Feature Shortcuts ================= */
.feature-shortcuts {
    margin-bottom: 30px;
}

.shortcut-list {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.shortcut-item {
    flex: 1;
    display: flex;
    align-items: center;
    background-color: var(--white);
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.shortcut-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.icon-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.icon-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ================= Product Sections ================= */
.product-section {
    margin-bottom: 30px;
    border-radius: 12px;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.product-section-header {
    text-align: center;
    margin-bottom: 15px;
}

.product-section-header img {
    width: calc(100% + 2px);
    height: auto;
    display: block;
    margin: 0 -1px;
}

/* Green Background for overall container */
.bg-green-container {
    background-color: #125c2e;
    padding: 0 0 15px !important;
    border-radius: 12px;
}

.bg-yellow-container {
    background-color: #ffc107;
    padding: 0 0 15px !important;
    border-radius: 12px;
}

.bg-red-container {
    background-color: #d32f2f;
    padding: 0 0 15px !important;
    border-radius: 12px;
}

.bg-white-container {
    background-color: #ffffff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 15px;
    background-color: var(--white);
    border-radius: 8px;
}

.bg-green-container .product-grid,
.bg-yellow-container .product-grid,
.bg-red-container .product-grid {
    margin: 0 10px;
}

.product-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--orange);
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    margin-bottom: 10px;
}

.product-title {
    font-size: 15px;
    color: var(--text-color);
    line-height: 1.4;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}

.product-price-old {
    font-size: 14px;
    color: var(--text-light);
    text-decoration: line-through;
    margin-bottom: 2px;
}

.product-price-new {
    font-size: 18px;
    color: var(--orange);
    font-weight: 700;
    margin-bottom: 10px;
    flex-grow: 1;
}

.add-to-cart-btn {
    width: 100%;
    background-color: #125c2e;
    color: var(--white);
    border: none;
    padding: 8px 0;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.add-to-cart-btn:hover {
    background-color: #0b381c;
}

.view-all-btn {
    display: block;
    text-align: center;
    color: var(--white);
    margin-top: 15px;
    font-size: 14px;
    font-weight: 500;
}

.view-all-btn:hover {
    text-decoration: underline;
}

/* ================= Top Thương Hiệu ================= */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color);
}

.top-brands-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 15px;
    margin-bottom: 30px;
}

.top-brands-grid .banner-large {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.brand-banner {
    display: block;
    border-radius: 8px;
    overflow: hidden;
}

.brand-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.brand-banner:hover img {
    transform: scale(1.02);
}

/* ================= Danh Mục Sản Phẩm ================= */
.categories-section {
    background-color: var(--white);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.categories-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.categories-header img {
    height: 24px;
}

.categories-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.category-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.category-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 10px;
}

.category-item span {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
}

/* ================= Tìm Kiếm Hàng Đầu ================= */
.top-searches-section {
    background-color: var(--white);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.top-searches-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-color);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-item {
    padding: 8px 15px;
    background-color: #f5f5f5;
    color: var(--text-color);
    font-size: 13px;
    border-radius: 20px;
    transition: background-color 0.2s, color 0.2s;
}

.tag-item:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* ================= Pre-Footer Promises ================= */
.promises-section {
    background-color: #e5f5ed;
    padding: 20px 0;
}

.promises-list {
    display: flex;
    justify-content: space-between;
}

.promise-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.promise-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.promise-item span {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
}

.promise-item p {
    font-size: 14px;
    color: var(--text-color);
    margin-top: 2px;
}

/* ================= Newsletter ================= */
.newsletter-section {
    background-color: #f0f0f0;
    padding: 15px 0;
    margin-bottom: 0;
}

.newsletter-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.newsletter-text {
    font-size: 16px;
    color: var(--text-color);
    font-weight: 500;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    width: 400px;
}

.newsletter-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 15px;
    outline: none;
}

.newsletter-form button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.newsletter-form button:hover {
    background-color: var(--hover-color);
}

/* ================= Main Footer ================= */
.main-footer {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f1f5 100%);
    border-top: 3px solid var(--primary-color);
}

.footer-main {
    padding: 50px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-col {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-title i {
    font-size: 18px;
}

.contact-block {
    margin-bottom: 16px;
}

.contact-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.contact-value {
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.6;
}

.contact-value a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.contact-value a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.footer-links li::before {
    content: "→";
    color: var(--primary-color);
    margin-right: 8px;
    font-weight: bold;
    font-size: 14px;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.footer-links a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-links a:hover::after {
    width: 100%;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--border-color);
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 18px;
}

.social-icon:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(27, 136, 68, 0.2);
}

.social-icon.facebook:hover {
    border-color: #1877f2;
}

.social-icon.tiktok:hover {
    border-color: #000;
}

.social-icon.youtube:hover {
    border-color: #ff0000;
}

.payment-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.payment-icons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.payment-icons img {
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.2s;
    cursor: pointer;
}

.payment-icons img:hover {
    transform: scale(1.1);
}

.footer-bottom {
    background: var(--text-color);
    color: var(--white);
    padding: 25px 0;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}

.footer-bottom p {
    margin: 6px 0;
}

.footer-bottom strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-title {
        font-size: 14px;
    }
}

.shortcut-item span {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
}

/* Extracted Component Styles from benh-chuyen-khoa.html */
/* Bottom Sections */
.bottom-sections {
    margin-top: 40px;
    border-top: 1px solid #e5e7eb;
    padding-top: 40px;
}

/* Tra cứu theo nhóm bệnh */
.disease-groups-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 20px;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.group-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    text-decoration: none;
    transition: all 0.2s;
    display: block;
}

.group-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.group-card img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-bottom: 20px;
}

.group-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 6px;
}

.group-card p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* Top Searches */
.top-searches-section {
    margin-bottom: 40px;
}

.top-search-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.top-search-links a {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.15s;
}

.top-search-links a:hover {
    border-color: #0b7a3e;
    color: #0b7a3e;
    background: #f0fdf4;
}

.catalog-widget-loading {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

/* Featured products */
.featured-products-section {
    margin-bottom: 50px;
}

.catalog-featured-viewport {
    overflow: hidden;
    width: 100%;
}

.catalog-featured-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 16px;
    align-items: stretch;
    transition: transform 0.35s ease;
    will-change: transform;
}

.catalog-featured-track .product-card {
    flex: 0 0 calc((100% - 64px) / 5) !important;
    max-width: calc((100% - 64px) / 5);
    min-width: 0 !important;
}

.catalog-featured-track .product-image {
    height: 180px !important;
    aspect-ratio: auto !important;
    margin-bottom: 15px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.feat-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: all 0.2s;
    position: relative;
}

.feat-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-3px);
}

.feat-card .feat-img {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feat-card .feat-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.feat-card .feat-name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feat-card .feat-price {
    font-size: 15px;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 12px;
}

.feat-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 8px 0;
    background: #0b7a3e;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s;
}

.feat-btn:hover {
    background: #096332;
}

@media (max-width: 1200px) {
    .catalog-featured-track .product-card {
        flex-basis: calc((100% - 32px) / 3);
    }
}

@media (max-width: 900px) {
    .catalog-featured-track .product-card {
        flex-basis: calc((100% - 16px) / 2);
    }
}

@media (max-width: 640px) {
    .catalog-featured-track .product-card {
        flex-basis: 100%;
    }
}

/* ================= MEGA MENU PRODUCT GRID ================= */
/* Đồng bộ kích thước chuẩn Flash Sale, tối ưu để không bị tràn khung */

.dropdown-products {
    min-height: 480px; /* Giữ chiều cao ổn định khớp với chiều cao tối đa của sidebar */
}

.dropdown-products .products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 920px; /* Khống chế để không tràn ra ngoài sidebar */
    min-height: 325px; /* Giữ chỗ trước cho 4 sản phẩm tránh sụt giảm chiều cao */
    position: relative;
}

.dropdown-products .products-grid .product-card {
    padding: 12px; /* Nhỏ hơn một chút để vừa 4 cột */
    min-width: 0;   /* Cho phép card co lại theo grid */
}

.dropdown-products .products-grid .product-image {
    height: 150px; /* Cân đối chiều cao với chiều rộng 4 cột */
}

.dropdown-products .products-grid .btn-add-cart {
    height: 38px;
    font-size: 14px;
}

/* Hiệu ứng loading Skeleton cho Mega Menu */
.skeleton {
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

.skeleton-img, .skeleton-text, .skeleton-btn {
    background: #e2e8f0;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-img::after, .skeleton-text::after, .skeleton-btn::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.6) 40%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.dropdown-products .products-grid .skeleton-img {
    width: 100%;
    height: 150px; /* Khớp chiều cao thực tế của card */
    margin-bottom: 15px;
}

.skeleton-title {
    height: 14px;
    width: 80%;
    margin-bottom: 8px;
    margin-top: 4px;
}

.skeleton-title-2 {
    height: 14px;
    width: 50%;
    margin-bottom: 16px;
}

.skeleton-price {
    height: 18px;
    width: 60%;
    margin-bottom: 15px;
}

.dropdown-products .products-grid .skeleton-btn {
    width: 100%;
    height: 38px; /* Khớp chiều cao thực tế của nút */
    margin-top: auto;
}

/* Hiệu ứng hiển thị mượt mà khi load xong sản phẩm */
@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-card {
    animation: fadeInCard 0.25s ease-out forwards;
}
