/**
 * Navbar público: dropdowns + menú móvil + cristal / scroll
 * Debe cargarse DESPUÉS de landing-responsive(.min).css y blog.css
 */

/* ——— Barra fija: cristal + compactación al scroll ——— */
.navbar {
    --nav-height: 72px;
    --nav-pad-y: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    min-height: var(--nav-height);
    display: flex;
    align-items: center;
    padding: var(--nav-pad-y) 0;
    background: linear-gradient(
        180deg,
        rgba(12, 10, 9, 0.62) 0%,
        rgba(12, 10, 9, 0.18) 55%,
        transparent 100%
    );
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 1px 0 rgba(212, 160, 23, 0.06);
    transition:
        min-height 0.42s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.42s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.42s ease,
        border-color 0.42s ease,
        box-shadow 0.42s ease,
        backdrop-filter 0.42s ease;
    isolation: isolate;
}

.navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.07) 0%,
        rgba(255, 255, 255, 0.02) 28%,
        transparent 55%
    );
    pointer-events: none;
    opacity: 0.65;
    transition: opacity 0.42s ease;
}

.navbar::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(212, 160, 23, 0.15) 20%,
        rgba(255, 215, 0, 0.55) 50%,
        rgba(212, 160, 23, 0.15) 80%,
        transparent
    );
    opacity: 0.35;
    transition: opacity 0.42s ease, left 0.42s ease, right 0.42s ease;
    pointer-events: none;
}

.navbar.scrolled {
    --nav-height: 58px;
    --nav-pad-y: 6px;
    background: rgba(12, 10, 9, 0.78);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    backdrop-filter: blur(20px) saturate(1.4);
    border-bottom-color: rgba(212, 160, 23, 0.22);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.38),
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 0 48px rgba(212, 160, 23, 0.08);
}

.navbar.scrolled::before {
    opacity: 0.9;
}

.navbar.scrolled::after {
    left: 4%;
    right: 4%;
    opacity: 1;
}

.nav-container {
    overflow: visible;
    gap: 12px;
    position: relative;
    z-index: 1;
    transition:
        padding 0.42s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.42s ease,
        border-color 0.42s ease,
        border-radius 0.42s ease,
        box-shadow 0.42s ease,
        backdrop-filter 0.42s ease,
        transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1200px) {
    .navbar {
        padding-left: 14px;
        padding-right: 14px;
    }

    .navbar.scrolled .nav-container {
        padding-top: 6px;
        padding-bottom: 6px;
        background: rgba(20, 16, 12, 0.52);
        -webkit-backdrop-filter: blur(14px) saturate(1.25);
        backdrop-filter: blur(14px) saturate(1.25);
        border: 1px solid rgba(212, 160, 23, 0.2);
        border-radius: 16px;
        box-shadow:
            0 10px 36px rgba(0, 0, 0, 0.32),
            inset 0 1px 0 rgba(255, 255, 255, 0.07),
            inset 0 -1px 0 rgba(0, 0, 0, 0.18);
        transform: translateY(0);
    }
}

.nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.nav-logo-wordmark {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.05;
    min-width: 0;
}

