/* Covema 2026 - Header, footer y componentes globales */
:root {
    --covema-ink: #17191d;
    --covema-muted: #6c7078;
    --covema-line: #e3e5e8;
    --covema-soft: #f5f6f7;
    --covema-dark: #292929;
    --covema-blue: var(--primary-color, #292e6d);
    --covema-accent: var(--tertiary-color, #0074e9);
    --covema-radius: 14px;
    --covema-shadow: 0 16px 44px rgba(18, 24, 40, .08);
}

body {
    color: var(--covema-ink);
}

/* Neutraliza el header fijo/transparente antiguo de Porto para el nuevo header. */
.header-wrapper,
.header-wrapper.fixed-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1002 !important;
    background: #fff !important;
    box-shadow: 0 1px 0 rgba(17, 24, 39, .08);
}

.admin-bar .header-wrapper,
.admin-bar .header-wrapper.fixed-header {
    top: 32px !important;
}

#header.covema-site-header {
    position: relative;
    background: #fff;
    color: var(--covema-ink);
    z-index: 1003;
}

#header.covema-site-header .covema-site-header__inner {
    min-height: 76px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
}

#header.covema-site-header .covema-site-header__brand,
#header.covema-site-header .covema-site-header__brand .logo {
    display: flex;
    align-items: center;
    margin: 0;
}

#header.covema-site-header .covema-site-header__brand .logo img,
#header.covema-site-header .custom-logo {
    width: auto;
    max-width: 190px;
    max-height: 48px;
    object-fit: contain;
}

.covema-text-logo {
    color: var(--covema-ink);
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
}

.covema-desktop-nav {
    min-width: 0;
}

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

.covema-nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
}

.covema-nav-menu > li {
    position: relative;
}

.covema-nav-menu > li > a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 13px;
    color: #2c2f35;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .015em;
    text-decoration: none;
    border-radius: 9px;
    transition: background .2s ease, color .2s ease;
}

.covema-nav-menu > li.current-menu-item > a,
.covema-nav-menu > li.current-menu-ancestor > a,
.covema-nav-menu > li > a:hover {
    background: #f3f4f6;
    color: var(--covema-blue);
}

.covema-nav-menu .sub-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    width: 230px;
    padding: 10px;
    border: 1px solid var(--covema-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--covema-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: .2s ease;
}

.covema-nav-menu li:hover > .sub-menu,
.covema-nav-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.covema-nav-menu .sub-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 7px;
    color: var(--covema-ink);
    text-decoration: none;
}

.covema-nav-menu .sub-menu a:hover {
    background: var(--covema-soft);
}

#header.covema-site-header .covema-site-header__actions {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.covema-header-phone,
.covema-menu-toggle {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--covema-line);
    border-radius: 10px;
    background: #fff;
    color: var(--covema-ink);
    text-decoration: none;
}

.covema-header-cars {
    height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0 18px;
    border-radius: 10px;
    background: var(--covema-blue);
    color: #fff !important;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
}

.covema-header-cars:hover {
    filter: brightness(1.08);
}

.covema-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.covema-menu-toggle span:not(.screen-reader-text) {
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 10px;
}

.covema-mobile-panel,
.covema-menu-backdrop {
    display: none;
}

/* Sucursales compartidas */
.covema-branches-section {
    padding: 76px 0;
    background: #f5f5f4;
}

.covema-global-heading {
    text-align: center;
    margin-bottom: 30px;
}

