/*
    Sachtony CSS Stylesheet
    - Cấu trúc lại theo từng phần để dễ đọc và bảo trì.
    - Sử dụng biến CSS để quản lý màu sắc và font nhất quán.
    - Cải thiện tính đáp ứng (responsive) cho các thiết bị.
    
*/

/* ======================================= */
/* 1. GLOBAL STYLES & VARIABLES (Cập nhật) */
/* ======================================= */
:root {
    /* Màu sắc */
    --primary-color: #4b5563; /* grey-700 */
    --secondary-color: #1f2937; /* grey-800 */
    --accent-color: #2563eb; /* blue-600 */
    --light-bg-color: #f9fafb; /* grey-50 */
    --card-bg-color: #ffffff; /* white */
    --border-color: #e5e7eb; /* grey-200 */
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --btn-success: #28a745;
    --btn-danger: #dc3545;
    --btn-action-color: #04AA6D;
    --header-bg: #f8f8f8;
    --footer-bg: #222;

    /* Kích thước & Font */
    --header-height: 60px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Reset và Box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

html,
body {
    display: flex;
    flex-direction: column;    
    background-color: var(--light-bg-color);    
}

.app-container {
    padding: auto;
}

/* ========================================= */
/* ====== 2. HEADER & NAVIGATION ====== */
/* ========================================= */

.app-header {
    background-color: var(--header-bg);
    box-shadow: var(--shadow-light);
    width: 100%;
    z-index: 1;
}

.topnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    flex-wrap: wrap; /* Allows for wrapping on smaller screens */
}


#mybrands {
    display: flex;
    align-items: center;
}

#mybrands img {
    height: 40px;
    margin-right: 10px;
}

#mybrands .brand-text {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--secondary-color);
    text-decoration: none;
    
}


#myLinks {
    display: flex;
    gap: 20px;
    align-items: center;
}

#myLinks a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 17px;
    padding: 10px 0;
    transition: color 0.3s ease;
}

#myLinks a:hover {
    color: var(--accent-color);
}

.country-selector-wrapper {
    position: relative;
    width: 200px; /* Điều chỉnh chiều rộng theo ý muốn */
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

.country-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--card-bg-color);
    font-size: 16px;
    color: var(--secondary-color);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%236B7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.country-select:hover {
    border-color: var(--accent-color);
}

.country-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* New styles for member links */
.nav-member {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between login and signup links */
}

.nav-btn-member {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--secondary-color);
    background-color: transparent;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.nav-btn-member:hover {
    background-color: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

/* Hamburger Menu (hidden on large screens) */
.block.lg\:hidden {
    display: none;
}

#nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

#nav-toggle svg {
    width: 24px;
    height: 24px;
    fill: var(--secondary-color);
}

/* Giỏ hàng */
#cart {
    position: relative;
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-duration);
}

#cart:hover {
    color: var(--primary-color);
}

#cart i {
    font-size: 1.5rem;
}

.cart-count-badge {
    position: absolute;    
    background-color: red;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 6px;
    border: 1px solid var(--background-color);
}


/* ======================================= */
/* ====== 3. MAIN CONTENT SECTIONS ====== */
/* ======================================= */

.main-content {
    flex-grow: 1; /* Cần thiết để main-content chiếm hết chiều cao còn lại */
    display: flex;
    flex-direction: column;
    
}

.main-section {
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out;    
    flex-direction: column;
    
}

.main-section.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.tab-buttons {
    display: flex;
    overflow-x: auto; /* Quan trọng: Đảm bảo container này có thể cuộn */
    white-space: nowrap; /* Quan trọng: Ngăn các nút xuống dòng */
    -webkit-overflow-scrolling: touch; /* Cải thiện trải nghiệm cuộn trên iOS */
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    padding: 0 10px;
    background-color: var(--card-bg-color);
    border-radius: 8px 8px 0 0;
    box-shadow: var(--shadow-light);
}

.tab-buttons::-webkit-scrollbar {
    display: none; /* Ẩn thanh cuộn trên trình duyệt WebKit */
}

.tab-button {
    flex-shrink: 0; /* Quan trọng: Ngăn các nút bị co lại khi hết không gian */
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--secondary-color);
    background-color: transparent;    
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease-in-out;
}

.tab-button.active {
    color: var(--accent-color);
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
}

.tab-content {
    /* Loại bỏ overflow: hidden để tránh cắt nội dung */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center; /* Căn giữa nội dung form theo chiều ngang */
    justify-content: center; /* Căn giữa nội dung form theo chiều dọc */
}

.tab-pane {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
    opacity: 0;
    visibility: hidden;
    width: 100%;
    
}

