/* Header Fixes */
.tf-header {
    position: relative;
    z-index: 1000;
}
.tf-header .container {
    max-width: 100%;
    padding: 0 20px;
}
.tf-header .row {
    margin: 0;
}
/* Header Search Form */
.header-search-form {
    position: relative;
    width: 450px;
    margin-right: 0px;
}
.header-search-input {
    width: 100%;
    height: 40px;
    padding: 8px 45px 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}
.header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}
.header-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}
.header-search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.header-search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}
.header-search-btn i {
    font-size: 16px;
}
.nav-icon {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}
.nav-icon li {
    margin: 0;
}

.nav-icon-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 40px;
    font-size: 30px;
    transition: all 0.3s ease;
}

.nav-icon-item:hover {
    transform: scale(1.1);
}

/* Remove the inline search form from header */
.form-search.style-radius {
    display: none !important;
}

.gap-2 {
    gap: 1rem !important;
}

/* Cart count badge */
.count-notice {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

.mobile-search-input::placeholder {
    color: rgba(0, 0, 0, 0.5) !important;
    opacity: 1 !important;
}

.canvas-mb .form-search input::placeholder {
    color: rgba(0, 0, 0, 0.5) !important;
}

.count-notice:empty {
    display: none;
}

/* Logo sizing */
.logo-site img {
    max-height: 36px;
    width: auto;
}

/* Desktop Side Menu Styles */
#desktopSideMenu {
    width: 350px;
}

#desktopSideMenu .mb-canvas-content {
    padding: 30px 25px;
}

#desktopSideMenu .nav-ul-mb {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

#desktopSideMenu .nav-mb-item {
    margin-bottom: 5px;
}

#desktopSideMenu .mb-menu-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#desktopSideMenu .mb-menu-link:hover {
    background-color: #f5f5f5;
    color: #000;
    transform: translateX(5px);
}

#desktopSideMenu .mb-menu-link i {
    font-size: 18px;
    margin-right: 10px;
}

/* Mobile responsive */
@media (max-width: 1199px) {
    .header-search-form {
        display: none !important;
    }
    
    .nav-icon-item {
        width: 35px;
        height: 35px;
        font-size: 28px;
    }
}

@media (max-width: 991px) {
    .tf-header .col-xl-2.col-md-3 {
        flex: 0 0 auto;
        width: auto;
    }
}

@media (max-width: 767px) {
    .logo-site img {
        max-height: 45px;
    }

    .canvas-mb .form-search input{
        background: rgba(255, 255, 255, 0.1);
    }

    .form-search button {
    position: absolute;
    display: flex;
    right: 0px !important;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    background-color: transparent;
    border: 0;
}
}


.category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    min-width: 250px;
    padding: 15px 0;
    border-radius: 8px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.catdrop:hover .category-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.category-dropdown li {
    list-style: none;
    margin: 0;
}

.category-dropdown .sub-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-dropdown .sub-menu-link:hover {
    background: #f5f5f5;
    color: #000;
    padding-left: 25px;
}

.category-dropdown .category-count {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
}

.category-dropdown-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.category-dropdown-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile dropdown toggle */
@media (max-width: 1199px) {
    .category-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .catdrop.active .category-dropdown {
        max-height: 500px;
    }
}

    /* Desktop Side Menu Styles */
#desktopSideMenu {
    width: 350px;
}

#desktopSideMenu .mb-canvas-content {
    padding: 30px 25px;
}

#desktopSideMenu .nav-ul-mb {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

#desktopSideMenu .nav-mb-item {
    margin-bottom: 5px;
}

#desktopSideMenu .mb-menu-link {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#desktopSideMenu .mb-menu-link:hover {
    background-color: #f5f5f5;
    color: #000;
    transform: translateX(5px);
}

#desktopSideMenu .mb-menu-link i {
    font-size: 18px;
}

#desktopSideMenu .mb-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

#desktopSideMenu .mb-info li {
    display: flex;
    align-items: flex-start;
    font-size: 14px;
    color: #666;
}

#desktopSideMenu .social-links a {
    color: #333;
    transition: color 0.3s ease;
}

#desktopSideMenu .social-links a:hover {
    color: #000;
}


/* Add this to your <style> section in header.php */

