* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

.navbar {
    display: flex;
    justify-content: space-between;
    background-color: #333;
    padding: 5px 20px;
    position: sticky;
    z-index: 10;
    top: 0px;
    box-shadow: 0 0 15px;
}

.navbar a {
    color: white;
    text-decoration: none;
    padding: 10px;
}

.navbar a:hover {
    background-color: #575757;
}

.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #444;
    min-width: 160px;
    top: 25px;
    z-index: 1;
}

.dropdown-content a {
    display: block;
    padding: 10px;
    color: white;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.slider img {
    width: 100%;
    height: auto;
    display: block;
}

#title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: 10px 20px;
}

#title a {
    text-decoration: none;
    color: #e91e63;
    font-size: 16px;
    margin-bottom: 3px;
    font-style: italic;
}

#title a:hover {
    color: #333;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.product-section {
    padding: 20px;
}

.product-section h2 {
    margin-top: 40px;
    color: #333;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.product {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
    border-radius: 10px;
}

.product img {
    width: 50%;
    height: auto;
}

.product h3 {
    margin: 10px 0;
    font-size: 16px;
}

.product p {
    color: #e91e63;
    font-weight: bold;
}

.product a {
    border-radius: 10px;
    padding: 8px 16px;
    background-color: #333;
    color: white;
    text-decoration: none;
}

.product a:hover {
    background-color: #e91e63;
}

.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px;
}

/* Responsive cho màn hình nhỏ hơn 768px */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-left,
    .navbar-right {
        flex-direction: column;
        width: 100%;
    }

    .navbar a {
        padding: 10px 15px;
        width: 100%;
    }

    .dropdown-content {
        position: static;
        background-color: #444;
    }

    .slider img {
        height: auto;
    }

    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .product {
        padding: 10px;
    }
}

/* Responsive cho màn hình rất nhỏ (điện thoại dưới 480px) */
@media (max-width: 480px) {
    .product-list {
        grid-template-columns: 1fr;
    }

    .navbar a {
        font-size: 14px;
    }

    .product h3 {
        font-size: 15px;
    }

    .product p {
        font-size: 14px;
    }

    .product button {
        font-size: 14px;
        padding: 6px 12px;
    }

    .footer {
        font-size: 14px;
        padding: 15px;
    }
}

.menu-toggle {
    display: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        margin-bottom: 10px;
    }

    #navbar-left,
    #navbar-right {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    #navbar-left.active,
    #navbar-right.active {
        display: flex;
    }
}

.category-body {
    display: flex;
    padding: 20px;
    gap: 20px;
}

.sidebar {
    flex: 1;
    max-width: 250px;
    background-color: #f2f2f2;
    padding: 15px;
    border: 1px solid #ddd;
}

.sidebar h3 {
    margin-top: 0;
}

.sidebar input[type="text"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
}

.product-area {
    flex: 3;
}

.product-area h2 {
    margin-bottom: 20px;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
}

.product h3 {
    margin: 10px 0;
}

.product p {
    color: #e91e63;
    font-weight: bold;
}

.product button {
    padding: 8px 16px;
    background-color: #333;
    color: white;
    border: none;
    cursor: pointer;
}

.product button:hover {
    background-color: #e91e63;
}

/* Responsive */
@media (max-width: 768px) {
    .category-body {
        flex-direction: column;
    }

    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .product-list {
        grid-template-columns: 1fr;
    }
}

/* ================= FORM ĐĂNG NHẬP & ĐĂNG KÝ ================= */

.form-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

.form-container h1 {
    margin-bottom: 20px;
    color: #333;
}

#formLogin label,
#formRegister label,
#formProfile label {
    font-weight: bold;
    color: #333;
    display: block;
    text-align: left;
    margin-bottom: 5px;
}

#formLogin input,
#formRegister input,
#formProfile input {
    width: 100%;
    padding: 10px 0;
    padding-left: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

#formLogin button,
#formRegister button,
#formProfile button {
    width: 100%;
    padding: 10px;
    background-color: #333;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