.tab-pane.active {
    display: block;
    opacity: 1;
   visibility: visible;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ======================================= */
/* 4. COUNTRY & FORM STYLES */
/* ======================================= */

.country-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}

.country-header h1 {
    font-size: 1.5em;
    color: var(--btn-action-color);
    margin: 0;
    white-space: nowrap;
}

.country-header .flags {
    width: 24px;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.phone-input-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.phone-input-group input[readonly] {
    width: 100px;
    flex-shrink: 0;
    background-color: var(--light-bg-color);
    cursor: default;
}

.phone-input-group input[type="tel"] {
    flex-grow: 1;
}

/* ======================================= */
/* 5. SHOP SECTION (FINAL) */
/* ======================================= */
.product-listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.listing-item {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg); /* Sử dụng shadow-lg để nhất quán */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.listing-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2); /* Tăng độ nổi bật khi hover */
}

.listing-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.listing-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.listing-title {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--secondary-color); /* Dùng secondary-color để tương phản tốt hơn */
}

.listing-price {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--accent-color);
    margin-top: auto; /* Đơn giản hơn, không cần margin-bottom */
    margin-bottom: 10px;
}

.btn-add-to-cart {
    background-color: var(--btn-action-color);
    color: var(--card-bg-color); /* Dùng biến cho màu trắng */
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600; /* Bolder text on the button */
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-add-to-cart:hover {
    background-color: #1e52c2;
    transform: translateY(-1px); /* Thêm hiệu ứng nổi nhẹ khi di chuột */
}


/* ======================================= */
/* DROPUP MENU (Floating) 

.dropup-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
}

.dropbtn {
    background-color: var(--btn-action-color);
    color: white;
    padding: 15px;
    font-size: 20px;
    border: none;

    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;

}

.dropbtn:hover {
    background-color: #059b63;
    transform: translateY(-2px);
}

.dropup-content {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.dropup-menu:hover .dropup-content {
    display: block;
    transform: translateY(0);
    opacity: 1;
}
*/
/* ======================================= */

/* ======================================= */
/* 6. FOOTER STYLING */
/* ======================================= */

.app-footer {
    background-color: var(--footer-bg);
    color: white;
    padding: 30px 20px;
    text-align: center;
    width: 100%;
    margin-top: 40px;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 0 10px;
    max-width: 1200px;
    width: 100%;
}

.footer-container p {
    font-size: 14px;
    color: #bbb;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;

}

.social-links a {
    color: white;
    font-size: 26px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--btn-action-color);
}


.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    
}

.footer-nav a {
    color: #a0aec0;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.footer-nav a:hover {
    color: #ffffff;
}

/* ======================================= */
/* 7. RESPONSIVE MEDIA QUERIES */
/* ======================================= */

/* Responsive styles for mobile */
@media screen and (max-width: 768px) {
    .topnav {
        flex-wrap: wrap; /* Ensures the nav wraps when collapsed */
        padding: 10px 15px;
    }
    
    #myLinks, .nav-member {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: left;
        background-color: var(--light-bg-color);
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: var(--shadow-light);
        z-index: 1;
    }
    
    #myLinks.responsive, .nav-member.responsive {
        display: flex;
    }
    
    /* Position the nav-member directly after myLinks */
    #myLinks.responsive {
        border-bottom: 1px solid var(--border-color);
    }
    
    #myLinks.responsive + .nav-member.responsive {
        position: relative;
        top: 0;
        left: 0;
        box-shadow: none;
        border-top: none;
    }

    #myLinks a, #myLinks .country-selector-wrapper, .nav-btn-member {
        padding: 15px 20px;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    
    .country-selector-wrapper {
        margin-left: 0;
    }

    .country-select {
        width: 100%;
    }
    
    .nav-btn-member {
        border: none; /* Remove border on mobile for cleaner look */
        text-align: left;
        background-color: transparent;
    }

    .nav-btn-member:hover {
        background-color: var(--border-color); /* Light background on hover */
        color: var(--accent-color);
    }
    
    .block.lg\:hidden {
        display: block;
    }
}

/* ======================================= */
/* ====== 8. AUTHENTICATION (Login & Signup) (FINAL) ====== */
/* ======================================= */

.login-form,
.registration-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
    padding: 30px;
    background-color: var(--card-bg-color);
    border-radius: 12px; /* A softer, more modern border-radius */
    box-shadow: var(--shadow-lg); /* Use a more prominent shadow for depth */
}

