body{
  margin: 0;
}
/* 1. Phần khung chính của Header */
.menu_bar {
    background: #2F5D50;               /* Màu xanh bác chọn */
    border-bottom: 1px solid #25483E;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    position: sticky;
    top: 0;
    z-index: 999;
    color: #e0f2f1;
}

/* 2. Căn chỉnh bố cục Navbar */
.navbar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* 3. Logo và Slogan */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
}

.logo img {
    border-radius: 8px;
    transition: transform 0.25s ease;
}

.logo img:hover {
    transform: scale(1.08);
}

.logo a {
    text-decoration: none;
    color: #e0f2f1;
}

.logo span {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #d1eae6;
    display: block;
}

.logo p {
    font-size: 0.78rem;
    color: #b2dfdb;
    margin: 2px 0 0;
    font-weight: 400;
}

/* 4. Thanh tìm kiếm (Search Bar) - Nút nằm khít bên trong */
.search-bar {
    flex: 1;
    max-width: 580px;
    min-width: 240px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar input {
    width: 100%;
    height: 46px; 
    padding: 12px 60px 12px 20px;      /* Chừa khoảng trống bên phải cho nút */
    font-size: 15px;
    border: 1.5px solid #3A6F60;
    border-radius: 9999px; 
    outline: none;
    background: #35665A;               /* Nền tối hơn màu chính một chút */
    color: #ffffff;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.search-bar input::placeholder {
    color: #b2dfdb;
}

.search-bar input:focus {
    border-color: #4A8F7E;
    background: #ffffff;               /* Chuyển nền trắng khi gõ để dễ nhìn */
    color: #1a3c33;
    box-shadow: 0 0 0 3px rgba(74, 143, 126, 0.25);
}

/* Nút tìm kiếm dính sát lề phải */
.search-bar button {
    position: absolute;
    right: 0px;                        /* Khít hoàn toàn vào viền phải */
    top: 0;
    bottom: 0;
    width: 55px;
    background: #4A8F7E;               /* Màu sáng làm điểm nhấn */
    color: white;
    border: none;
    /* Bo tròn phải để khớp với input, bên trái để thẳng đứng */
    border-radius: 0 9999px 9999px 0; 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.search-bar button:hover {
    background: #3A7A6A;
}

#search-form {
    width: 100%;       /* Chiếm toàn bộ chiều ngang của .search-bar */
    display: flex;      /* Kích hoạt flex để quản lý input bên trong */
    position: relative; /* Quan trọng: Để nút button absolute căn theo form này */
}

/* 5. Menu chức năng (Login, Cart) */
.menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.menu a {
    text-decoration: none;
    color: #e0f2f1;
    font-size: 14.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.menu a:hover {
    background: rgba(58, 122, 106, 0.25);
    color: #ffffff;
}

/* Giỏ hàng và Badge số lượng */
.menu a.cart {
    position: relative;
}

.menu a.cart .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #3A7A6A;
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 6. Responsive cho di động và máy tính bảng */
@media (max-width: 992px) {
    .navbar {
        flex-wrap: wrap;
    }
    .search-bar {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
    }
}

@media (max-width: 576px) {
    .logo span { font-size: 1.35rem; }
    .menu a { font-size: 13px; padding: 6px 8px; }
}


/* ========================================
   HEADER MOBILE REDESIGN
   ======================================== */
@media (max-width: 768px) {
    
    /* Header compact hơn */
    .menu_bar {
        padding: 0;
    }
    
    .navbar {
        padding: 10px 16px;
        gap: 12px;
        flex-wrap: nowrap;
    }
    
    /* Logo: chỉ icon + tên, ẩn slogan */
    .logo {
        min-width: auto;
        gap: 8px;
        flex-shrink: 0;
        order: 1;
    }
    
    .logo img {
        width: 36px;
        height: 36px;
    }
    
    .logo span {
        font-size: 1.15rem;
        letter-spacing: -0.3px;
    }
    
    .logo p {
        display: none;
    }
    
    /* Search: ẩn form desktop, chỉ hiện icon mobile */
    .search-bar {
        order: 2;
        flex: 0 0 auto;
        max-width: none;
        min-width: auto;
        position: static;
        margin-left: auto;
    }
    
    /* Ẩn form desktop, hiện button mobile */
    .search-bar form,
    .search-bar #search-form,
    .search-bar input,
    .search-bar #search-btn-desktop {
        display: none !important;
    }
    
    #search-btn-mobile {
        display: flex !important;
        position: static;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: rgba(74, 143, 126, 0.2);
        border: none;
        color: #e0f2f1;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 16px;
    }
    
    #search-btn-mobile:active {
        background: #4A8F7E;
    }
    
    /* Menu: ẩn text trên mobile, chỉ giữ icon */
    .menu {
        gap: 8px;
        flex-shrink: 0;
        order: 3;
    }
    
    .menu .login-text,
    .menu .user-name {
        display: none;
    }
    
    .menu a {
        padding: 8px;
        min-width: 40px;
        justify-content: center;
    }
    
    .menu a i {
        margin: 0;
    }
}

