/* =============================================
   Header DREJ v2 - Estilo DIRESA Junín
   ============================================= */

#hdrej-wrapper {
    width: calc(100% - 20px);
    margin: 10px auto;
    font-family: Arial, sans-serif;
    position: relative;
    z-index: 99990;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

/* ---- BARRA SUPERIOR VERDE ---- */
.hdrej-topbar {
    background: #1a6e1a;
    padding: 5px 0;
}
.hdrej-topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.hdrej-topbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
}
.hdrej-topbar-center {
    flex: 1;
    text-align: center;
}
.hdrej-lema {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.hdrej-topbar-right {
    display: flex;
    align-items: center;
}

/* Botones icono circulares */
.hdrej-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.2s;
    flex-shrink: 0;
}
.hdrej-icon-btn:hover { background: rgba(255,255,255,0.35); }
.hdrej-icon-btn svg { width: 16px; height: 16px; }

@keyframes hdrej-shake {
    0%, 100% { transform: rotate(0deg); }
    20%      { transform: rotate(-12deg); }
    40%      { transform: rotate(10deg); }
    60%      { transform: rotate(-8deg); }
    80%      { transform: rotate(6deg); }
}
.hdrej-icon-btn:hover,
.hdrej-junin-badge:hover svg {
    animation: hdrej-shake 0.5s ease-in-out;
}

/* Colores específicos redes */
.hdrej-fb  { background: #1877f2; }
.hdrej-fb:hover { background: #1558b0; }
.hdrej-yt  { background: #ff0000; }
.hdrej-yt:hover { background: #cc0000; }

/* Badge Junín */
.hdrej-junin-badge {
    display: flex;
    align-items: center;
    margin-left: 4px;
}

/* ---- BARRA BÚSQUEDA ---- */
.hdrej-searchbar {
    background: #f1f1f1;
    padding: 8px 20px;
    display: none;
    border-bottom: 2px solid #1a6e1a;
}
.hdrej-searchbar.hdrej-open { display: block; }
.hdrej-searchbar form {
    display: flex;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto;
}
.hdrej-search-input {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}
.hdrej-search-input:focus { border-color: #1a6e1a; }
.hdrej-search-submit {
    background: #1a6e1a;
    color: #fff;
    border: none;
    padding: 7px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.hdrej-search-submit:hover { background: #145214; }

/* ---- BRAND (logo + menú + accesos en una sola fila) ---- */
.hdrej-brand {
    position: relative;
    overflow: hidden;
}
.hdrej-brand-bg {
    background: linear-gradient(135deg, #e65c00 0%, #f97316 18%, #fff 38%, #fff 62%, #1a6e1a 80%, #145214 100%);
    padding: 14px 0;
}
.hdrej-brand-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
}

.hdrej-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.hdrej-logo {
    height: 70px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
    border-radius: 12px;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}
.hdrej-logo-link:hover .hdrej-logo {
    transform: rotateX(360deg);
}

/* Botones acceso + menú van en la misma fila a la derecha */
.hdrej-access-btns {
    display: flex;
    align-items: stretch;
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
}

.hdrej-access-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #2d8a2d;
    color: #fff !important;
    text-decoration: none !important;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: bold;
    line-height: 1.4;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    transition: background 0.2s;
    white-space: nowrap;
}
.hdrej-access-btn:hover { background: #1f6b1f; }
.hdrej-access-btn svg { flex-shrink: 0; }
.hdrej-access-btn span { text-align: left; }

/* ---- MENÚ NAV ---- */
.hdrej-nav {
    background: transparent;
    border: none;
}
.hdrej-nav-inner { display: contents; }
.hdrej-hamburger {
    display: none;
    background: #1a6e1a;
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    padding: 12px 16px;
    cursor: pointer;
    width: 100%;
    text-align: left;
}
.hdrej-nav-links {
    display: flex;
    align-items: stretch;
    border-radius: 22px;
    overflow: hidden;
    margin-right: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.hdrej-nav-item {
    color: #fff !important;
    text-decoration: none !important;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 10px 14px;
    border-right: 1px solid rgba(255,255,255,0.15);
    transition: background 0.2s;
    white-space: nowrap;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    background: #1a6e1a;
}
.hdrej-nav-item:hover  { background: #0d4a0d; }
.hdrej-nav-item.hdrej-active { background: #0d4a0d; }

.hdrej-nav-home {
    background: #0d4a0d;
    padding: 10px 14px;
}
.hdrej-nav-home:hover { background: #083208; }

.hdrej-nav-plus {
    background: #2d8a2d;
    border: none;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    padding: 0 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.hdrej-nav-plus:hover { background: #1a6e1a; }

/* ---- OCULTAR HEADER ORIGINAL DEL TEMA ---- */
header.header,
#top-head,
#top-navi,
#search-panel {
    display: none !important;
}

/* ---- SUBMENÚS DESPLEGABLES ---- */
.hdrej-nav-dropdown {
    position: relative;
    display: flex;
    align-items: stretch;
}
.hdrej-caret {
    margin-left: 3px;
    vertical-align: middle;
    transition: transform 0.2s;
}
.hdrej-nav-dropdown:hover .hdrej-caret {
    transform: rotate(180deg);
}
.hdrej-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 99991;
    display: flex;
    flex-direction: column;
}
.hdrej-nav-dropdown:hover .hdrej-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.hdrej-submenu-item {
    display: block;
    padding: 10px 16px;
    color: #1a6e1a !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
    white-space: nowrap;
}
.hdrej-submenu-item:last-child { border-bottom: none; }
.hdrej-submenu-item:hover { background: #f0f7f0; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .hdrej-lema { font-size: 10px; }
    .hdrej-nav-item { font-size: 10px; padding: 10px 9px; }
}
@media (max-width: 768px) {
    .hdrej-topbar-center { display: none; }
    .hdrej-logo { height: 50px; }
    .hdrej-brand-inner { flex-wrap: wrap; padding: 8px; }
    .hdrej-access-btns { flex-direction: column; width: 100%; }
    .hdrej-hamburger { display: block; }
    .hdrej-nav-links { display: none; flex-direction: column; width: 100%; }
    .hdrej-nav-links.hdrej-open { display: flex; }
    .hdrej-nav-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.15); }
    .hdrej-nav-plus { padding: 12px 18px; }

    .hdrej-nav-dropdown { width: 100%; }
    .hdrej-submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        border-radius: 0;
        box-shadow: none;
        background: rgba(255,255,255,0.95);
    }
    .hdrej-nav-dropdown.hdrej-submenu-open .hdrej-submenu { display: block; }
}
