/* =========================================================
   JDBB INDUSTRIA — ESTRUCTURA GENERAL
========================================================= */

:root {
    --brand: #c8102e;
    --brand-light: #eb2947;
    --brand-dark: #8e0d22;
    --ink: #171a1d;
    --ink-soft: #4e555c;
    --paper: #f4f3ef;
    --white: #ffffff;
    --line: rgba(19, 23, 27, .13);
    --header-height: 118px;
    --site-width: 1380px;
    --site-gutter: clamp(18px, 4vw, 62px);
    --shadow: 0 14px 36px rgba(9, 12, 15, .12);
}


*,
*::before,
*::after {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    min-width: 320px;
    margin: 0;
    overflow-x: hidden;
    background: var(--paper);
    color: var(--ink);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


img {
    display: block;
    max-width: 100%;
}


a {
    color: inherit;
    text-decoration: none;
}


button,
input,
textarea,
select {
    font: inherit;
}


button,
a {
    -webkit-tap-highlight-color: transparent;
}


::selection {
    background: var(--brand);
    color: var(--white);
}


a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(200, 16, 46, .45);
    outline-offset: 4px;
}


/* =========================================================
   ENCABEZADO
========================================================= */

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    width: 100%;
}


.topbar {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 5vw, 62px);
    padding: 6px var(--site-gutter);
    background: #070809;
    color: #d7dadd;
    font-size: 12px;
}


.topbar a,
.topbar span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}


.topbar i {
    color: var(--brand-light);
    font-size: 11px;
}


.topbar a:hover {
    color: var(--white);
}


.main-header {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(18px, 3vw, 42px);
    padding: 0 var(--site-gutter);
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px) saturate(145%);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
}


.logo {
    width: clamp(135px, 13vw, 180px);
    min-height: 70px;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}


.logo img {
    width: auto;
    max-width: 100%;
    height: 78px;
    object-fit: contain;
    filter: contrast(1.07) saturate(1.05);
    transition: transform .25s ease;
}


.logo:hover img {
    transform: scale(1.025);
}


/* =========================================================
   MENÚ
========================================================= */

.nav {
    margin-left: auto;
}


.nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}


.nav > ul {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 2vw, 31px);
}


.nav > ul > li {
    position: relative;
}


.nav > ul > li > a,
.dropdown-link {
    position: relative;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 1px;
    background: transparent;
    border: 0;
    color: #22272c;
    cursor: pointer;
    font-size: clamp(13px, 1vw, 15px);
    font-weight: 650;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: color .22s ease;
}


.nav > ul > li > a::after,
.dropdown-link::after {
    position: absolute;
    right: 50%;
    bottom: 3px;
    left: 50%;
    height: 3px;
    background: var(--brand);
    border-radius: 999px;
    content: "";
    transition: right .22s ease, left .22s ease;
}


.nav > ul > li > a:hover,
.nav > ul > li > a.active,
.dropdown-link:hover,
.dropdown.active > .dropdown-link {
    color: var(--brand);
}


.nav > ul > li > a:hover::after,
.nav > ul > li > a.active::after,
.dropdown-link:hover::after,
.dropdown.active > .dropdown-link::after {
    right: 0;
    left: 0;
}


.dropdown-link {
    gap: 9px;
}


.dropdown-link::before {
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    content: "";
    transform: rotate(45deg) translateY(-2px);
    transition: transform .22s ease;
}


.dropdown:hover > .dropdown-link::before,
.dropdown.open > .dropdown-link::before {
    transform: rotate(225deg) translate(-1px, -1px);
}


.submenu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    z-index: 20;
    width: 245px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px !important;
    background: #0b0c0d;
    border: 1px solid #292c2f;
    border-top: 3px solid var(--brand);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .38);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
}


.dropdown::after {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 14px;
    content: "";
}


.dropdown:hover > .submenu,
.dropdown:focus-within > .submenu,
.dropdown.open > .submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}


.submenu a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px 13px;
    border-radius: 3px;
    color: #d7dadd;
    font-size: 13px;
    transition: background .2s ease, color .2s ease, padding-left .2s ease;
}


.submenu a:hover,
.submenu a.active {
    padding-left: 18px;
    background: #1b1d20;
    color: var(--white);
}


.btn-header {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 11px 17px;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 4px;
    color: var(--white) !important;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .05em;
    text-align: center;
    text-transform: uppercase;
    transition: background .22s ease, border-color .22s ease, transform .22s ease;
}


.btn-header:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    transform: translateY(-2px);
}


.menu-toggle {
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 5px;
    color: var(--ink);
    cursor: pointer;
    font-size: 24px;
}


.menu-toggle:hover {
    background: rgba(200, 16, 46, .08);
    color: var(--brand);
}


/* =========================================================
   CONTENIDO DINÁMICO
========================================================= */

#contenido {
    width: 100%;
    min-height: 70vh;
    padding-top: var(--header-height);
    outline: none;
}


.page-loading,
.page-error {
    min-height: 430px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 70px 20px;
    text-align: center;
}