/* Desktop: ẩn search mobile button */
@media (min-width: 769px) {
    #search-btn-mobile {
        display: none !important;
    }
}


/* ========================================
   SEARCH OVERLAY (MOBILE)
   ======================================== */
#search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 20px 40px;
    animation: fadeIn 0.3s ease;
}

#search-overlay-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #e0f2f1;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#search-overlay-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.search-overlay-form {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-overlay-form input[type="text"] {
    width: 100%;
    height: 56px;
    padding: 0 20px;
    font-size: 18px;
    border: 2px solid #4A8F7E;
    border-radius: 12px;
    background: #fff;
    color: #1a3530;
    outline: none;
    box-sizing: border-box;
}

.search-overlay-form input[type="text"]::placeholder {
    color: #7aa89e;
}

.search-overlay-form button {
    height: 52px;
    background: #2F5D50;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.search-overlay-form button:hover {
    background: #4A8F7E;
    transform: translateY(-2px);
}


/* ========================================
   MENU CSS - DESKTOP
   ======================================== */

/* Menu nằm ngay dưới header sticky */
#header3 {
    background: #25483E;
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid #1a3530;
    position: sticky;
    top: 0;
    z-index: 998;
    width: 100%;
}

/* Nav chính */
#nav {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 1280px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0 20px;
}

#nav > li {
    position: relative;
}

/* Link cấp 1 */
#nav > li > a,
#nav > li > a#menu {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 9px 18px;
    color: #b2dfdb;
    text-decoration: none;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.55px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

/* Gạch dưới hover */
#nav > li > a::after,
#nav > li > a#menu::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 18px;
    right: 18px;
    height: 2px;
    background: #4A8F7E;
    border-radius: 2px 2px 0 0;
    transform: scaleX(0);
    transition: transform 0.22s ease;
}

#nav > li > a:hover,
#nav > li > a#menu:hover {
    color: #e0f2f1;
}

#nav > li > a:hover::after,
#nav > li > a#menu:hover::after,
#menu-container:hover > a#menu::after {
    transform: scaleX(1);
}

/* Submenu desktop */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2F5D50;
    min-width: 210px;
    border: 1px solid #25483E;
    border-top: 2px solid #4A8F7E;
    border-radius: 0 0 8px 8px;
    list-style: none;
    margin: 0;
    padding: 5px 0;
    z-index: 10000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    animation: dropDown 0.18s ease;
}

@keyframes dropDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-5px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#menu-container:hover .submenu {
    display: block;
}

.submenu li {
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.submenu li:last-child {
    border-bottom: none;
}

.submenu li a {
    display: block;
    padding: 10px 20px;
    color: #b2dfdb;
    text-decoration: none;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.18s, color 0.18s, padding-left 0.18s;
}

.submenu li a:hover {
    background: rgba(74, 143, 126, 0.18);
    color: #e0f2f1;
    padding-left: 26px;
}


/* ========================================
   MENU MOBILE REDESIGN
   ======================================== */

/* Nút hamburger - ẩn desktop, hiện mobile */
#nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 6px;
    transition: background 0.2s;
    order: 0;
}

@media (max-width: 768px) {
    #nav-toggle {
        display: flex !important;
    }
}

#nav-toggle:active {
    background: rgba(255,255,255,0.1);
}

#nav-toggle span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: #e0f2f1;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Animate X khi mở */
#header3.nav-open #nav-toggle span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
#header3.nav-open #nav-toggle span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#header3.nav-open #nav-toggle span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Overlay tối */
#nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999998;
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#nav-overlay.nav-open {
    display: block;
}


