:root {
    --primary-color: #2c3e50;
    --accent-color: #27ae60;
    --bg-light: #f8f9fa;
    --text-dark: #2d3436;
    --card-shadow: 0 4px 15px rgba(0,0,0,0.08);
    --hover-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* --- FUN SLOGAN MARQUEE (TOP BAR) --- */
.announcement-bar {
    background: linear-gradient(90deg, #1a1a1a, #2c3e50, #1a1a1a);
    color: #fff;
    height: 35px;
    line-height: 35px;
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    z-index: 2000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.marquee-container {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 40s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.announcement-bar:hover .marquee-container {
    animation-play-state: paused;
}

.slogan-item {
    margin-right: 50px;
    display: inline-block;
}

/* --- NAVIGATION HEADER (Modern Sticky Logic) --- */
.headerr {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1030;
    background: rgba(33, 37, 41, 1);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: all 0.4s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.headerr.scrolled {
    background: rgba(20, 20, 20, 0.95) !important;
    padding: 5px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.navbar-brand { 
    font-weight: 800; 
    letter-spacing: -1.2px;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}
.navbar-brand:hover { transform: scale(1.02); }
.navbar-brand img {
    height: 45px !important;
    margin-right: 12px;
    filter: drop-shadow(0 0 8px rgba(39, 174, 96, 0.3));
    animation: logoPulse 4s infinite ease-in-out;
    transition: all 0.3s ease;
}

@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(39, 174, 96, 0.3)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 15px rgba(39, 174, 96, 0.6)); transform: scale(1.05); }
}

.nav-link {
    position: relative;
    font-weight: 500;
    margin: 0 10px;
    transition: color 0.3s;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}
.nav-link:hover::after, .nav-item.active .nav-link::after {
    width: 80%;
}

/* Search Trigger Button */
.search-trigger {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.25rem;
    padding: 8px 12px;
    display: block; /* Visible on all devices */
    transition: all 0.3s ease;
    cursor: pointer;
}
.search-trigger:hover { 
    color: var(--accent-color);
    transform: scale(1.1);
}

/* Compact Search Overlay (Slide-down style) */
.search-overlay {
    position: fixed;
    top: -100px; /* Start hidden above */
    left: 0;
    width: 100%;
    background: rgba(33, 37, 41, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 3000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 15px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.search-overlay.active {
    top: 35px; /* Slides down to just below the announcement bar */
}
.search-overlay form {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-overlay input {
    flex-grow: 1;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    color: #fff;
    font-size: 1rem;
    padding: 8px 20px;
    outline: none;
}
.search-overlay .close-search {
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}
@media (min-width: 768px) {
    .search-overlay { display: none; } /* Only the trigger button exists on desktop */
}

/* Full-screen Menu (Apple-style) */
@media (max-width: 768px) {
    .navbar-collapse {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.98);
        backdrop-filter: blur(20px);
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateY(-100%);
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1040;
        overflow: hidden;
    }
    .navbar-collapse.show { transform: translateY(0); }
    .navbar-nav { text-align: center; }
    .navbar-nav .nav-link { 
        font-size: 1.8rem; 
        margin: 15px 0; 
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease;
    }
    .navbar-collapse.show .nav-link { opacity: 1; transform: translateY(0); }
    .search-trigger { display: block; }
    .navbar-brand span { display: none; }
    .navbar-brand img { height: 35px !important; margin-right: 0; }
}

/* Ensure Modal Menu Links are ALWAYS visible */
.modal-menu .nav-link {
    opacity: 1 !important;
    transform: none !important;
    color: #ffffff !important;
    font-size: 1.2rem;
    padding: 15px 0;
}

/* Fix Modal Backdrop Z-index */
.modal-backdrop {
    z-index: 3950 !important;
}

.ser-input {
    border-radius: 20px;
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2);
    color: white !important;
    padding: 5px 20px;
}

/* Category Filter Bar */
.typepro {
    background: #2d3436;
    padding: 10px 0;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    align-items: center;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
}
.typepro::-webkit-scrollbar { display: none; }

.typepro-container {
    position: relative;
    background: #2d3436;
}
.typepro-container::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 50px;
    background: linear-gradient(to right, transparent, #2d3436);
    pointer-events: none;
    z-index: 2;
}

.type-link {
    color: #dfe6e9;
    text-decoration: none;
    padding: 6px 16px;
    margin: 0 5px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 20px;
    transition: all 0.3s;
    border: 1px solid transparent;
    display: inline-block;
}
.type-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Masonry Grid */
.listcnc { padding-top: 50px; padding-bottom: 60px; }
#products {
    display: block;
    column-count: 4;
    column-gap: 20px;
}
@media (max-width: 1200px) { #products { column-count: 3; } }
@media (max-width: 992px) { #products { column-count: 2; } .sidebar-wrapper { display: none; } }
@media (max-width: 576px) { #products { column-count: 2; column-gap: 12px; } }

/* Product Card */
.product-item {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 20px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}
.product-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
}

.img-container {
    width: 100%;
    overflow: hidden;
    background: #f1f1f1;
}
.img-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
}
.product-item:hover .img-container img { transform: scale(1.08); }

.product-info { padding: 15px; background: white; }
.product-info h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-info p {
    font-size: 0.85rem;
    color: #b2bec3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Add to Cart Button */
.add-to-cart-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    z-index: 5;
    opacity: 0;
    transform: translateY(10px);
}
.product-item:hover .add-to-cart-btn {
    opacity: 1;
    transform: translateY(0);
}
@media (max-width: 576px) {
    .add-to-cart-btn { opacity: 1; transform: none; width: 32px; height: 32px; }
}

/* Sidebar Categories */
.sidebar-heading {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 10px;
}
.sidebar-heading:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-color);
}

.ultypelist {
    list-style: none;
    padding: 0;
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.ultypelist li a {
    display: block;
    padding: 12px 20px;
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 1px solid #f1f1f1;
    transition: all 0.2s;
    font-size: 0.9rem;
}
.ultypelist li a:hover {
    background: #f8f9fa;
    color: var(--accent-color);
    padding-left: 25px;
}

/* Pagination */
.pagination a {
    width: 40px; height: 40px; line-height: 40px;
    text-align: center; display: inline-block;
    background: white; border-radius: 50%;
    margin: 0 4px; color: var(--primary-color);
    box-shadow: var(--card-shadow);
    font-weight: 600;
}
.pagination a.active { background: var(--accent-color); color: white; }

/* Floating Contact */
.phone {
    position: fixed; bottom: 30px; right: 25px;
    z-index: 1000; display: flex; flex-direction: column; gap: 18px;
}
.phone a {
    position: relative;
    display: flex; justify-content: center; align-items: center;
    width: 52px; height: 52px; border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.phone a::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%; z-index: -1;
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
/* Zalo color */
.phone a:nth-child(1)::before { background: rgba(0, 132, 255, 0.6); } 
/* Facebook color */
.phone a:nth-child(2)::before { background: rgba(24, 119, 242, 0.6); animation-delay: 1s; } 

.phone img {
    width: 100%; height: 100%; object-fit: contain; padding: 4px;
    border-radius: 50%;
    position: relative;
    z-index: 2;
}

.phone a:hover { transform: translateY(-5px) scale(1.1); }

@keyframes pulse-ring {
    0% { transform: scale(0.9); opacity: 0.8; }
    80% { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Modal Menu (Standardized Z-Index) */
.modal-menu .modal-content {
    border-radius: 25px; 
    background: rgba(33, 37, 41, 0.98);
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    padding: 15px;
    border: 1px solid rgba(255,255,255,0.1);
}
.modal-menu .nav-link {
    font-size: 1.2rem;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.modal-menu .nav-link:last-child {
    border-bottom: none;
}