.page-loading span {
    width: 36px;
    height: 36px;
    border: 3px solid #d8dadd;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}


.page-loading p,
.page-error p {
    margin: 0;
    color: var(--ink-soft);
}


.page-error h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 48px);
}


@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   PIE DE PÁGINA
========================================================= */

.site-footer {
    background: #070809;
    color: #d5d7da;
}


.footer-grid {
    width: min(var(--site-width), calc(100% - (var(--site-gutter) * 2)));
    margin: auto;
    display: grid;
    grid-template-columns: 1.2fr .7fr 1fr;
    gap: clamp(34px, 6vw, 90px);
    padding-top: clamp(52px, 7vw, 88px);
    padding-bottom: clamp(44px, 6vw, 72px);
}


.footer-brand img {
    width: auto;
    max-width: 165px;
    height: 74px;
    margin-bottom: 18px;
    object-fit: contain;
    filter: brightness(1.22) contrast(1.03);
}


.footer-brand p,
.footer-column p {
    max-width: 430px;
    margin: 0;
    color: #979ca1;
    font-size: 13px;
    line-height: 1.7;
}


.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}


.footer-column h2 {
    margin: 0 0 7px;
    color: var(--white);
    font-size: 13px;
    letter-spacing: .12em;
    text-transform: uppercase;
}


.footer-column a,
.footer-column p {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}


.footer-column a {
    color: #b8bdc2;
    font-size: 13px;
}


.footer-column a:hover {
    color: var(--white);
}


.footer-column i {
    width: 14px;
    margin-top: 4px;
    color: var(--brand-light);
    text-align: center;
}


.copy {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px var(--site-gutter);
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: #747a80;
    font-size: 11px;
}


.whatsapp {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 900;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25d366;
    border: 2px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
    color: var(--white) !important;
    font-size: 27px;
    transition: transform .22s ease, box-shadow .22s ease;
}


.whatsapp:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .30);
}


.noscript-message {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2000;
    margin: 0;
    padding: 14px;
    background: #fff4d6;
    color: #503a00;
    text-align: center;
}


/* =========================================================
   TABLETAS Y MENÚ MÓVIL
========================================================= */

@media (max-width: 980px) {
    :root {
        --header-height: 72px;
    }

    .topbar {
        display: none;
    }

    .main-header {
        position: relative;
        min-height: 72px;
        padding: 0 18px;
    }

    .logo {
        width: 142px;
        min-height: 64px;
    }

    .logo img {
        height: 64px;
    }

    .menu-toggle {
        display: flex;
        order: 3;
    }

    .btn-header {
        min-height: 42px;
        margin-left: auto;
        padding: 9px 12px;
        font-size: 10px;
    }

    .nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        width: 100%;
        max-height: calc(100svh - 72px);
        display: none;
        margin: 0;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 8px 18px 18px;
        background: rgba(8, 9, 10, .99);
        border-top: 3px solid var(--brand);
        box-shadow: 0 18px 35px rgba(0, 0, 0, .38);
    }

    .nav.active {
        display: block;
    }

    .nav > ul {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav > ul > li {
        width: 100%;
    }

    .nav > ul > li > a,
    .dropdown-link {
        width: 100%;
        min-height: 49px;
        justify-content: flex-start;
        padding: 12px 7px;
        border-bottom: 1px solid #292c2f;
        color: #eceeef;
        font-size: 14px;
    }

    .nav > ul > li > a::after,
    .dropdown-link::after {
        top: auto;
        right: auto;
        bottom: -1px;
        left: 0;
        width: 0;
        transition: width .22s ease;
    }

    .nav > ul > li > a:hover,
    .nav > ul > li > a.active,
    .dropdown-link:hover,
    .dropdown.open > .dropdown-link {
        background: #151719;
        color: var(--white);
    }

    .nav > ul > li > a:hover::after,
    .nav > ul > li > a.active::after,
    .dropdown-link:hover::after,
    .dropdown.open > .dropdown-link::after {
        right: auto;
        left: 0;
        width: 76px;
    }

    .dropdown::after {
        display: none;
    }

    .submenu {
        position: static;
        width: 100%;
        display: none;
        padding: 5px 0 5px 12px !important;
        background: #101214;
        border: 0;
        border-left: 2px solid var(--brand);
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    .dropdown:hover > .submenu,
    .dropdown:focus-within > .submenu {
        display: none;
        transform: none;
    }

    .dropdown.open > .submenu {
        display: flex;
        transform: none;
    }

    .submenu a {
        min-height: 43px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}


@media (max-width: 560px) {
    .main-header {
        padding: 0 13px;
    }

    .logo {
        width: 124px;
    }

    .logo img {
        height: 58px;
    }

    .btn-header {
        display: none;
    }

    .nav {
        padding: 6px 13px 15px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .footer-brand {
        grid-column: auto;
    }

    .copy {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 17px;
    }

    .whatsapp {
        right: 14px;
        bottom: 14px;
        width: 52px;
        height: 52px;
        font-size: 25px;
    }
}


@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