/* ---- MOBILE BREAKPOINT ---- */
@media (max-width: 768px) {

    /* Hiện hamburger */
    #nav-toggle {
        display: flex;
    }

    /* Header3 ẨN hoàn toàn trên mobile - chỉ giữ để inject hamburger */
    #header3 {
        display: none !important;
    }

    /* Drawer navigation */
    #nav {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 82vw;
        max-width: 340px;
        height: 100vh;
        height: 100dvh;
        background: linear-gradient(to bottom, #1a3530 0%, #152e27 100%);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 70px 0 24px;
        margin: 0;
        max-width: 340px;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 999999 !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
        
        /* Ẩn mặc định */
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0.35s;
    }

    /* Mở drawer - dùng class trực tiếp trên nav */
    #nav.nav-open {
        transform: translateX(0);
        visibility: visible;
    }

    /* Item cấp 1 */
    #nav > li {
        position: static;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    #nav > li > a,
    #nav > li > a#menu {
        padding: 16px 20px;
        font-size: 14.5px;
        letter-spacing: 0.4px;
        width: 100%;
        white-space: normal;
        justify-content: space-between;
        text-transform: uppercase;
        font-weight: 600;
        text-align: left;
    }

    /* Tắt underline desktop */
    #nav > li > a::after,
    #nav > li > a#menu::after {
        display: none !important;
    }

    /* Mũi tên accordion - đặt SAU text */
    #menu-container > a#menu {
        position: relative;
    }
    
    #menu-container > a#menu::after {
        content: '▼';
        font-size: 10px;
        color: #4A8F7E;
        margin-left: 6px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: inline-block;
    }
    
    #menu-container.open > a#menu::after {
        transform: rotate(180deg);
    }

    /* Submenu accordion */
    .submenu {
        position: static !important;
        transform: none !important;
        min-width: 0;
        width: 100%;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 0;
        box-shadow: none;
        animation: none !important;
        background: rgba(0, 0, 0, 0.25);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    padding 0.35s;
        z-index: auto;
    }

    /* Hover desktop không kích hoạt */
    #menu-container:hover > .submenu {
        display: block;
        max-height: 0;
    }

    /* Mở accordion */
    #menu-container.open > .submenu {
        max-height: 500px;
        padding: 6px 0;
    }

    .submenu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    .submenu li:last-child {
        border-bottom: none;
    }

    .submenu li a {
        padding: 13px 20px;
        font-size: 13.5px;
        font-weight: 500;
        letter-spacing: 0.3px;
        text-transform: none;
        transition: all 0.2s;
        text-align: left;
        display: block;
        width: 100%;
    }

    .submenu li a:hover,
    .submenu li a:active {
        padding-left: 26px;
        background: rgba(74, 143, 126, 0.25);
        color: #fff;
    }
}

/* Màn hình nhỏ hơn */
@media (max-width: 480px) {
    #nav {
        width: 88vw;
        max-width: none;
    }
}

/* Header drawer (inject JS) */
#nav-drawer-header {
    display: none;
}

@media (max-width: 768px) {
    #nav-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: 14px 20px;
        background: #0f231f;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
    
    #nav-drawer-header span {
        font-family: 'Segoe UI', Arial, sans-serif;
        font-size: 15px;
        font-weight: 800;
        color: #e0f2f1;
        letter-spacing: 0.6px;
    }
    
    #nav-drawer-close {
        width: 32px;
        height: 32px;
        background: none;
        border: none;
        color: #b2dfdb;
        font-size: 24px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        transition: all 0.2s;
        padding: 0;
        line-height: 1;
    }
    
    #nav-drawer-close:active {
        background: rgba(255, 255, 255, 0.1);
        color: #e0f2f1;
    }
}

/* ========================================
   SLIDE CSS - SHOPDDINOSAW
   Dựa theo cấu trúc slide.php & script.js gốc
   Không thay đổi bất kỳ file gốc nào
   ======================================== */

/* ---- Wrapper ngoài cùng ---- */
.slandbn {
    background: #ffffff;
    padding: 14px 0 10px;
    border-radius: 10px;
}

/* ---- .box: slideshow + 2 banner phụ nằm ngang ---- */
.box {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 12px;
    align-items: stretch;
}

