/* Extracted from header.php — 2026-07-22 */

    /* Header Responsive Styles */
    .header-container {
        max-width: 1400px;
        padding: 0 15px;
        margin: 0 auto;
    }

    .header-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding: 15px 0;
    }

    .header-search-row {
        display: flex;
        gap: 15px;
        padding: 10px 0;
        border-top: 1px solid #f0f0f0;
    }

    .menu-trigger {
        margin-right: 10px;
        cursor: pointer;
        flex-shrink: 0;
    }

    .logo-wrapper {
        flex: 0 0 auto;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 15px;
        font-size: 0.9rem;
        color: #333;
        flex-shrink: 0;
    }

    /* Desktop: Single line */
    @media (min-width: 769px) {
        .header-top {
            padding: 15px 0;
        }

        .header-search-row {
            flex: 1;
            max-width: 1000px;
            border-top: none;
            padding: 0;
        }

        .logo-wrapper {
            flex: 0 0 200px;
        }
    }

    /* Mobile: Two lines optimization */
    @media (max-width: 768px) {
        .header-top {
            display: flex;
            flex-wrap: wrap;
            /* Permitir wrap */
            padding: 0;
            align-items: center;
            justify-content: space-between;
        }

        /* 1. Left: Hamburger Menu */
        .menu-trigger {
            order: 1;
            flex: 0 0 30px;
            margin-right: 5px;
        }

        /* 2. Center: Logo */
        .logo-wrapper {
            order: 2;
            flex: 1;
            /* Take available space */
            display: flex;
            justify-content: center;
            /* Center horizontally */
            padding: 0 5px;
            min-width: 0;
            /* Prevent overflow */
        }

        .logo-wrapper img {
            /* Removed restrictive height to allow better quality */
            width: auto;
            max-width: 100%;
            object-fit: contain;
        }

        /* 3. Right: User & Cart */
        .header-right {
            order: 3;
            flex: 0 0 auto;
            /* Auto width */
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 0.75rem;
        }

        .header-right a {
            white-space: nowrap;
        }

        /* 4. Bottom Line: Search */
        .header-search-row {
            order: 4;
            width: 100%;
            flex-basis: 100%;
            margin-top: 0;
            padding: 0;
            border: none;
            display: block;
        }

        /* Hide Category Search */
        .header-search-row .search-group:first-child {
            display: none !important;
        }

        /* Full Width Product Search */
        .header-search-row .search-group:last-child {
            width: 100% !important;
            flex: none !important;
            max-width: none !important;
        }

        /* User Info Cleanup */
        .user-info,
        .user-info-desktop {
            display: none !important;
        }

        .header-label {
            display: none !important;
        }

        /* Narrower mobile elements */
        .logo-wrapper img {
            height: 40px !important;
        }

        .header-search-row input {
            height: 40px !important;
        }

        .header-search-row button {
            height: 40px !important;
        }

        .header-right {
            gap: 12px !important;
        }

        .header-right a {
            padding: 0 5px;
        }

        .header-right a[title="Salir"] {
            display: none !important;
            /* Let's hide logout on mobile row to keep it clean, can be in sidebar */
        }
    }

    /* Force search input height to match logo */
    .header-search-row input {
        height: 44px !important;
        box-sizing: border-box;
    }

    /* Mobile specific: override some sizes for consistency */
    @media (max-width: 768px) {
        .logo-wrapper img {
            height: 38px !important;
        }

        .header-search-row input {
            height: 38px !important;
        }

        .header-search-row button {
            height: 38px !important;
        }
    }

    @media (max-width: 768px) {
        header {
            margin-bottom: 10px !important;
        }
    }

    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 10000;
        display: flex;
        justify-content: center;
        align-items: center;
        backdrop-filter: blur(4px);
    }

    .modal-content {
        background: #fff;
        padding: 45px;
        border-radius: 12px;
        width: 90%;
        max-width: 550px;
        position: relative;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
        animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    }

    @keyframes slideUp {
        from {
            transform: translateY(30px) scale(0.95);
            opacity: 0;
        }

        to {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
    }

    .close-modal {
        position: absolute;
        top: 15px;
        right: 20px;
        font-size: 28px;
        cursor: pointer;
        color: #ccc;
        transition: 0.2s;
    }

    .close-modal:hover {
        color: #333;
        transform: scale(1.1);
    }

    .modal-content label {
        display: block;
        font-size: 0.9rem;
    }

    .modal-content input {
        width: 100%;
        padding: 14px;
        border: 1px solid #ddd;
        border-radius: 6px;
        box-sizing: border-box;
        font-size: 1rem;
        transition: 0.2s;
    }

    .modal-content input:focus {
        border-color: #008AC9;
        background: #fff;
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 138, 201, 0.1);
    }

    .btn-login-modal {
        width: 100%;
        padding: 15px;
        background: #008AC9;
        color: white;
        border: none;
        border-radius: 6px;
        font-weight: 800;
        font-size: 1rem;
        cursor: pointer;
        transition: all 0.2s ease;
        letter-spacing: 0.5px;
        box-shadow: 0 4px 15px rgba(0, 138, 201, 0.3);
    }

    .btn-login-modal:hover {
        background: #0071a6;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 138, 201, 0.4);
    }

    .close-modal {
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 24px;
        cursor: pointer;
        color: #aaa;
    }

    .close-modal:hover {
        color: #333;
    }

    .modal-content label {
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
        font-size: 0.85rem;
        color: #444;
    }

    .modal-content input {
        width: 100%;
        padding: 10px;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-sizing: border-box;
    }

    .modal-content button {
        width: 100%;
        padding: 12px;
        background: #008AC9;
        color: white;
        border: none;
        border-radius: 4px;
        font-weight: bold;
        cursor: pointer;
        transition: background 0.2s;
    }

    .modal-content button:hover {
        background: #0077b0;
    }

    /* DRILL-DOWN MENU STYLES */
    #side-menu-panel {
        position: fixed;
        top: 0;
        left: -100%;
        width: 350px;
        height: 100%;
        background: #fff;
        z-index: 9001;
        transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        /* Vital for sliding effects */
    }

    /* Drill Down Container */
    .drill-down-container {
        position: relative;
        width: 100%;
        height: 100%;
        overflow-x: hidden;
    }

    /* Common List Styles */
    .drill-menu-list {
        list-style: none;
        padding: 0;
        margin: 0;
        width: 100%;
        background: #fff;
        /* Transitions for sliding */
        transition: transform 0.3s ease;
        position: absolute;
        top: 0;
        left: 0;
        min-height: 100%;
    }

    /* Levels positioning */
    .drill-menu-list.level-0 {
        z-index: 10;
        transform: translateX(0);
    }

    /* Child levels hidden to the right by default */
    .drill-menu-list.child-level {
        transform: translateX(100%);
        z-index: 20;
        display: none;
        /* Perf: Hide to avoid huge DOM painting */
    }

    /* Active States */
    .drill-menu-list.is-active {
        transform: translateX(0) !important;
        display: block !important;
    }

    /* REMOVED slide-out-left to prevent parent moving children off-screen */

    /* Menu Items */
    .menu-item-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        text-decoration: none;
        color: #333;
        font-size: 1rem;
        font-weight: 500;
        transition: all 0.2s;
        opacity: 1 !important;
    }

    .menu-item-link:hover {
        background-color: #f9f9f9;
        color: #008AC9;
        opacity: 0.6 !important;
    }

    .menu-item-link i {
        color: #777;
        width: 24px;
        text-align: center;
        margin-right: 10px;
    }

    .has-children>.menu-item-link {
        /* Extra styling for items with children */
    }

    .drill-arrow {
        color: #ccc;
        font-size: 0.8rem;
    }

    /* Back Button */
    .menu-back-item {
        background: #f0f7fb;
        border-bottom: 1px solid #e1e8ed;
        color: #008AC9;
        font-weight: 700;
        cursor: pointer;
    }

    .menu-back-item .menu-item-link {
        color: #008AC9;
    }

    /* Search Bar in Menu */
    .menu-search-box {
        padding: 15px;
        background: #fff;
        border-bottom: 1px solid #eee;
        position: relative;
        z-index: 30;
        /* Above lists */
    }

    .menu-search-input {
        width: 100%;
        padding: 12px 15px 12px 40px;
        border: 1px solid #eee;
        background: #f8f8f8;
        border-radius: 8px;
        font-size: 0.95rem;
        outline: none;
        transition: all 0.2s;
    }

    .menu-search-input:focus {
        background: #fff;
        border-color: #008AC9;
        box-shadow: 0 0 0 3px rgba(0, 138, 201, 0.1);
    }

    .menu-search-icon {
        position: absolute;
        left: 30px;
        top: 50%;
        transform: translateY(-50%);
        color: #999;
    }

    /* Search Results Mode */
    .search-results-mode .child-level {
        display: none !important;
    }

    .search-results-mode .level-0 {
        transform: translateX(0) !important;
        opacity: 1 !important;
    }

    .hidden-by-search {
        display: none !important;
    }

    /* Mobile Overrides */
    @media (max-width: 768px) {
        #side-menu-panel {
            width: 85%;
            max-width: 360px;
        }
    }