/* Form section title */
.section-title {
    text-align: center;
    color: var(--primary-color); /* Use a darker color for better contrast */
    margin-top: 0;
    margin-bottom: 24px; /* Increased margin for better visual separation */
    font-size: 2em;
    font-weight: 700; /* Bolder for prominence */
}

.auth-country-select {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.auth-country-select label,
.form-group label {
    font-size: 0.9em;
    color: var(--primary-color);
    font-weight: 600; /* Bolder font for better readability and accessibility */
}

/* General styling for input fields and select dropdowns */
.login-form input,
.registration-form input,
.auth-country-select .country-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px; /* Slightly adjusted border-radius for consistency */
    font-size: 16px;
    color: var(--primary-color);
    background-color: var(--light-bg-color); /* Add a light background for subtle contrast */
    transition: all 0.3s ease; /* Use 'all' for smoother transitions */
}

.login-form input:focus,
.registration-form input:focus,
.auth-country-select .country-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25); /* Increase shadow size for a more pronounced focus state */
}

/* Phone number input group */
.phone-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

#login-phone-code,
#signup-phone-code {
    width: auto;
    min-width: 80px; /* Slightly increase min-width for better display */
    padding: 12px;
    flex-shrink: 0;
    text-align: center;
    background-color: var(--light-bg-color);
    cursor: default;
}

#login-phone-number,
#signup-phone-number {
    flex-grow: 1;
}

/* Form group container */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Styling for login and signup buttons */
.btn-login,
.btn-signup {
    width: 100%;
    padding: 14px 20px; /* Increased padding for a larger touch target */
    font-size: 1rem; /* Use 'rem' for better scalability */
    font-weight: 700; /* Bolder font weight */
    color: var(--card-bg-color); /* Use variable for white color */
    background-color: var(--accent-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-login:hover,
.btn-signup:hover {
    background-color: #1e52c2;
    transform: translateY(-2px);
}

/* Styling for error messages */
.error-message {
    font-size: 0.8em;
    color: var(--btn-danger); /* Use variable for consistency */
    display: none;
    margin-top: 5px; /* Adjust margin to be consistent with other gaps */
}

/* Responsive rules for forms */
@media screen and (max-width: 500px) {
    .login-form,
    .registration-form {
        padding: 20px;
        margin: 0 10px;
    }

    .phone-input-group {
        flex-direction: column;
        gap: 0;
    }

    .phone-input-group input {
        border-radius: 5px;
        margin-top: 10px;
    }
    
    .phone-input-group .country-select {
        margin-top: 0; /* Align with label on top */
    }

    #login-phone-code,
    #signup-phone-code {
        width: 100%;
        min-width: unset;
    }
    
}

/* ========================================= */
/* ====== 9. Aside Style (FINAL) ====== */
/* ========================================= */

.main-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1002;
    pointer-events: none;
}

.toggleBtn {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1003;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background-color: var(--btn-action-color);
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background-color 0.3s ease;
    pointer-events: auto;
}

.toggleBtn:hover {
    transform: translateY(-50%) translateY(-2px);
    background-color: #1e52c2;
}

.aside-toggle {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -300px;
    width: 300px;
    background-color: var(--primary-color);
    z-index: 1002;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

/* Ẩn/hiện menu bằng transform */
.main-menu.show .toggleBtn {
    visibility: hidden;
    opacity: 0;
    display: none;
}

.main-menu.show .aside-toggle {
    transform: translateX(-100%);
}

.toggle-menu {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.toggle-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px; /* Thống nhất padding */
}

/* Ẩn thanh cuộn khi không cần thiết */
.toggle-content::-webkit-scrollbar {
    width: 5px;
    height: 5px;
    background: transparent;
}
.toggle-content::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}
.toggle-content:hover::-webkit-scrollbar-thumb {
    background: var(--accent-color);
}