.nav-logo-line {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.logo-dp {
    font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    font-weight: 700;
    color: var(--primary, #d4a017);
    letter-spacing: -0.02em;
    transition: font-size 0.42s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s ease;
}

.logo-product {
    font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    font-weight: 400;
    color: var(--white, #fff);
    letter-spacing: -0.01em;
    transition: font-size 0.42s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.42s ease;
}

.logo-by {
    font-family: var(--font-main, 'Inter', system-ui, sans-serif);
    font-size: clamp(0.5rem, 1.1vw, 0.62rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.05em;
    text-transform: lowercase;
    margin-top: 2px;
    transition: font-size 0.42s ease, opacity 0.42s ease, margin 0.42s ease;
}

.navbar.scrolled .logo-dp,
.navbar.scrolled .logo-product {
    font-size: clamp(0.92rem, 1.9vw, 1.12rem);
}

.navbar.scrolled .logo-by {
    font-size: clamp(0.45rem, 1vw, 0.54rem);
    opacity: 0.48;
    margin-top: 1px;
}

.nav-logo:hover .logo-dp {
    color: var(--primary-light, #f4c430);
}

.nav-buttons .btn {
    transition:
        padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        font-size 0.35s ease,
        box-shadow 0.35s ease,
        transform 0.25s ease;
}

.navbar.scrolled .nav-buttons .btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.navbar.scrolled .nav-buttons .btn-primary {
    box-shadow: 0 4px 18px rgba(212, 160, 23, 0.28);
}

.nav-link,
.nav-dropdown__toggle {
    transition: color 0.2s ease, font-size 0.35s ease;
}

.navbar.scrolled .nav-link,
.navbar.scrolled .nav-dropdown__toggle {
    font-size: 13px;
}

.navbar.scrolled .nav-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 160, 23, 0.22);
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@media (prefers-reduced-motion: reduce) {
    .navbar,
    .navbar::before,
    .navbar::after,
    .nav-container,
    .logo-dp,
    .logo-product,
    .logo-by,
    .nav-buttons .btn,
    .nav-link,
    .nav-dropdown__toggle {
        transition: none !important;
    }
}

.nav-buttons {
    flex-shrink: 0;
}

.nav-header-actions {
    display: none;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.nav-mobile-login {
    display: none;
}

.nav-menu > li {
    list-style: none;
}

.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 997;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    backdrop-filter: blur(3px);
}

.nav-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.nav-menu-open {
    overflow: hidden;
}

.nav-dropdown {
    position: relative;
    list-style: none;
}

.nav-dropdown__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    padding: 0;
    color: var(--gray-300, #cbd5e1);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.nav-dropdown__toggle:hover,
.nav-dropdown.open .nav-dropdown__toggle,
.nav-dropdown__toggle.active {
    color: var(--primary-light, #f4c430);
}

.nav-chevron {
    display: inline-block;
    color: currentColor;
    opacity: 0.9;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.nav-dropdown__toggle .nav-chevron {
    margin-left: auto;
}

.nav-dropdown.open .nav-dropdown__toggle .nav-chevron {
    transform: rotate(180deg);
}

.logo-icon .nav-logo-icon {
    width: 1.15em;
    height: 1.15em;
    display: block;
}

.nav-dropdown__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-dropdown__menu li {
    list-style: none;
    margin: 0;
}

.nav-dropdown__link {
    display: block;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #e5e7eb;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown__link:hover {
    background: rgba(212, 160, 23, 0.12);
    color: var(--primary-light, #f4c430);
}

.nav-link.active,
.nav-dropdown__toggle.active {
    color: var(--primary-light, #f4c430);
}

.nav-mobile-buttons {
    display: none !important;
}

/* ——— Escritorio ancho (mismo breakpoint que landing-responsive: 1200px) ——— */
@media (min-width: 1200px) {
    .nav-toggle {
        display: none !important;
    }

    .nav-header-actions {
        display: none !important;
    }

    .nav-buttons {
        display: flex !important;
        flex-shrink: 0;
        margin-left: 8px;
    }

    .nav-container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 16px !important;
    }

    .nav-menu {
        position: static !important;
        right: auto !important;
        left: auto !important;
        width: auto !important;
        height: auto !important;
        flex: 1 1 auto !important;
        min-width: 0;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 18px !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .nav-menu > li {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        width: auto;
        border: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .nav-menu > .nav-mobile-buttons {
        display: none !important;
    }

    .nav-link,
    .nav-dropdown__toggle {
        font-size: 14px;
        line-height: 1.2;
    }

    .nav-link {
        display: inline-block;
        padding: 6px 0;
    }

    /* Sin subrayado animado en toggles de dropdown */
    .nav-dropdown__toggle.nav-link::after,
    .nav-dropdown__toggle::after {
        display: none !important;
    }

    .nav-dropdown__toggle .nav-chevron {
        display: inline-block;
        width: 10px;
        height: 7px;
        margin-left: 6px;
        flex-shrink: 0;
        vertical-align: middle;
        transition: transform 0.25s ease;
    }

    .nav-dropdown.open .nav-dropdown__toggle .nav-chevron,
    .nav-dropdown:focus-within .nav-dropdown__toggle .nav-chevron {
        transform: rotate(180deg);
    }

    /* Zona de hover extendida hacia abajo (puente al submenú) */
    .nav-dropdown::after {
        content: '';
        position: absolute;
        left: -8px;
        right: -8px;
        top: 100%;
        height: 18px;
        pointer-events: auto;
    }

    .nav-dropdown__toggle {
        padding-bottom: 6px;
    }

    .nav-dropdown__menu {
        position: absolute;
        top: calc(100% + 4px);
        left: 50%;
        min-width: 260px;
        padding: 6px 0;
        background: #14110f;
        border: 1px solid rgba(212, 160, 23, 0.28);
        border-radius: 12px;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
        z-index: 1002;
        display: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(-50%);
        transition: opacity 0.18s ease, visibility 0.18s ease;
    }

    /* Solapa superior transparente dentro del panel */
    .nav-dropdown__menu::before {
        content: '';
        position: absolute;
        top: -10px;
        left: 0;
        right: 0;
        height: 10px;
    }

    .nav-dropdown.open .nav-dropdown__menu,
    .nav-dropdown:focus-within .nav-dropdown__menu {
        display: block;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(-50%);
    }
}

/* ——— Tablet / móvil: panel lateral ——— */
@media (max-width: 1200px) {
    .nav-mobile-buttons {
        display: flex !important;
    }

    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        left: auto !important;
        right: -100% !important;
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 998 !important;
        transition: right 0.3s ease !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding: 88px 20px 28px !important;
        width: min(320px, 88vw) !important;
        background: var(--dark, #0c0a09) !important;
        border-left: 1px solid rgba(212, 160, 23, 0.2);
        box-shadow: -12px 0 40px rgba(0, 0, 0, 0.55);
        margin: 0 !important;
        justify-content: flex-start !important;
    }

    .nav-menu.active {
        right: 0 !important;
    }

    .nav-toggle {
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        z-index: 1002 !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        background: none;
        border: none;
    }

    .nav-container {
        overflow: visible !important;
        position: relative;
        z-index: 1001;
    }

    .nav-buttons {
        display: none !important;
    }

    .nav-header-actions {
        display: flex !important;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        margin-left: auto;
    }

    .nav-mobile-login {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        font-size: 13px;
        line-height: 1.2;
        padding: 8px 12px;
        min-height: 40px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .nav-dropdown::after {
        display: none;
    }

    .nav-menu > li {
        width: 100%;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .nav-menu > li:last-child {
        border-bottom: none;
    }

    .nav-link {
        display: block;
        width: 100%;
        padding: 14px 4px;
        font-size: 16px;
        font-weight: 500;
        color: #f3f4f6;
        text-align: left;
    }

    .nav-link::after {
        display: none;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown__toggle {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        padding: 14px 4px;
        min-height: 48px;
        font-size: 16px;
        font-weight: 500;
        color: #f3f4f6;
        text-align: left;
    }

    .nav-dropdown__menu {
        display: none;
        position: static;
        width: 100%;
        margin: 0 0 8px;
        padding: 0;
        background: rgba(212, 160, 23, 0.06);
        border: none;
        border-left: 3px solid rgba(212, 160, 23, 0.55);
        border-radius: 0 8px 8px 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        max-height: none;
        overflow: visible;
    }

    .nav-dropdown__menu::before {
        display: none;
    }

    .nav-dropdown.open .nav-dropdown__menu {
        display: block;
    }

    .nav-dropdown__link {
        padding: 12px 14px;
        font-size: 14px;
        line-height: 1.4;
        color: #e5e7eb;
        white-space: normal;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    .nav-dropdown__link:last-child {
        border-bottom: none;
    }

    .nav-mobile-buttons {
        width: 100%;
        margin-top: 16px;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        flex-direction: column;
        gap: 10px;
    }

    .nav-mobile-buttons .btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        font-size: 15px;
    }
}

@media (max-width: 380px) {
    .nav-mobile-login {
        font-size: 12px;
        padding: 7px 10px;
    }
}

/* Footer compacto: todos los links, sin lista infinita */
.footer {
    padding: 48px 0 24px;
}

.footer-grid,
.footer-grid--compact {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) minmax(22rem, 2.6fr) minmax(10rem, 1fr) minmax(9rem, 1fr);
    gap: 1.5rem 1.75rem;
    margin-bottom: 1.75rem;
    align-items: start;
}

.footer-acc {
    min-width: 0;
}

.footer-acc > summary {
    list-style: none;
    cursor: default;
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer-acc > summary::-webkit-details-marker {
    display: none;
}

.footer-links h3,
.footer-links h4 {
    margin: 0 0 8px;
    color: #e7e5e4;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.footer-links ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links li {
    margin: 0 0 4px;
}

.footer-links a {
    display: inline-flex;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.35;
    color: #a8a29e;
    text-decoration: none;
}

.footer-links a:hover {
    color: #fed7aa;
}

.footer-resources {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.footer-links:nth-child(2):not(:has(.footer-resources)) ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 1rem;
}

.public-seo-hub {
    padding: 36px 0;
}

.public-seo-hub__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.public-seo-hub__card {
    padding: 12px 14px;
    font-size: 13px;
}

.public-seo-hub__more {
    max-width: 960px;
    margin: 16px auto 0;
}

.public-seo-hub__more > summary {
    cursor: pointer;
    color: #fed7aa;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    padding: 12px;
    border: 1px solid rgba(253, 186, 116, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.public-seo-hub__more[open] > summary {
    margin-bottom: 12px;
}

.public-seo-hub__grid--dense {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 769px) {
    .footer-acc > :not(summary) {
        display: block !important;
    }
}

@media (max-width: 1100px) {
    .footer-grid,
    .footer-grid--compact {
        grid-template-columns: 1fr 1fr;
    }

    .footer-links--wide,
    .footer-links:nth-child(2) {
        grid-column: 1 / -1;
    }

    .public-seo-hub__grid,
    .public-seo-hub__grid--dense {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .footer-grid,
    .footer-grid--compact {
        grid-template-columns: 1fr !important;
        text-align: left !important;
        gap: 0;
        margin-bottom: 1rem;
    }

    .footer-acc {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .footer-acc > summary {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 48px;
        margin: 0;
        padding: 10px 0;
    }

    .footer-acc > summary::after {
        content: '+';
        color: #fed7aa;
        font-size: 1.2rem;
        line-height: 1;
    }

    .footer-acc[open] > summary::after {
        content: '–';
    }

    .footer-acc > :not(summary) {
        padding-bottom: 12px;
    }

    .footer-resources,
    .footer-links:nth-child(2):not(:has(.footer-resources)) ul {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem 1rem;
    }

    .footer-links a {
        justify-content: flex-start !important;
    }

    .public-seo-hub__grid,
    .public-seo-hub__grid--dense {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 380px) {
    .footer-resources,
    .footer-links:nth-child(2):not(:has(.footer-resources)) ul,
    .public-seo-hub__grid,
    .public-seo-hub__grid--dense {
        grid-template-columns: 1fr !important;
    }
}