.covema-global-heading > span {
    display: block;
    margin-bottom: 7px;
    color: var(--covema-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.covema-global-heading h2 {
    margin: 0;
    color: var(--covema-ink);
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 800;
}

.covema-branches-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 920px;
    margin: 0 auto;
}

.covema-branch-card {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    min-height: 132px;
    padding: 22px;
    border: 1px solid #d6d7da;
    border-radius: 12px;
    background: rgba(255,255,255,.84);
}

.covema-branch-card h3 {
    margin: 0 0 8px;
    color: var(--covema-ink);
    font-size: 17px;
    font-weight: 800;
}

.covema-branch-card p,
.covema-branch-card a {
    margin: 0 0 6px;
    color: #555a63;
    font-size: 13px;
    line-height: 1.5;
    text-decoration: none;
}

.covema-branch-map {
    width: 84px;
    min-width: 84px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-left: 1px solid #d8dadd;
    color: var(--covema-ink) !important;
    text-align: center;
}

.covema-branch-map span {
    font-size: 28px;
}

.covema-branch-map strong {
    font-size: 11px;
    line-height: 1.2;
}

.covema-global-legal {
    padding: 70px 0 90px;
    background: #fff;
}

.covema-global-legal h2 {
    margin: 0 0 20px;
    color: var(--covema-ink);
    font-size: 24px;
    font-weight: 800;
}

.covema-global-legal .container > div {
    max-width: 1040px;
    color: #656a72;
    font-size: 12px;
    line-height: 1.8;
}

/* Footer */
.footer-wrapper {
    background: var(--covema-dark) !important;
}

#footer.covema-site-footer {
    padding: 0;
    background: #2d2d2d;
    color: #d7d7d7;
}

.covema-footer-nav {
    padding: 28px 0;
    border-bottom: 1px solid rgba(255,255,255,.13);
}

.covema-footer-menu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.covema-footer-menu li {
    margin: 0;
    padding: 0 18px;
}

.covema-footer-menu li + li {
    border-left: 1px solid rgba(255,255,255,.28);
}

.covema-footer-menu a {
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
    text-decoration: none;
}

.covema-footer-main {
    display: grid;
    grid-template-columns: 1.35fr .9fr .9fr .9fr;
    gap: 44px;
    padding: 54px 0 46px;
}

.covema-footer-brand .logo,
.covema-footer-brand .custom-logo-link {
    display: inline-flex;
    margin: 0 0 18px;
}

