/* ==========================================================================
   STYLE.CSS - Cửa Hàng Tạp Hóa Sạch
   Màu chủ đạo: #1b4d3e (xanh lục đậm)
   ========================================================================== */

/* --------------------------------------------------------------------------
   RESET & BASE
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
}

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

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* --------------------------------------------------------------------------
   LAYOUT HELPER
   -------------------------------------------------------------------------- */
.container-flex {
    width: 80%;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

/* --------------------------------------------------------------------------
   TOP BAR
   -------------------------------------------------------------------------- */
#top {
    width: 100%;
    height: 48px;
    background-color: #1b4d3e;
}

#top-content {
    justify-content: space-between;
    height: 48px;
}

#top-left {
    color: #fff;
    line-height: 48px;
    font-size: 13px;
}

#top-right {
    color: #fff;
    line-height: 48px;
    font-size: 13px;
    text-align: right;
}

#top-right a {
    color: #fff;
    font-weight: bold;
    transition: color 0.2s;
}

#top-right a:hover {
    color: #ffd700;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   HEADER
   -------------------------------------------------------------------------- */
#header {
    width: 100%;
    height: 200px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

#banner {
    height: 100%;
    gap: 0;
}

#logo {
    height: 100%;
    flex: 1;
    display: flex;
    align-items: center;
}

#logo img {
    margin-top: 0;
    max-height: 160px;
}

/* Chính sách giao hàng / hỗ trợ / giờ mở cửa */
#deliver,
#support,
#time {
    height: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#deliver > div,
#support > div,
#time > div {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

#deliver img,
#support img,
#time img {
    max-width: 42px;
}

/* Giỏ hàng */
#cart {
    height: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

#cart-content {
    display: inline-block;
    width: 180px;
    height: 60px;
    background-color: #1b4d3e;
    color: #fff !important;
    border-radius: 30px;
    line-height: 60px;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.25s;
}

#cart-content:hover {
    background-color: #145c3a;
    text-decoration: none;
}

/* Tiêu đề trang (đăng nhập / đăng ký) */
.header-title-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title-page h2 {
    color: #1b4d3e;
    font-size: 26px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   NAVIGATION MENU
   -------------------------------------------------------------------------- */
#menu {
    background-color: #1b4d3e;
    border-radius: 6px;
    overflow: hidden;
}

#menu ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

#menu ul li a {
    display: block;
    color: #fff;
    padding: 14px 22px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.2s;
    text-decoration: none;
}

#menu ul li a:hover,
#menu ul li.active a {
    background-color: #145c3a;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   WRAPPER
   -------------------------------------------------------------------------- */
#wrapper {
    width: 80%;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   SIDEBAR - DANH MỤC
   -------------------------------------------------------------------------- */
#list-cate {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
}

#list-cate h3 {
    background-color: #1b4d3e;
    color: #fff;
    text-align: center;
    margin: 0;
    padding: 15px 0;
    font-size: 16px;
    text-transform: uppercase;
}