/* ---- Block slide (chiếm phần lớn) ---- */
.block_slide {
    flex: 0 0 70%;                     /* Cố định 70% — nhường ~30% cho bannerslide */
    max-width: 70%;
    height: 360px;                     /* Chiều cao cố định — khung không nhảy khi đổi ảnh */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(0,0,0,0.13);
}

/* ---- Slideshow wrapper ---- */
.slideshow-wrapper {
    position: relative;
    width: 100%;
    height: 100%;                      /* Kế thừa 360px từ .block_slide */
    background: #1a3530;
    border-radius: 10px;
    overflow: hidden;
}

/* ---- Từng slide ---- */
.slide {
    display: none;
    width: 100%;
    height: 100%;                      /* Kế thừa chiều cao — ảnh không đẩy khung */
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;                 /* Crop đồng đều, không méo dù ảnh khác kích thước */
    display: block;
}

/* ---- Nút prev / next ---- */
.prev,
.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(37, 72, 62, 0.72);
    color: #e0f2f1;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
}

.prev { left: 12px; }
.next { right: 12px; }

.prev:hover,
.next:hover {
    background: #4A8F7E;
    transform: translateY(-50%) scale(1.1);
    color: #fff;
}

/* ---- Dots ---- */
.dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    z-index: 10;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    border: 1.5px solid rgba(255,255,255,0.6);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: inline-block;
}

.dot:hover {
    background: rgba(255,255,255,0.75);
}

/* Class active-dot được gán bởi script.js */
.dot.active-dot {
    background: #4A8F7E;
    border-color: #4A8F7E;
    transform: scale(1.25);
}

/* ---- Banner phụ bên phải (bannerslide) ---- */
.bannerslide {
    flex: 1;                           /* Tự chiếm phần còn lại sau block_slide 85% */
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 360px;                     /* Khớp chiều cao với .block_slide */
    min-width: 0;
}

.bannersl,
.banners1 {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.bannersl img,
.banners1 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.bannersl:hover img,
.banners1:hover img {
    transform: scale(1.03);
}

/* ---- 4 banner hàng dưới ---- */
.container-banner {
    max-width: 1280px;
    margin: 12px auto 0;
    padding: 0 20px;
    display: flex;
    gap: 12px;
}

.banner {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.10);
}