.category-group {
    display: block;
    /* Loại bỏ padding: auto; và margin: auto; */
    padding-bottom: 20px; /* Khoảng cách cho mỗi nhóm */
    margin-bottom: 20px;  /* Khoảng cách tách các nhóm */
    border-bottom: 1px solid var(--border-color);
}
.category-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.category-title {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--light-bg-color);
    padding: 10px 0;
    display: block;
    margin-bottom: 5px;
}
.nav-link {
    display: flex;

    align-items: center;
    text-decoration: none;
    color: var(--light-bg-color);
    padding: 12px 15px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.nav-link i {
    flex-shrink: 0;
    width: 25px;
    text-align: center;
    margin-right: 15px;
    
}

.nav-link span {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

.nav-link:hover {
    background-color: var(--secondary-color);
}

/* ========================================= */
/* ====== HOME SECTION ====== */
/* ========================================= */

/* Tiêu đề các phần */
.section-title {
    font-size: 2em;
    font-weight: bold;
    color: var(--secondary-color);
    margin-top: 40px;
    margin-bottom: 20px;
    text-align: center;
}

/* Banner chính */
.main-banner-container {
    margin-bottom: 40px;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.main-banner {
    width: 100%;
    position: relative;
}

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

.banner-content {
    position: absolute;
    top: 50%;
    left: 50px;
    transform: translateY(-50%);
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    max-width: 50%;
}

.banner-title {
    font-size: 2.5em;
    font-weight: bold;
    margin: 0 0 10px 0;
}

.banner-text {
    font-size: 1.2em;
    margin: 0 0 20px 0;
}

.btn-primary {
    padding: 12px 24px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #e04b4c;
}

/* Lưới danh mục */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: var(--secondary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    background-color: var(--card-bg-color);
    box-shadow: var(--shadow-light);
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.category-item img {
    width: 100%;
    max-width: 150px;
    height: auto;
    margin-bottom: 15px;
    border-radius: var(--border-radius);
}

.category-item h3 {
    font-size: 1.2em;
    font-weight: bold;
    margin: 0;
}

a {
    text-decoration: none;
}

/* ======================================= */
/* ----     CART SECTION   ------- */
/* ======================================= */

.cart-container {
    padding: 2rem 1rem;
    max-width: 800px;
    margin: 0 auto;
    background-color: #f9fafb;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cart-container .main-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100px; /* Đảm bảo có chiều cao tối thiểu */
    position: relative;
}

.cart-empty-message {
    text-align: center;
    font-style: italic;
    color: #9ca3af;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;

}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.cart-item-price {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    background-color: #e5e7eb;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 1rem;
    color: #4b5563;
    transition: background-color 0.2s;
}

.quantity-btn:hover {
    background-color: #d1d5db;
}

.item-quantity {
    font-weight: 600;
    color: #1f2937;
    min-width: 20px;
    text-align: center;
}

.cart-item-total {
    font-size: 1rem;
    font-weight: 700;
    color: #1a73e8; /* Màu xanh nổi bật cho tổng tiền từng sản phẩm */
}

.remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.remove-btn:hover {
    color: #dc2626;
}

.cart-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e5e7eb;
}

.cart-total-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.cart-total-amount {
    color: #1a73e8;
    font-weight: 700;
}

.btn-checkout {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #1a73e8;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-checkout:hover {
    background-color: #155bb5;
}

.btn-checkout:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* ======================================= */
/* --------  COUNTRY SECTION    ------   */
/* ======================================= */

#countrySection .app-country {
    display: none; /* Ẩn tất cả các quốc gia con */
}

#countrySection .app-country.active {
    display: block; /* Hiển thị quốc gia được chọn */
    padding-top: 20px; /* Tạo khoảng cách với phần trên */
}

.country-header {
    display: flex;
    align-items: center;
    justify-content: center; /* Căn giữa để nhất quán với section-title */
    gap: 20px;
    margin-bottom: 30px;
}

.country-header h1 {
    font-size: 2em;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
}

.flags {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    border-radius: 50%; /* Làm cờ tròn */
    box-shadow: var(--shadow-light);
}

.welcome-message {
    font-size: 3em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ======================================= */
/* --------  MODAL    ------   */
/* ======================================= */
/* Container chứa các modal */
#modalContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Thêm thuộc tính này để mặc định không chặn tương tác */
    pointer-events: none;
}
.modal {
    display: none;
    position: fixed;
    z-index: 100; /* Đặt z-index cao hơn để modal hiển thị trên lớp phủ */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    padding-top: 50px;
    pointer-events: auto; /* Bật lại tương tác cho modal */
}

/* Hộp thoại modal */
.modal-dialog {
    position: relative;
    margin: 10% auto;
    width: 90%;
    max-width: 500px;
    animation: fadeIn 0.3s ease-in-out;
}

/* Nội dung bên trong hộp thoại */
.modal-content {
    background-color: #fefefe;
    border-radius: 8px;
    border: 1px solid #888;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* Phần tiêu đề modal */
.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

/* Nút đóng modal */
.close-button {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.close-button:hover,
.close-button:focus {
    color: #000;
    text-decoration: none;
}

/* Phần nội dung chính của modal */
.modal-body {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
}

/* Phần chân modal */
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    text-align: right;
}

/* Kiểu dáng cho nút "Ok" */
.btn-primary {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: #0056b3;
}

/* Hiệu ứng chuyển động */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.modal-brand-logo {
    height: 36px;
    width: auto;
    margin-right: 12px;
}