.cate-item {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

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

.cate-item a {
    display: block;
    padding: 12px 20px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
}

.cate-item:hover {
    background-color: #f0faf5;
}

.cate-item a:hover {
    color: #1b4d3e;
    padding-left: 28px;
    font-weight: bold;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   SLIDESHOW
   -------------------------------------------------------------------------- */
#slideshow {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
}

#slideshow img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

/* --------------------------------------------------------------------------
   PRODUCTS SECTION
   -------------------------------------------------------------------------- */
.products-section {
    margin-top: 40px;
}

.cate {
    margin-bottom: 40px;
}

.cate-title {
    background-color: #1b4d3e;
    color: #fff;
    padding: 12px 20px;
    font-size: 18px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    position: relative;
}

.cate-title:hover {
    background-color: #145c3a;
}

.cate-title::after {
    content: "▼";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: transform 0.3s;
}

.list-product {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 0;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px;
}

.col-product {
    flex: 0 0 calc(25% - 12px);
    min-width: 180px;
}

/* --------------------------------------------------------------------------
   PRODUCT CARD
   -------------------------------------------------------------------------- */
.product {
    background-color: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    transition: box-shadow 0.25s, transform 0.25s;
    cursor: pointer;
    height: 100%;
}

.product:hover,
.product.active {
    box-shadow: 0 6px 20px rgba(27,77,62,0.15);
    transform: translateY(-4px);
    border-color: #1b4d3e;
}

.product .photo {
    width: 100%;
    max-width: 160px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.product .name {
    font-size: 14px;
    font-weight: bold;
    color: #222;
    margin: 8px 0 4px;
    min-height: 38px;
    line-height: 1.3;
}

.product .price {
    font-size: 15px;
    font-weight: bold;
    color: #1b4d3e;
    margin: 4px 0 10px;
}

/* --------------------------------------------------------------------------
   NÚT "CHỌN MUA"
   -------------------------------------------------------------------------- */
.buy {
    display: inline-block;
    width: 100%;
    padding: 9px 0;
    background-color: #1b4d3e;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s, transform 0.1s;
}

.buy:hover {
    background-color: #145c3a;
    transform: scale(1.03);
}

.buy:active {
    transform: scale(0.98);
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
#footer {
    width: 100%;
    background-color: #1b4d3e;
    color: #fff;
    padding-top: 40px;
    font-family: Arial, sans-serif;
    margin-top: 50px;
}

.footer-columns {
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}

.footer-col {
    flex: 1;
    min-width: 180px;
}

.footer-col h3 {
    font-size: 15px;
    margin-bottom: 16px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 8px;
}

.footer-desc {
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 8px;
    color: #c8e6d4;
}

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

.footer-links li {
    line-height: 2.2;
    font-size: 13px;
}

.footer-links a {
    color: #c8e6d4;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #ffd700;
    text-decoration: none;
}

/* Footer bottom bar */
.footer-bottom {
    width: 100%;
    background-color: #0f3328;
    margin-top: 40px;
    padding: 15px 0;
    font-size: 13px;
}

.footer-bottom-inner {
    width: 80%;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.footer-bottom a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
}

.footer-bottom a:hover {
    color: #ffd700;
}

/* --------------------------------------------------------------------------
   FORM PAGES (ĐĂNG NHẬP / ĐĂNG KÝ)
   -------------------------------------------------------------------------- */
.form-wrapper {
    width: 100%;
    min-height: calc(100vh - 330px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background-color: #f5f5f5;
}

.form-container {
    width: 100%;
    max-width: 500px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    overflow: hidden;
}

.form-header {
    background-color: #1b4d3e;
    color: #fff;
    text-align: center;
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background-color: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: #1b4d3e;
    box-shadow: 0 0 0 3px rgba(27,77,62,0.1);
    background-color: #fff;
}

.form-control::placeholder {
    color: #aaa;
}

.required {
    color: #1b4d3e;
}

/* Radio buttons */
.form-radio-group {
    display: flex;
    gap: 24px;
    margin-top: 6px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal !important;
    cursor: pointer;
    font-size: 14px;
}

.radio-label input[type="radio"] {
    accent-color: #1b4d3e;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Checkbox */
.checkbox-group label {
    font-weight: normal !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    accent-color: #1b4d3e;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 13px;
    background-color: #1b4d3e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 1px;
    margin-top: 6px;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-submit:hover {
    background-color: #145c3a;
}

.btn-submit:active {
    transform: scale(0.99);
}

/* Form footer links */
.form-footer-links {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: #555;
}

.link-register {
    color: #1b4d3e;
    font-weight: bold;
    text-decoration: none;
}

.link-register:hover {
    text-decoration: underline;
}

.link-forgot {
    color: #888;
    text-decoration: none;
    font-size: 13px;
}

.link-forgot:hover {
    color: #1b4d3e;
    text-decoration: underline;
}

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

/* --------------------------------------------------------------------------
   GIỎ HÀNG
   -------------------------------------------------------------------------- */
.cart-wrapper {
    background-color: #fff;
    border-radius: 10px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.cart-table thead {
    background-color: #1b4d3e;
    color: #fff;
}

.cart-table th {
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

.cart-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}

.cart-table tbody tr:hover {
    background-color: #f0faf5;
}

.cart-table td {
    padding: 14px 16px;
    text-align: center;
    font-size: 14px;
    vertical-align: middle;
}

.cart-table td img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

/* Nút xóa */
.btn-delete {
    padding: 7px 16px;
    background-color: #1b4d3e;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-delete:hover {
    background-color: #0f3328;
}

/* --------------------------------------------------------------------------
   RESPONSIVE - TABLET (≤ 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .container-flex,
    #wrapper,
    #header > div {
        width: 95%;
    }

    .col-product {
        flex: 0 0 calc(33.333% - 12px);
    }
}

/* --------------------------------------------------------------------------
   RESPONSIVE - MOBILE (≤ 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    #top-content {
        flex-direction: column;
        height: auto;
        padding: 8px 0;
    }

    #top-left,
    #top-right {
        line-height: 1.6;
        text-align: center;
        width: 100%;
    }

    #header {
        height: auto;
        padding: 16px 0;
    }

    #banner {
        flex-wrap: wrap;
        gap: 10px;
        padding: 0 10px;
        width: 95%;
    }

    #logo,
    #deliver,
    #support,
    #time {
        flex: 0 0 48%;
    }

    #cart {
        flex: 0 0 100%;
        justify-content: center;
    }

    #menu ul {
        flex-wrap: wrap;
    }

    #menu ul li a {
        padding: 10px 14px;
        font-size: 12px;
    }

    #wrapper,
    .container-flex {
        width: 95%;
    }

    /* Ẩn sidebar, chỉ hiện slideshow */
    #list-cate {
        display: none;
    }

    #slideshow {
        width: 100% !important;
    }

    .col-product {
        flex: 0 0 calc(50% - 8px);
    }

    .form-body {
        padding: 20px;
    }

    .cart-table th,
    .cart-table td {
        padding: 8px;
        font-size: 12px;
    }

    .footer-columns {
        width: 95%;
        flex-direction: column;
    }

    .footer-col {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .col-product {
        flex: 0 0 100%;
    }

    .header-title-page h2 {
        font-size: 18px;
    }
}
