/* -------------------------------------------------------------
   Header Styles - Dark Gray Background with Logo Left, Elements Right
------------------------------------------------------------- */
.site-header {
    background-color: #222222;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

/* Main header container - strict left/right alignment */
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    height: 70px;

    margin: 0 auto;
    position: relative;
}

/* --------------------------------
   Left Side - Logo
-------------------------------- */
.site-branding {
    display: flex;
    align-items: center;
    height: 100%;
    z-index: 15;
    padding-left: 1.5rem;
    flex: 0 0 auto;
}

.custom-logo-link {
    display: flex;
    align-items: center;
}

.custom-logo {
    max-height: 60px;
    width: auto;
    transition: transform 0.2s ease;
}

.custom-logo-link:hover .custom-logo {
    transform: scale(1.02);
}

/* --------------------------------
   Middle - Navigation Menu
-------------------------------- */
.multisite-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex: 0 1 auto;
}

.multisite-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    align-items: center;
}

.multisite-navigation li {
    position: relative;
    margin: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
}

.multisite-navigation a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    color: #f5f5f5 !important;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
    height: 100%;
    white-space: nowrap;
}

.multisite-navigation a:hover {
    color: #e1af1a !important;
}

.multisite-navigation .current-menu-item a {
    font-weight: 700;
    position: relative;
    color: #e1af1a !important;
}

/* --------------------------------
   Right Side - Controls
-------------------------------- */
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    z-index: 15;
    padding-right: 1.5rem;
    gap: 1.2rem;
    flex: 0 0 auto;
}

/* --------------------------------
   Dark Mode Toggle - Enhanced Responsiveness
-------------------------------- */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    margin: 0;
    transition: transform 0.3s ease;
}

.dark-mode-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 30px;
    cursor: pointer;
    margin: 0;
    transition: all 0.3s ease;
}

.dark-mode-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.dark-mode-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
    box-shadow: inset 0 0 2px rgba(0,0,0,0.1);
}

.dark-mode-icons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 8px;
    box-sizing: border-box;
    transition: padding 0.3s ease;
}

.dark-icon, 
.light-icon {
    font-size: 14px;
    user-select: none;
    line-height: 1;
    transition: font-size 0.3s ease;
}

.dark-mode-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.dark-mode-checkbox:checked + .dark-mode-slider {
    background-color: #e1af1a;
}

.dark-mode-checkbox:checked + .dark-mode-slider:before {
    transform: translateX(30px);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #f5f5f5;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin: 0;
    transition: color 0.2s ease;
}

.menu-toggle:hover {
    color: #e1af1a;
}

/* --------------------------------
   Cart Styling - COMPLETELY REVISED
-------------------------------- */
.site-header-cart {
    display: flex;
    align-items: center;
    position: relative;
    margin: 0;
    height: 40px;
}

/* Cart icon container */
.cart-contents {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #f5f5f5 !important;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    height: 100%;
    padding: 0 4px;
}

.cart-contents:hover {
    color: #e1af1a !important;
}

.cart-contents i {
    font-size: 1.25rem;
    position: relative;
}

/* Cart counter badge */
.cart-contents-count {
    position: absolute;
    top: -6px;
    right: auto;
    left: 14px;
    background-color: #e1af1a;
    color: #222;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0 2px;
    z-index: 5;
}