#formLogin button:hover,
#formRegister button:hover,
#formProfile button:hover {
    background-color: #e91e63;
}

#formLogin a,
#formRegister a,
#formProfile a {
    display: inline-block;
    margin-top: 15px;
    color: #e91e63;
    text-decoration: none;
}

#formLogin a:hover,
#formRegister a:hover,
#formProfile a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .form-container {
        margin: 20px;
        padding: 15px;
    }
}

/* ================= CHI TIẾT SẢN PHẨM ================= */

.product-detail {
    display: flex;
    gap: 100px;
    max-width: 1000px;
    margin: 50px auto;
    padding: 20px;
    /* background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px; */
    flex-wrap: wrap;
    /* để responsive khi màn hình nhỏ */
}

.product-detail img {
    width: 100%;
    max-width: 300px;
    /* border: 1px solid #ccc;
    border-radius: 5px; */
    object-fit: cover;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 50px;
}

.product-info h1 {
    margin-bottom: 10px;
    color: #333;
}

.product-info p {
    margin: 5px 0;
    color: #555;
}

.product-info .price {
    color: #ff5722;
    margin-top: 15px;
}

.product-info #productSale {
    font-size: 20px;
    font-weight: bold;
    color: #e91e63;
    margin-bottom: 15px;
}

.product-info #variantSelect {
    padding: 10px;
    width: 450px;
    margin: 10px 0;
}

.product-info button {
    padding: 10px 20px;
    background-color: #333;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 3px;
    margin-top: 15px;
    width: fit-content;
}

.product-info button:hover {
    background-color: #e91e63;
}

/* Responsive */
@media (max-width: 768px) {
    .product-detail {
        flex-direction: column;
        align-items: center;
    }

    .product-detail img {
        max-width: 100%;
    }

    .product-info {
        width: 100%;
    }

    .product-info .variants {
        justify-content: center;
    }
}


/* ================= GIỎ HÀNG ================= */

.cart-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th,
.cart-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: center;
}

.cart-table img {
    width: 60px;
    height: auto;
}

.cart-total {
    text-align: right;
    margin-top: 20px;
}

.cart-total .checkout-btn {
    padding: 10px 20px;
    background-color: #333;
    color: white;
    border: none;
    cursor: pointer;
}

.cart-total .checkout-btn:hover {
    background-color: #e91e63;
}

.checkout-container {
    max-width: 500px;
    margin: 20px auto;
    background-color: #f9f9f9;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.checkout-container label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.checkout-container input,
.checkout-container textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    margin-bottom: 15px;
}

.checkout-container button {
    width: 100%;
    padding: 10px;
    background-color: #333;
    color: white;
    border: none;
    cursor: pointer;
}

.checkout-container button:hover {
    background-color: #e91e63;
}

.selectPage {
    padding: 6px 10px;
    margin: 0 3px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    color: #333;
    border-radius: 3px;
    cursor: pointer;
}

.selectPage:hover {
    background-color: #ddd;
}

.selectPage.active {
    background-color: #999;
    color: #fff;
}

.toast-msg {
    position: fixed;
    top: 20px;
    /* cách trên 20px */
    left: 50%;
    /* căn giữa ngang */
    transform: translateX(-50%) translateY(-50px);
    /* bắt đầu ở trên */
    background-color: rgba(21, 255, 0, 0.85);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    animation: slideDown 2s forwards;
    font-size: 16px;
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-50px);
        /* ở trên màn hình */
    }

    10% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
        /* trượt xuống vị trí chính */
    }

    90% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
        /* giữ nguyên */
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-50px);
        /* trượt lên và biến mất */
    }
}

.toast-msg2 {
    position: fixed;
    top: 20px;
    /* cách trên 20px */
    left: 50%;
    /* căn giữa ngang */
    transform: translateX(-50%) translateY(-50px);
    /* bắt đầu ở trên */
    background-color: rgba(255, 68, 68, 0.85);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    animation: slideDown 2s forwards;
    font-size: 16px;
}


/* banner */
#banner{
    width: 100%;
    height: 400px;
    object-fit: cover;
    opacity: 0.95;
}
