/*
Theme Name: TheWhite Clone - Pure Code
Theme URI: https://theme.thewhite.vn
Author: Custom by Grok
Description: Clone thewhite.vn - Cart khoảng cách sát (18px) như Savoy gốc
Version: 2.6
Text Domain: thewhite-clone
*/

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: #111;
    line-height: 1.6;
}

/* HEADER */
.header-main {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.header-inner {
    max-width: 100%;
    padding: 15px 40px;
    display: flex;
    align-items: center;
}

.logo {
    flex-shrink: 0;
}

.main-menu {
    margin-left: 55px;
}

.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #111;
    text-decoration: none;
}

.nav-menu a:hover {
    color: #000;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 25px;
}

/* ==================== CART GIỐNG SAVOY GỐC (position: relative) ==================== */
.cart-link {
    font-weight: 500;
    color: #111;
    text-decoration: none;
    font-size: 15px;
    letter-spacing: 0.5px;
    padding-right: 16px;   /* Khoảng cách tự nhiên như Savoy */
}

.cart-count {
    position: relative;
    top: -7px;
    display: inline-block;
    font-size: 15px;
    font-weight: 500;
    color: #111;
}

/* MOBILE: Chỉ (3) ngay sau hamburger */
@media (max-width: 1024px) {
    .cart-text { display: none; }
    
    .cart-count {
        position: static;
        top: auto;
        padding: 0 3px 0 6px;
    }
    .cart-count::before { content: "("; }
    .cart-count::after { content: ")"; }
}

/* ==================== SUBMENU BẢN 2.0 (giữ nguyên) ==================== */
.nav-menu li {
    position: relative;
}

.nav-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: -25px;
    background: #ffffff;
    min-width: 245px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    padding: 15px 0;
    z-index: 1000;
    text-align: left;
    white-space: nowrap;
}

.nav-menu .sub-menu a {
    display: block;
    padding: 9px 25px;
    font-size: 14px;
    color: #111;
    text-decoration: none;
}

.nav-menu .sub-menu a:hover {
    background: #f9f9f9;
}

@media (min-width: 1025px) {
    .nav-menu li:hover > .sub-menu {
        display: block;
    }
}

/* HAMBURGER + MOBILE MENU */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #fff;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
}

.mobile-menu .mobile-nav {
    list-style: none;
    padding: 0;
}

.mobile-menu .mobile-nav a {
    display: block;
    padding: 15px 0;
    font-size: 18px;
    color: #111;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
}

@media (max-width: 1024px) {
    .main-menu { display: none; }
    .hamburger { display: block; }
    .header-inner { padding: 15px 20px; }
}

/* ==================== PRODUCT GRID SẠCH – THEWHITE THEME ==================== */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 0 40px;
    margin-top: 40px;
    align-items: start;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    list-style: none;
}

/* Mobile */
@media (max-width: 1024px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 0 20px;
        margin-top: 30px;
    }
}

/* Wrapper ảnh */
.woocommerce ul.products li.product a.woocommerce-loop-product__link {
    display: block;
    position: relative;
    padding-top: 125%;
    overflow: hidden;
}

.woocommerce ul.products li.product img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}