.covema-footer-brand .logo img,
.covema-footer-brand .custom-logo {
    width: auto;
    max-width: 205px;
    max-height: 54px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.covema-footer-brand p {
    max-width: 310px;
    margin: 0;
    color: #bdbdbd;
    font-size: 13px;
    line-height: 1.7;
}

.covema-footer-social {
    display: flex;
    gap: 14px;
    margin-top: 18px;
}

.covema-footer-social a,
.covema-footer-column a,
.covema-footer-column span {
    display: block;
    margin: 0 0 8px;
    color: #c9c9c9;
    font-size: 12px;
    line-height: 1.55;
    text-decoration: none;
}

.covema-footer-social a:hover,
.covema-footer-column a:hover {
    color: #fff;
}

.covema-footer-column h3 {
    margin: 0 0 18px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.covema-advisor {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    width: fit-content;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
}

.covema-footer-brands {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 34px;
    padding: 22px 0;
    border-top: 1px solid rgba(255,255,255,.1);
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.covema-footer-brands img {
    width: auto;
    max-width: 115px;
    max-height: 38px;
    object-fit: contain;
    filter: grayscale(1) brightness(0) invert(1);
    opacity: .9;
}

.covema-footer-brands span {
    color: #fff;
    font-weight: 800;
}

.covema-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0 26px;
    color: #999;
    font-size: 11px;
}

@media (max-width: 1199px) {
    .covema-desktop-nav { display: none; }
    #header.covema-site-header .covema-site-header__inner { grid-template-columns: 1fr auto; }
    .covema-menu-toggle { display: inline-flex; }
    .covema-mobile-panel {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(390px, 90vw);
        padding: 0;
        background: #fff;
        z-index: 1202;
        transform: translateX(102%);
        transition: transform .28s ease;
        box-shadow: -20px 0 50px rgba(0,0,0,.12);
    }
    .covema-mobile-panel__inner { padding: 22px; height: 100%; overflow-y: auto; }
    .covema-mobile-panel__top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--covema-line); }
    .covema-menu-close { width: 40px; height: 40px; border: 0; background: transparent; font-size: 32px; line-height: 1; cursor: pointer; }
    .covema-mobile-menu, .covema-mobile-menu ul { list-style: none; margin: 0; padding: 0; }
    .covema-mobile-menu { padding: 16px 0; }
    .covema-mobile-menu a { display: block; padding: 13px 4px; border-bottom: 1px solid #eceef0; color: var(--covema-ink); font-weight: 700; text-decoration: none; }
    .covema-mobile-menu .sub-menu a { padding-left: 22px; color: var(--covema-muted); font-weight: 600; }
    .covema-mobile-cars { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 10px; background: var(--covema-blue); color: #fff !important; font-weight: 800; text-decoration: none !important; }
    .covema-menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        border: 0;
        background: rgba(9, 12, 18, .48);
        z-index: 1201;
        opacity: 0;
        visibility: hidden;
        transition: .2s ease;
    }
    body.covema-menu-open { overflow: hidden; }
    body.covema-menu-open .covema-mobile-panel { transform: translateX(0); }
    body.covema-menu-open .covema-menu-backdrop { opacity: 1; visibility: visible; }
    .covema-footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .admin-bar .header-wrapper,
    .admin-bar .header-wrapper.fixed-header { top: 46px !important; }
    #header.covema-site-header .covema-site-header__inner { min-height: 66px; gap: 12px; }
    #header.covema-site-header .covema-site-header__brand .logo img,
    #header.covema-site-header .custom-logo { max-width: 145px; max-height: 42px; }
    .covema-header-cars { display: none; }
    .covema-header-phone { width: 40px; height: 40px; }
    .covema-branches-section { padding: 54px 0; }
    .covema-branches-grid { grid-template-columns: 1fr; }
    .covema-branch-card { min-height: 118px; padding: 18px; }
    .covema-footer-nav { display: none; }
    .covema-footer-main { grid-template-columns: 1fr; gap: 30px; padding: 42px 0 32px; }
    .covema-footer-brands { justify-content: flex-start; gap: 24px; }
    .covema-footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* Covema 2.0 — ajuste visual más fiel a la maqueta */
#header.covema-site-header .covema-site-header__inner { min-height:68px; }
#header.covema-site-header .covema-site-header__brand .logo img,
#header.covema-site-header .custom-logo { max-height:42px; max-width:185px; }
.covema-nav-menu > li > a { padding:0 11px; min-height:38px; border-radius:0; background:transparent!important; color:#333; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.02em; }
.covema-nav-menu > li.current-menu-item > a,
.covema-nav-menu > li.current-menu-ancestor > a,
.covema-nav-menu > li > a:hover { color:#111; }
.covema-site-footer { background:#303030!important; }
.covema-footer-brands { display:flex; align-items:center; justify-content:center; gap:30px; }
.covema-footer-brand { display:flex; min-width:70px; height:42px; align-items:center; justify-content:center; }
.covema-footer-brand img { width:auto; max-width:96px; max-height:34px; object-fit:contain; filter:grayscale(1) brightness(0) invert(1); }
.covema-footer-brand:hover img { opacity:.75; }
.covema-branches-section { padding:62px 0; }
.covema-branches-section .covema-global-heading > span { display:none; }
.covema-branches-section .covema-global-heading h2 { font-size:28px; color:#505050; }
.covema-branches-grid { max-width:820px; gap:14px; }
.covema-branch-card { min-height:110px; padding:16px 18px; border:2px solid #555; border-radius:7px; background:rgba(255,255,255,.88); }
.covema-branch-card h3 { font-size:14px; }
.covema-branch-card p,
.covema-branch-card a { font-size:11px; }
.covema-branch-map { min-width:72px; border-left:1px solid #aaa; border-radius:0; background:transparent; color:#333!important; }

@media (max-width: 767px) {
    #header.covema-site-header .covema-site-header__inner { min-height:62px; }
    .covema-footer-brands { gap:18px; flex-wrap:wrap; }
    .covema-footer-brand img { max-width:78px; }
}


/* Covema 2.2 - header fiel a la maqueta (logo + menú, sin CTAs extra en escritorio) */
@media (min-width: 1200px) {
    #header.covema-site-header .covema-site-header__inner {
        grid-template-columns: auto 1fr;
        min-height: 60px;
        gap: 42px;
    }
    #header.covema-site-header .covema-site-header__actions { display: none !important; }
    #header.covema-site-header .covema-site-header__brand .logo img,
    #header.covema-site-header .custom-logo { max-width: 170px; max-height: 38px; }
    .covema-nav-menu { gap: 16px; }
    .covema-nav-menu > li > a {
        padding: 0 3px;
        min-height: 36px;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: .025em;
    }
}


/* =========================================================
   COVEMA 2.11 · LOGO OFICIAL + LIMPIEZA DE CABECERA
   ========================================================= */
#header.covema-site-header .covema-header-brand-logo {
    display:inline-flex;
    align-items:center;
    justify-content:flex-start;
    line-height:0;
    text-decoration:none;
}
#header.covema-site-header .covema-header-brand-logo img {
    display:block;
    width:auto;
    height:auto;
    max-width:190px;
    max-height:44px;
    object-fit:contain;
}
.covema-footer-main-logo {
    display:inline-flex;
    align-items:center;
    line-height:0;
}
.covema-footer-main-logo img {
    display:block;
    width:auto;
    height:auto;
    max-width:190px;
    max-height:48px;
    object-fit:contain;
}
@media (min-width:1200px) {
    #header.covema-site-header .covema-header-brand-logo img { max-width:178px; max-height:40px; }
}
@media (max-width:767px) {
    #header.covema-site-header .covema-header-brand-logo img { max-width:150px; max-height:38px; }
    .covema-footer-main-logo img { max-width:160px; max-height:42px; }
}

/* =========================================================
   COVEMA 2.13 · SUBMENÚ DE MARCAS EN AUTOS NUEVOS
   ========================================================= */
@media (min-width: 992px) {
    .covema-nav-menu > li.covema-autos-parent > a {
        gap: 7px;
    }
    .covema-nav-menu > li.covema-autos-parent > a::after {
        content: "";
        width: 6px;
        height: 6px;
        margin-top: -3px;
        border-right: 1.5px solid currentColor;
        border-bottom: 1.5px solid currentColor;
        transform: rotate(45deg);
        transform-origin: center;
        transition: transform .18s ease;
    }
    .covema-nav-menu > li.covema-autos-parent:hover > a::after,
    .covema-nav-menu > li.covema-autos-parent:focus-within > a::after {
        transform: translateY(3px) rotate(225deg);
    }
    .covema-nav-menu > li.covema-autos-parent > .sub-menu {
        top: calc(100% + 1px);
        left: 50%;
        width: 205px;
        padding: 8px 0;
        border: 1px solid #e5e5e5;
        border-top: 2px solid #242424;
        border-radius: 0 0 5px 5px;
        background: #fff;
        box-shadow: 0 12px 28px rgba(0,0,0,.10);
        transform: translate(-50%, 7px);
        z-index: 1500;
    }
    .covema-nav-menu > li.covema-autos-parent:hover > .sub-menu,
    .covema-nav-menu > li.covema-autos-parent:focus-within > .sub-menu {
        transform: translate(-50%, 0);
    }
    .covema-nav-menu .covema-brand-menu-item > a {
        position: relative;
        display: flex;
        min-height: 40px;
        padding: 9px 18px;
        align-items: center;
        border-radius: 0;
        color: #333;
        font-size: 13px;
        font-weight: 500;
        letter-spacing: .025em;
        text-transform: uppercase;
        transition: background .16s ease, padding-left .16s ease;
    }
    .covema-nav-menu .covema-brand-menu-item > a::before {
        content: "";
        width: 0;
        height: 1px;
        margin-right: 0;
        background: #222;
        transition: width .16s ease, margin-right .16s ease;
    }
    .covema-nav-menu .covema-brand-menu-item > a:hover,
    .covema-nav-menu .covema-brand-menu-item.current-menu-item > a {
        padding-left: 15px;
        background: #f6f6f6;
        color: #111;
    }
    .covema-nav-menu .covema-brand-menu-item > a:hover::before,
    .covema-nav-menu .covema-brand-menu-item.current-menu-item > a::before {
        width: 14px;
        margin-right: 8px;
    }
}

@media (max-width: 991px) {
    .covema-mobile-menu .covema-autos-parent > a {
        font-weight: 800;
    }
    .covema-mobile-menu .covema-autos-parent > .sub-menu {
        margin: 0 0 8px 8px;
        padding: 0 0 0 14px;
        border-left: 2px solid #ececec;
    }
    .covema-mobile-menu .covema-brand-menu-item > a {
        padding: 11px 8px 11px 12px;
        border-bottom: 1px solid #f0f0f0;
        color: #555;
        font-size: 14px;
        font-weight: 600;
        text-transform: uppercase;
    }
}
