/* Ocultar elementos mobile en desktop, por defecto */
.sas-header-mobile-bar,
.sas-header-mobile-search,
.sas-hdrawer-overlay,
.sas-hdrawer {
    display: none;
}

html, body {
    margin: 0;
    padding: 0;
}

.sas-header-logo-row {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    padding: 0.5rem;
    background: #ffffff;
}

.sas-header-logo img {
    height: 60px;
    width: auto;
    display: block;
}

.sas-header-top {
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr min(700px, 50%) 1fr;
    align-items: center;
    gap: 2rem;
    padding: 1rem 3rem;
    background: #000000;
}

.sas-header-search {
    grid-column: 2;
    width: 100%;
}

.sas-header-search,
.sas-header-search .dgwt-wcas-search-wrapp,
.sas-header-search .dgwt-wcas-search-form,
.sas-header-search .dgwt-wcas-sf-wrapp,
.sas-header-search .dgwt-wcas-search-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.sas-header-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.sas-header-nuevo .sas-header-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0a0a0a;
    color: #ffffff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid #555;
    transition: background 0.2s ease;
}

.sas-header-nuevo .sas-header-btn:hover {
    border: 1px solid #ffffff;
}

.sas-header-nuevo .sas-header-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sas-header-nav {
    position: sticky;
    top: 0;
    z-index: 500;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    padding: 0 2rem;
    background: #000000;
    padding-bottom: 1rem;
}

body.admin-bar .sas-header-nav {
    top: 32px;
}

.sas-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-decoration: none;
    font-size: 20px;
    font-weight: 500;
    padding: 1rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.sas-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sas-nav-item:hover {
    color: #cc0000;
}

.sas-nav-item.is-active {
    color: #cc0000;
    border-bottom-color: #cc0000;
}

@media (max-width: 1600px) {
    .sas-header-top {
        padding: 1rem 1.5rem;
        gap: 1rem;
        grid-template-columns: 1fr min(700px, 45%) 1fr;
    }

    .sas-header-actions {
        gap: 12px;
    }

    .sas-header-nuevo .sas-header-btn {
        font-size: 16px;
        padding: 10px 18px;
        gap: 6px;
        white-space: nowrap;
    }

    .sas-header-nuevo .sas-header-btn svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 1024px) {

    /* Ocultar elementos desktop */
    .sas-header-logo-row,
    .sas-header-top,
    .sas-header-nav {
        display: none;
    }

    /* Bajo el z-index de la adminbar para que no me tape los menus */
    #wpadminbar {
        z-index: 400 !important;
    }

    /* Barra compacta */
    .sas-header-mobile-bar {
        position: sticky;
        top: 0;
        z-index: 500;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: #ffffff;
        border-bottom: 1px solid #eeece5;
    }
    
    .sas-header-mobile-bar .sas-header-mobile-trigger {
        background: #ffffff;
        border: 1px solid #eeece5;
        border-radius: 8px;
        color: #0a0a0a;
        padding: 8px;
        display: flex;
        align-items: center;
        cursor: pointer;
    }

    .sas-header-mobile-bar .sas-header-mobile-trigger svg {
        width: 24px;
        height: 24px;
        stroke: #0a0a0a;
        fill: none;
    }

    .sas-header-mobile-logo img {
        height: 40px;
        width: auto;
        display: block;
    }

    /* Buscador siempre visible */
    .sas-header-mobile-search {
        display: block;
        padding: 0.75rem 1rem;
        background: #000000;
    }

    .sas-header-mobile-search .dgwt-wcas-search-wrapp {
        width: 100% !important;
    }

    /* Overlay */
    .sas-hdrawer-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    
    .sas-hdrawer-overlay.is-open {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
    
    .sas-hdrawer {
        display: block;
        position: fixed;
        top: 0;
        bottom: 0;
        width: 280px;
        max-width: 80vw;
        background: #ffffff;
        z-index: 999;
        transition: transform 0.3s ease;
        overflow-y: auto;
    }
    
    .sas-hdrawer--left {
        left: 0;
        transform: translateX(-100%);
    }
    
    .sas-hdrawer--right {
        right: 0;
        transform: translateX(100%);
    }
    
    .sas-hdrawer.is-open {
        transform: translateX(0);
    }
    
    .sas-header-nuevo .sas-hdrawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.25rem;
        border-bottom: 1px solid #eeece5;
        background: #ffffff;
    }
    
    .sas-header-nuevo .sas-hdrawer-header span {
        font-weight: 700;
        color: #0a0a0a;
        font-size: 16px;
    }
    
    .sas-header-nuevo .sas-hdrawer-close {
        background: #f7f6f2;
        border: 1px solid #eeece5;
        border-radius: 8px;
        color: #0a0a0a;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        flex-shrink: 0;
    }
    
    .sas-header-nuevo .sas-hdrawer-close svg {
        width: 18px;
        height: 18px;
        stroke: #0a0a0a;
        fill: none;
    }
    
    .sas-hdrawer-nav {
        display: flex;
        flex-direction: column;
        padding: 0.5rem 0;
    }
    
    .sas-hdrawer-nav-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0.9rem 1.25rem;
        color: #0a0a0a;
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        border-left: 3px solid transparent;
        transition: background 0.2s ease, border-color 0.2s ease;
    }
    
    .sas-hdrawer-nav-item svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    
    .sas-hdrawer-nav-item:hover {
        background: #f7f6f2;
    }
    
    .sas-hdrawer-nav-item.is-active {
        color: #cc0000;
        border-left-color: #cc0000;
        background: #f7f6f2;
    }
}