.banner img {
    width: 100% !important;   /* Ghi đè width="300px" inline trong HTML */
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.banner:hover img {
    transform: scale(1.03);
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .box {
        flex-direction: column;
    }

    .block_slide {
        flex: none;
        max-width: 100%;
        width: 100%;
        height: 280px;
    }

    .bannerslide {
        flex-direction: row;
        width: 100%;
        height: 150px;
    }

    .bannersl,
    .banners1 {
        flex: 1;
        height: 100%;
    }
}

@media (max-width: 640px) {
    .container-banner {
        flex-wrap: wrap;
    }

    .banner {
        flex: 1 1 calc(50% - 6px);
    }

    .prev, .next {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
}



/* ========================================
   PRODUCTS CSS - SHOPDDINOSAW
   Dựa theo cấu trúc home.php gốc
   ======================================== */

/* ========================================
   PRODUCTS CSS - SHOPDDINOSAW
   Dựa theo cấu trúc home.php gốc
   ======================================== */

/* ---- Wrapper tổng ---- */
.main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 20px 40px;
}

/* ---- Tiêu đề danh mục ---- */
.main > h2 {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #1a3530;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 28px 0 12px;
    padding-left: 12px;
    border-left: 4px solid #4A8F7E;   /* Accent khớp màu header */
    line-height: 1.3;
}

/* ---- Wrapper section sản phẩm ---- */
.main-content {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

/* ---- Grid sản phẩm — 5 cột desktop ---- */
.products {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

/* ---- Card sản phẩm ---- */
.product {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e4efec;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.product:hover {
    box-shadow: 0 8px 24px rgba(47, 93, 80, 0.18);
    transform: translateY(-4px);
    border-color: #4A8F7E;
}

/* ---- Link wrapper cho ảnh và tên ---- */
.product-link {
    text-decoration: none;
    display: block;
}

/* ---- Ảnh sản phẩm ---- */
.product-image {
    position: relative;
    overflow: hidden;
    background: #f9fdfb;
}

.product-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 16px;
    box-sizing: border-box;
    display: block;
    transition: transform 0.3s ease;
}

.product:hover .product-image img {
    transform: scale(1.08);
}

/* ---- Phần nội dung ---- */
.product-content {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ---- Tên sản phẩm — 2 dòng max ---- */
.product h4.namepr {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1a3530;
    margin: 0 0 8px;
    line-height: 1.4;
    min-height: 40px;
    
    /* Giới hạn 2 dòng */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    
    transition: color 0.2s;
}

.product-link:hover .namepr {
    color: #4A8F7E;
}

/* ---- Giá ---- */
.product p.price {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #2F5D50;
    margin: 0 0 14px;
}

/* ---- Nút hành động ---- */
.product-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.btn-add-cart,
.btn-buy-now {
    flex: 1;
    height: 38px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.btn-add-cart {
    background: #fff;
    color: #2F5D50;
    border: 1.5px solid #2F5D50;
}

.btn-add-cart:hover {
    background: #f0f5f4;
    border-color: #4A8F7E;
    color: #4A8F7E;
}

.btn-buy-now {
    background: #2F5D50;
    color: #ffffff;
}

.btn-buy-now span {
    color: white;
}
.btn-buy-now:hover {
    background: #4A8F7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 93, 80, 0.3);
}

/* Badge hết hàng */
.out-of-stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(192, 57, 43, 0.95);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.product.out-of-stock {
    opacity: 0.7;
}



/* ---- Responsive ---- */

/* Tablet: 3 cột */
@media (max-width: 992px) {
    .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile lớn: 2 cột */
@media (max-width: 576px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .main-content {
        padding: 10px;
    }

    .main > h2 {
        font-size: 15px;
    }
    
    .product h4.namepr {
        font-size: 13px;
        min-height: 36px;
    }
    
    .product p.price {
        font-size: 14px;
    }
    
    .btn-add-cart,
    .btn-buy-now {
        font-size: 12px;
        height: 36px;
        gap: 4px;
    }
}

/* ========================================
   FOOTER CSS - SHOPDDINOSAW
   Dựa theo cấu trúc footer.php gốc
   ======================================== */

/* ---- Footer chính — 4 cột ---- */
.footer {
    background: #1e3d34;
    display: flex;
    justify-content: space-between;
    gap: 32px;
    max-width: 100%;
    padding: 36px 60px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

/* Mỗi cột */
.footer > div {
    flex: 1 1 180px;
    min-width: 160px;
}

/* ---- Cột 1: Logo + thông tin liên hệ ---- */
.footer > div:first-child img {
    border-radius: 8px;
    margin-bottom: 12px;
    display: block;
}

.footer p {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    color: #b2dfdb;
    margin: 5px 0;
    line-height: 1.6;
}

.footer p strong {
    color: #e0f2f1;
}

/* ---- Social icons ---- */
.social-icons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.social-icons a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(74, 143, 126, 0.25);
    border: 1px solid rgba(74, 143, 126, 0.5);
    color: #b2dfdb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.social-icons a:hover {
    background: #4A8F7E;
    color: #fff;
    transform: translateY(-2px);
}

/* ---- Tiêu đề cột 2, 3, 4 ---- */
.footer h3 {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #e0f2f1;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4A8F7E;
    display: inline-block;
}

/* ---- Links trong footer ---- */
.footer a {
    color: #b2dfdb;
    text-decoration: none;
    font-size: 13px;
    font-family: 'Segoe UI', Arial, sans-serif;
    transition: color 0.18s, padding-left 0.18s;
    display: inline-block;
}

.footer a:hover {
    color: #fff;
    padding-left: 4px;
}

/* ---- Payment icons ---- */
.payment-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.payment-icons img {
    height: 30px !important;
    width: auto !important;
    border-radius: 4px;
    background: #fff;
    padding: 2px 5px;
    box-sizing: border-box;
    object-fit: contain;
    transition: transform 0.2s;
}

.payment-icons img:hover {
    transform: scale(1.08);
}

/* ---- Copyright bar ---- */
.footer.copyright {
    background: #152e27;
    padding: 14px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.footer.copyright p {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 12.5px;
    color: #7db5aa;
    margin: 0;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .footer {
        padding: 28px 20px;
        gap: 24px;
    }

    .footer > div {
        flex: 1 1 calc(50% - 12px);
    }

    .footer.copyright {
        padding: 12px 20px;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer > div {
        flex: 1 1 100%;
    }
}


/* ========================================
   THANH TOÁN CSS - SHOPDDINOSAW
   Dùng class tt- riêng, không đụng class global
   ======================================== */

/* ---- Nền trang ---- */
.tt-page {
    background: #f0f5f4;
    min-height: calc(100vh - 200px);
    padding: 28px 20px 50px;
    box-sizing: border-box;
}

.tt-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ---- Breadcrumb ---- */
.tt-breadcrumb {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    color: #7aa89e;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tt-breadcrumb a {
    color: #4A8F7E;
    text-decoration: none;
}

.tt-breadcrumb a:hover {
    text-decoration: underline;
}

.tt-breadcrumb span:last-child {
    color: #1a3530;
    font-weight: 600;
}

/* ---- Layout 2 cột ---- */
.tt-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
}

/* ---- Header chung của 2 card ---- */
.tt-card-header {
    background: #2F5D50;
    color: #e0f2f1;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 14px 20px;
    border-radius: 10px 10px 0 0;
}

/* ==============================
   CỘT TRÁI — Thông tin sản phẩm
   ============================== */
.tt-product-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.08);
    overflow: hidden;
}

.tt-product-body {
    display: flex;
    gap: 24px;
    padding: 24px;
}

/* Ảnh */
.tt-product-img {
    flex-shrink: 0;
    width: 240px;
    height: 240px;
    border: 1px solid #e4efec;
    border-radius: 8px;
    background: #f9fdfb;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tt-product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    box-sizing: border-box;
}

/* Thông tin */
.tt-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tt-product-name {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a3530;
    margin: 0;
    line-height: 1.4;
}

.tt-product-price {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #c0392b;
    background: #fff5f5;
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #fdd;
}

.tt-product-summary {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13.5px;
    color: #2F5D50;
    font-weight: 600;
    padding: 10px 14px;
    background: #f0faf6;
    border-left: 3px solid #4A8F7E;
    border-radius: 0 6px 6px 0;
    line-height: 1.6;
}

.tt-product-desc {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    max-height: 130px;
    overflow-y: auto;
    padding-right: 6px;
}

.tt-product-desc::-webkit-scrollbar { width: 4px; }
.tt-product-desc::-webkit-scrollbar-thumb {
    background: #b2dfdb;
    border-radius: 2px;
}

/* ==============================
   CỘT PHẢI — Thanh toán
   ============================== */
.tt-pay-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.08);
    overflow: hidden;
    position: sticky;
    top: 80px;                         /* Bám dưới menu khi scroll */
}

.tt-pay-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Tóm tắt đơn hàng */
.tt-order-summary {
    background: #f7faf9;
    border: 1px solid #e4efec;
    border-radius: 8px;
    padding: 14px 16px;
}

.tt-order-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    color: #555;
}

.tt-order-name {
    text-align: right;
    color: #1a3530;
    font-weight: 600;
    max-width: 180px;
    line-height: 1.4;
}

.tt-order-divider {
    border-top: 1px dashed #c8ddd9;
    margin: 10px 0;
}

.tt-order-total {
    font-size: 14px;
    font-weight: 700;
    color: #1a3530;
    margin-top: 2px;
}

.tt-order-price {
    font-size: 18px;
    font-weight: 800;
    color: #c0392b;
}

/* Nút thanh toán VNPay */
.t-pay {
    margin: 0;
}

button.pay {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(0, 102, 204, 0.35);
}

button.pay:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.45);
}

button.pay:active {
    transform: translateY(0);
}

/* Ghi chú bảo mật */
.tt-secure-note {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 12px;
    color: #7aa89e;
    text-align: center;
    margin: 0;
    padding-top: 4px;
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
    .tt-layout {
        grid-template-columns: 1fr;
    }

    .tt-pay-card {
        position: static;
    }
}

@media (max-width: 560px) {
    .tt-product-body {
        flex-direction: column;
        align-items: center;
        padding: 16px;
    }

    .tt-product-img {
        width: 100%;
        height: 200px;
    }

    .tt-product-name {
        font-size: 17px;
    }
}