/* Show first announcement immediately (before JS loads) */
.infiniteSlide .infiniteItem:first-child {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Hide duplicates until animation starts */
.infiniteSlide .infiniteItem:not(:first-child) {
    opacity: 0;
    visibility: hidden;
}

/* Show all items once animation is ready */
.infiniteSlide.animation-ready .infiniteItem {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Prevent layout shift */
.tf-topbar .infiniteSlide {
    min-height: 40px;
    display: flex;
    align-items: center;
}



.toast-success {
    top: 90px !important;
}

.topbar-scroll {
    overflow: hidden;
    white-space: nowrap;
}

.topbar-content {
    display: inline-flex;
    align-items: center;
    animation: scroll-left 30s linear infinite;
    padding: 0px 0;
}

.topbar-content p {
    display: inline-block;
    margin: 0;
    padding: 0 10px;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Pause on hover */
.topbar-scroll:hover .topbar-content {
    animation-play-state: paused;
}

.topbar-content .text-white {
    color: rgb(62, 129, 86) !important;
}


/* ========================================
   MOBILE MENU REDESIGN STYLES
   ======================================== */

.offer-slide {
    animation: slideIn 0.5s ease-out;
}



.offer-text {
    color: white;
    font-size: 13px;
    margin: 0;
    font-weight: 500;
    line-height: 1.4;
}

.offer-text a {
    color: #fff;
    text-decoration: underline;
    font-weight: 700;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Section */
.mobile-search-section {
    margin-bottom: 5px;
}

.mobile-search-section .form-search {
    position: relative;
}

.mobile-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px !important;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 10px !important;
    background: #f8f9fa;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-search-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn-mobile {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: #667eea;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn-mobile:hover {
    background: #5568d3;
    transform: translateY(-50%) scale(1.05);
}

/* Section Titles */
.mobile-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: #333;
    margin-bottom: 5px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-section-title i {
    color: #667eea;
    font-size: 16px;
}

/* Categories Section */
.mobile-categories-section {
    margin-bottom: 12px;
}

.mobile-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.mobile-category-list li {
    margin: 0;
}

.mobile-category-list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 80px;
}

.mobile-category-list a:hover,
.mobile-category-list a:active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mobile-category-list .category-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.category-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #999;
}

/* Menu Section */
.mobile-menu-section {
    margin-bottom: 0px;
}

.mobile-menu-section .nav-ul-mb {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-section .nav-mb-item {
    margin-bottom: 8px;
}

.mobile-menu-section .mb-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 3px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-menu-section .mb-menu-link:hover,
.mobile-menu-section .mb-menu-link:active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateX(5px);
}

.mobile-menu-section .mb-menu-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Footer Content */
.mb-other-content {
    border-top: 2px solid #f0f0f0;
    padding-top: 0px;
    margin-top: 0px;
}

.group-icon {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.site-nav-icon {
    flex: 1;    
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.site-nav-icon:hover {
    background: #667eea;
    color: white;
}

.mb-notice {
    text-align: center;
    margin-bottom: 15px;
}

.text-need {
    display: inline-block;
    padding: 10px 20px;
    background: #fff3cd;
    color: #856404;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.mb-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mb-info li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: #666;
}

.mb-info li i {
    color: #667eea;
    font-size: 16px;
    margin-top: 2px;
}

.mb-info li a {
    color: #666;
    text-decoration: none;
}

.mb-info li a:hover {
    color: #667eea;
}

/* Offcanvas Adjustments */
.canvas-mb .mb-canvas-content {
    padding: 25px 0px;
}

@media(max-width: 768px){
    .canvas-mb .mb-body {
    padding-right: 10px;
    padding-left: 10px;
}

.form-search button .icon {
    font-size: 32px;
    margin-top: -5%;
}

    .form-search button {
        position: absolute;
        display: flex;
        left: 262px !important;
        top: 70%;
        transform: translateY(-50%);
        padding: 0;
        background-color: transparent;
        border: 0;
    }

    .canvas-mb .form-search input {
    background: rgba(255, 255, 255, 0.1);
    margin-top: 5%;
    border: 1px solid black;
    border-radius: 5px;
    padding: 2% !important;
}

form textarea, form input[type=text], form input[type=password], form input[type=datetime], form input[type=datetime-local], form input[type=date], form input[type=month], form input[type=time], form input[type=week], form input[type=number], form input[type=email], form input[type=url], form input[type=search], form input[type=tel], form input[type=color] {
    font-size: 13px !important;
}

.canvas-mb .mb-body {
    height: 100%;
    overflow-y: auto;
}

}
/* Close Button */
.icon-close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.icon-close-popup:hover {
    background: #667eea;
    color: white;
    transform: rotate(90deg);
}

/* Responsive */
@media (max-width: 576px) {
    .mobile-category-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mobile-category-list a {
        font-size: 12px;
        padding: 5px 8px;
        min-height: 70px;
    }

    /* Mobile Category List with Circular Images */
.mobile-category-list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 10px;
    background: linear-gradient(135deg, #f5f7fa 0%, #91b193 100%);
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 90px;
}

.mobile-category-list a:hover,
.mobile-category-list a:active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.category-image-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-image-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.category-name {
    font-size: 10px;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Remove old emoji styles */
.mobile-category-list .category-icon {
    display: none;
}
}



.user-dropdown-wrapper {
    position: relative;
}

.user-dropdown-toggle {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.user-dropdown-toggle:hover {
    transform: scale(1.1);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Arrow */
.user-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
}

.user-dropdown-header {
    padding: 10px;
    background: linear-gradient(135deg, #5d8d6d 0%, #0b3d1d 100%);
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-avatar i {
    font-size: 24px;
    color: #fff;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    margin: 4px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-links {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.user-dropdown-links li {
    margin: 0;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #000;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500px;
}

.dropdown-link:hover {
    background: #f8f9fa;
    color: #0b3d1d;
}

.dropdown-link i {
    width: 20px;
    font-size: 16px;
    color: #0b3d1d;
}

.logout-link {
    color: #dc3545;
}

.logout-link i {
    color: #dc3545;
}

.logout-link:hover {
    background: #fff5f5;
    color: #c82333;
}

.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 8px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .user-dropdown-menu {
        width: 260px;
        right: -10px;
    }
}