/* Cart total amount - Better horizontal positioning */
.cart-total-amount {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.9em;
    color: #e1af1a;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Empty cart styling */
.cart-contents.empty .cart-contents-count {
    display: none;
}

.cart-contents.empty .cart-total-amount {
    display: none;
}

/* Cart badge animation */
@keyframes countUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    70% { transform: scale(0.8); }
    85% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cart-contents-count.updated {
    animation: countUpdate 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Cart total animation */
@keyframes totalUpdate {
    0% { opacity: 0.5; transform: translateY(2px); }
    50% { opacity: 1; transform: translateY(-2px); }
    100% { opacity: 1; transform: translateY(0); }
}

.cart-total-amount.updated {
    animation: totalUpdate 0.6s ease-out;
}

/* Mobile cart styling */
.mobile-nav-overlay .cart-count {
    display: inline-flex;
    position: relative;
    top: -8px;
    right: -6px;
    margin: 0;
    transform: scale(0.9);
}

.mobile-cart-link .cart-total-amount {
    margin-left: 5px;
    font-size: 0.9em;
}

/* --------------------------------
   Mobile Navigation Overlay
-------------------------------- */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
    overflow-y: auto;
    pointer-events: none;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav-container {
    padding: 1.5rem;
    position: relative;
    z-index: 10;
}

.mobile-nav-overlay ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 11;
}

.mobile-nav-overlay li {
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    transition-delay: calc(0.05s * var(--item-index, 0));
    position: relative;
    z-index: 12;
}

.mobile-nav-overlay.active li {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav-overlay a {
    display: block;
    padding: 0.75rem 0;
    color: #f5f5f5;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.2s ease;
    position: relative;
    z-index: 13;
}

.mobile-nav-overlay a:hover {
    color: #e1af1a;
}

.mobile-nav-overlay .current-menu-item a {
    color: #e1af1a;
    font-weight: 700;
}

/* --------------------------------
   Dark Mode Styles
-------------------------------- */
body.dark-mode .site-header .multisite-navigation a,
body.dark-mode .mobile-nav-overlay a,
body.dark-mode .menu-toggle {
    color: #f5f5f5 !important;
}

body.dark-mode .site-header .multisite-navigation a:hover,
body.dark-mode .site-header .multisite-navigation .current-menu-item a,
body.dark-mode .mobile-nav-overlay a:hover,
body.dark-mode .mobile-nav-overlay .current-menu-item a,
body.dark-mode .menu-toggle:hover,
body.dark-mode .menu-toggle.active {
    color: #e1af1a !important;
}

body.dark-mode .cart-contents-count,
body.dark-mode .mobile-nav-overlay .cart-count {
    background-color: #e1af1a;
    color: #222;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .cart-total-amount {
    color: #e1af1a;
}

/* --------------------------------
   Responsive Styles
-------------------------------- */
@media (min-width: 992px) {
    /* Hide mobile nav on desktop */
    .mobile-nav-overlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    body.mobile-nav-active {
        overflow: auto !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
    }
    
    /* Ensure menu toggle is hidden at desktop sizes */
    .menu-toggle {
        display: none !important;
    }
}

@media (max-width: 1200px) {
    .multisite-navigation li {
        margin: 0 0.75rem;
    }
    
    .multisite-navigation a {
        font-size: 0.9rem;
    }
}

@media (max-width: 992px) {
    /* Show menu toggle ONLY on mobile */
    .menu-toggle {
        display: flex !important;
    }
    
    /* Hide desktop navigation */
    .multisite-navigation {
        display: none;
    }
    
    .menu-toggle.active {
        color: #e1af1a;
    }
    
    /* Lock body scroll when mobile nav is open */
    body.mobile-nav-active {
        overflow: hidden;
    }
    
    /* Increase gap between header elements */
    .header-right {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .site-header .container {
        padding: 0;
        height: 65px;
    }
    
    .site-branding {
        padding-left: 1rem;
    }
    
    .header-right {
        padding-right: 1rem;
        gap: 0.75rem;
    }
    
    .mobile-nav-overlay {
        top: 65px;
    }
    
    /* Cart adjustments */
    .cart-contents i {
        font-size: 1.15rem;
    }
    
    .cart-contents-count {
        min-width: 15px;
        height: 15px;
        font-size: 9px;
        top: -6px;
        left: 12px;
    }
    
    .cart-total-amount {
        font-size: 0.85em;
    }
}

@media (max-width: 576px) {
    /* Optimized for very small screens */
    .header-right {
        gap: 0.6rem;
    }
    
    .cart-contents {
        gap: 4px;
    }
    
    .cart-total-amount {
        font-size: 0.8em;
        margin-left: 4px;
    }
    
}

@media (max-width: 480px) {
    .site-header .container {
        height: 60px;
		 max-width: 95%;
    }
    
    .site-branding {
        padding-left: 0.75rem;
    }
    
    .header-right {
        padding-right: 0.75rem;
        gap: 0.5rem;
    }
    
    .custom-logo {
        max-height: 45px;
    }
    
    .mobile-nav-overlay {
        top: 60px;
    }
    
    /* Further optimize for extremely small screens */
    .cart-contents i {
        font-size: 1.05rem;
    }
    
    .cart-contents-count {
        min-width: 14px;
        height: 14px;
        font-size: 8px;
        left: 10px;
        top: -5px;
    }
    
    /* Make cart total smaller but still visible */
    .cart-total-amount {
        font-size: 0.75em;
        margin-left: 2px;
    }
}

/* Mobile fixing */
@media (max-width: 480px) {
   

    .cart-contents-count {
        left: 10px;
    }
    
    .cart-total-amount {
        margin-left: 6px;
        display: none;
    }
}

/* --------------------------------
   Responsive Dark Mode Toggle
-------------------------------- */
@media (max-width: 1200px) {
    /* Slightly smaller on medium-large screens */
    .dark-mode-label {
        width: 56px;
        height: 28px;
    }
    
    .dark-mode-slider:before {
        height: 24px;
        width: 24px;
    }
    
    .dark-mode-checkbox:checked + .dark-mode-slider:before {
        transform: translateX(28px);
    }
}

@media (max-width: 992px) {
    /* More compact on tablets */
    .dark-mode-label {
        width: 54px;
        height: 27px;
    }
    
    .dark-mode-slider:before {
        height: 23px;
        width: 23px;
    }
    
    .dark-mode-checkbox:checked + .dark-mode-slider:before {
        transform: translateX(27px);
    }
    
    .dark-mode-icons {
        padding: 0 7px;
    }
    
    .dark-icon, .light-icon {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    /* Compact design for mobile */
    .dark-mode-label {
        width: 48px;
        height: 24px;
    }
    
    .dark-mode-slider:before {
        height: 20px;
        width: 20px;
    }
    
    .dark-mode-checkbox:checked + .dark-mode-slider:before {
        transform: translateX(24px);
    }
    
    .dark-mode-icons {
        padding: 0 6px;
    }
    
    .dark-icon, .light-icon {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    /* Very compact for small phones */
    .dark-mode-label {
        width: 44px;
        height: 22px;
    }
    
    .dark-mode-slider:before {
        height: 18px;
        width: 18px;
    }
    
    .dark-mode-checkbox:checked + .dark-mode-slider:before {
        transform: translateX(22px);
    }
    
    .dark-mode-icons {
        padding: 0 5px;
    }
    
    .dark-icon, .light-icon {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    /* Ultra compact for very small devices */
    .dark-mode-label {
        width: 38px;
        height: 19px;
    }
    
    .dark-mode-slider:before {
        height: 15px;
        width: 15px;
        left: 2px;
        bottom: 2px;
    }
    
    .dark-mode-checkbox:checked + .dark-mode-slider:before {
        transform: translateX(19px);
    }
    
    .dark-mode-icons {
        padding: 0 4px;
    }
    
    .dark-icon, .light-icon {
        font-size: 9px;
    }
}

@media (max-width: 375px) {
    /* Micro size for iPhone SE and similar */
    .dark-mode-label {
        width: 34px;
        height: 17px;
    }
    
    .dark-mode-slider:before {
        height: 13px;
        width: 13px;
        left: 2px;
        bottom: 2px;
    }
    
    .dark-mode-checkbox:checked + .dark-mode-slider:before {
        transform: translateX(17px);
    }
    
    .dark-mode-icons {
        padding: 0 3px;
    }
    
    .dark-icon, .light-icon {
        font-size: 8px;
    }
}

/* --------------------------------
   Mi Cuenta Icon
-------------------------------- */
.my-account-link-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    margin: 0;
    height: 40px;
}

.my-account-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f5f5f5 !important;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    height: 100%;
    padding: 0 4px;
}

.my-account-link:hover {
    color: #e1af1a !important;
}

.my-account-link i {
    font-size: 1.2rem;
    position: relative;
}

/* Dark Mode Styles for Mi Cuenta */
body.dark-mode .my-account-link {
    color: #f5f5f5 !important;
}

body.dark-mode .my-account-link:hover {
    color: #e1af1a !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .my-account-link i {
        display: none;
    }
}

@media (max-width: 576px) {
    .my-account-link i {
        display: none;
    }
}

@media (max-width: 480px) {
    .my-account-link i {
        display: none;
    }
}