/**
 * Llaves de Coche Baratas — v4.2
 * Diseño comercial profesional
 * Tel: 613 994 376
 * Fuente Inter local (SIL Open Font License 1.1)
 * Correcciones: contraste, banners, touch targets, foco, --gray-700
 */

/* ═══════════════════════════════════════════════════════════════
   FUENTE LOCAL — Inter Variable
   ═══════════════════════════════════════════════════════════════ */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/InterVariable.woff2') format('woff2');
}

/* ═══════════════════════════════════════════════════════════════
   VARIABLES
   ═══════════════════════════════════════════════════════════════ */
:root {
    --primary: #0d4a5c;
    --primary-dark: #093544;
    --accent: #f9c22e;
    --accent-dark: #b38600; /* Mejorado: ratio 3.62:1 sobre blanco (cumple AA texto grande) */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-700: #374151; /* Añadido: faltaba */
    --gray-800: #1f2937;
    --gray-900: #111827;
    --font: 'Inter', system-ui, sans-serif;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --focus-ring: 0 0 0 3px rgba(13, 74, 92, 0.4); /* Para foco visible */
}

/* ═══════════════════════════════════════════════════════════════
   RESET
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--gray-800); background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section h2 { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); text-align: center; margin-bottom: 40px; }

/* ═══════════════════════════════════════════════════════════════
   BOTONES
   ═══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 24px; font-size: 0.95rem; font-weight: 600;
    border-radius: var(--radius); cursor: pointer; transition: all 0.15s;
    border: none;
}
.btn--primary { background: var(--accent); color: var(--gray-900); gap: 8px; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,0.4); }
.btn--ghost:hover { background: rgba(255,255,255,0.1); border-color: var(--white); }
.btn--small { padding: 10px 20px; font-size: 0.875rem; background: var(--primary); color: var(--white); }
.btn--small:hover { background: var(--primary-dark); }
.btn--disabled { background: var(--gray-200); color: var(--gray-400); cursor: not-allowed; }
.btn--whatsapp { background: #25d366; color: var(--white); gap: 8px; }
.btn--whatsapp:hover { background: #1da851; }
.btn svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   ACCESIBILIDAD — Foco visible para navegación con teclado
   ═══════════════════════════════════════════════════════════════ */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}
.header__phone:focus-visible,
.header__whatsapp:focus-visible,
.header__toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
/* Foco en fondo oscuro */
.hero a:focus-visible,
.ventajas a:focus-visible,
.footer a:focus-visible {
    outline-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(249, 194, 46, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: var(--white); box-shadow: var(--shadow);
}
.header__inner {
    max-width: 1080px; margin: 0 auto; padding: 12px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.header__logo { height: 44px; width: auto; max-width: 200px; }
.header__nav { display: none; }
.header__nav ul { display: flex; gap: 28px; }
.header__nav a { font-size: 0.9rem; font-weight: 500; color: var(--gray-600); transition: color 0.15s; }
.header__nav a:hover { color: var(--primary); }
.header__cta { display: none; align-items: center; gap: 12px; }
.header__phone {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: var(--radius);
    font-size: 0.9rem; font-weight: 600; color: var(--primary);
    border: 1px solid var(--primary); transition: all 0.15s;
}
.header__phone:hover { background: var(--primary); color: var(--white); }
.header__phone svg { color: inherit; }
.header__whatsapp {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%; /* Aumentado a 44px mínimo táctil */
    background: #25d366; color: var(--white); transition: background 0.15s;
}
.header__whatsapp:hover { background: #1da851; }
.header__toggle { 
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 5px; min-width: 44px; min-height: 44px; /* Mínimo táctil 44x44 */
    padding: 10px; background: none; border: none; cursor: pointer; 
}
.header__toggle span { width: 22px; height: 2px; background: var(--gray-800); border-radius: 1px; }

.mobile-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-top: 1px solid var(--gray-100); box-shadow: var(--shadow-md); }
.mobile-menu.is-open { display: block; }
.mobile-menu a { display: block; padding: 14px 20px; font-size: 0.95rem; color: var(--gray-700); border-bottom: 1px solid var(--gray-100); } /* --gray-700 ahora definida */

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */
.hero {
    background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 100px 0 60px; text-align: center;
}
.hero h1 { font-size: clamp(1.5rem, 4.5vw, 2.5rem); font-weight: 800; color: var(--white); line-height: 1.25; margin-bottom: 16px; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1rem; color: rgba(255,255,255,0.85); max-width: 480px; margin: 0 auto 28px; }
.hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════
   OFERTAS - Tarjetas 3 columnas
   ═══════════════════════════════════════════════════════════════ */
.ofertas { background: var(--gray-50); }

.ofertas__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.oferta-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}
.oferta-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.oferta-card__img {
    position: relative;
    aspect-ratio: 16/9; /* Ajustado al ratio real de las imágenes */
    overflow: hidden;
    background: var(--gray-100);
}
.oferta-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Imagen completa sin recorte */
    object-position: center;
}

.oferta-card__body {
    padding: 20px;
}
.oferta-card__body h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}
.oferta-card__price {
    font-size: 1.1rem;
    color: var(--gray-600);
    margin-bottom: 4px;
}
.oferta-card__price strong {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-dark);
}
.oferta-card__desc {
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-bottom: 16px;
}

/* Calculador de precios a domicilio */
.oferta-card__domicilio {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}
.oferta-card__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 8px;
}
.oferta-card__label svg {
    color: var(--primary);
    flex-shrink: 0;
}
.oferta-localidad {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    background: var(--gray-50);
    color: var(--gray-800);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23145566' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.oferta-localidad:hover {
    border-color: var(--primary-dark);
    background: var(--white);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}
.oferta-localidad:focus {
    outline: none;
    border-color: var(--primary-dark);
    background: var(--white);
    box-shadow: var(--focus-ring), 0 4px 8px rgba(0, 0, 0, 0.12);
}
.oferta-card__resultado {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    text-align: center;
    animation: fadeIn 0.3s ease;
}
.oferta-card__resultado.is-visible {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.oferta-card__resultado-texto {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 4px;
}
.oferta-card__precio-total {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    margin: 0 0 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.oferta-card__btn-domicilio {
    width: 100%;
    justify-content: center;
}
.oferta-card__btn-domicilio svg {
    flex-shrink: 0;
}

.ofertas__disclaimer {
    max-width: 700px;
    margin: 32px auto 0;
    padding: 16px 24px;
    background: var(--gray-50);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    text-align: left;
}
.ofertas__disclaimer p {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0;
}
.ofertas__disclaimer strong {
    color: var(--gray-800);
}

/* ═══════════════════════════════════════════════════════════════
   SERVICIOS - Grid con iconos SVG
   ═══════════════════════════════════════════════════════════════ */
.servicios__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.servicio {
    padding: 24px 20px;
    text-align: center;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}
.servicio:hover { border-color: var(--primary); }

.servicio__icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 12px;
    color: var(--primary);
}

.servicio h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.servicio p {
    font-size: 0.8rem;
    color: var(--gray-400);
}

/* ═══════════════════════════════════════════════════════════════
   VENTAJAS
   ═══════════════════════════════════════════════════════════════ */
.ventajas { background: var(--primary-dark); padding: 48px 0; }

.ventajas__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.ventaja {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    color: var(--white);
}
.ventaja__num {
    flex-shrink: 0;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent);
    color: var(--gray-900);
    font-weight: 800;
    font-size: 1rem;
    border-radius: 50%;
}
.ventaja h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.ventaja p { font-size: 0.875rem; color: rgba(255,255,255,0.75); }

/* ═══════════════════════════════════════════════════════════════
   CONTACTO
   ═══════════════════════════════════════════════════════════════ */
.contacto { background: var(--gray-50); }
.contacto__intro { text-align: center; color: var(--gray-600); margin-top: -24px; margin-bottom: 32px; }

.contacto__card {
    max-width: 420px;
    margin: 0 auto 32px;
    padding: 32px 24px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}
.contacto__card p { color: var(--gray-600); margin-bottom: 20px; }
.contacto__phone {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 1.5rem; color: var(--primary);
}
.contacto__phone svg { color: var(--primary); }
.contacto__phone strong { font-weight: 700; }
.contacto__btns { display: flex; gap: 12px; justify-content: center; margin-bottom: 16px; }
.contacto__card small { font-size: 0.75rem; color: var(--gray-400); }

.contacto__zona {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px 24px;
    background: var(--white);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    text-align: center;
}
.contacto__zona strong { display: block; color: var(--primary); font-size: 0.9rem; margin-bottom: 6px; }
.contacto__zona p { font-size: 0.85rem; color: var(--gray-600); }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 40px 0 24px;
}
.footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}
.footer__logo { height: 36px; width: auto; margin-bottom: 12px; }
.footer__col p { font-size: 0.85rem; line-height: 1.6; }
.footer__col h4 { color: var(--white); font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; }
.footer__col ul li { margin-bottom: 6px; }
.footer__col a { font-size: 0.85rem; transition: color 0.15s; }
.footer__col a:hover { color: var(--accent); }
.footer__link { display: block; margin-bottom: 6px; }
.footer__zona { margin-top: 12px; font-size: 0.8rem; }
.footer__bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}
.footer__legal a:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
/* Mobile: show only icons in header with proper touch targets */
.header__phone span { display: none; }
.header__phone { padding: 10px; border-radius: 50%; width: 44px; height: 44px; justify-content: center; } /* 44px mínimo táctil */
.header__cta { display: flex; gap: 8px; } /* Reducir gap para que quepan los iconos más grandes */

@media (min-width: 768px) {
    .header__nav { display: block; }
    .header__toggle { display: none; }
    .header__logo { height: 48px; max-width: 220px; }
    .header__phone { width: auto; padding: 8px 14px; border-radius: var(--radius); }
    .header__phone span { display: inline; }
    .hero { padding: 120px 0 80px; }
    .hero p { font-size: 1.1rem; }
}

@media (max-width: 900px) {
    .ofertas__grid { grid-template-columns: repeat(2, 1fr); }
    .ofertas__grid .oferta-card:last-child { grid-column: span 2; max-width: 400px; margin: 0 auto; }
}

@media (max-width: 767px) {
    .section { padding: 48px 0; }
    .section h2 { font-size: 1.25rem; margin-bottom: 28px; }
    
    .hero { padding: 90px 0 50px; }
    .hero__actions { flex-direction: column; align-items: center; }
    .hero__actions .btn { width: 200px; }
    
    .ofertas__grid { grid-template-columns: 1fr; }
    .ofertas__grid .oferta-card:last-child { grid-column: auto; max-width: none; }
    
    .servicios__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .servicio { padding: 20px 12px; }
    .servicio__icon { width: 28px; height: 28px; }
    .servicio h3 { font-size: 0.85rem; }
    .servicio p { font-size: 0.75rem; }
    
    .ventajas__grid { grid-template-columns: 1fr; gap: 20px; }
    .ventaja { gap: 12px; }
    
    .contacto__btns { flex-direction: column; align-items: center; }
    
    .footer__grid { grid-template-columns: 1fr; text-align: center; gap: 24px; }
    .footer__logo { margin: 0 auto 12px; }
    .footer__bottom { flex-direction: column; text-align: center; gap: 8px; }
}

@media (max-width: 480px) {
    .servicios__grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   PÁGINAS LEGALES
   ═══════════════════════════════════════════════════════════════ */
.legal {
    padding-top: 100px; /* Compensar header fijo */
    background: var(--white);
}
.legal__container {
    max-width: 800px;
}
.legal h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 16px;
}
.legal__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 24px;
    padding: 8px 0;
    transition: color 0.2s;
}
.legal__back:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}
.legal__intro {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}
.legal h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 32px 0 16px;
    text-align: left;
}
.legal p, .legal li {
    font-size: 0.95rem;
    color: var(--gray-700);
    line-height: 1.7;
    margin-bottom: 12px;
}
.legal ul {
    margin: 0 0 16px 24px;
    list-style: disc;
}
.legal ul li {
    margin-bottom: 8px;
}
.legal a {
    color: var(--primary);
    text-decoration: underline;
}
.legal a:hover {
    color: var(--primary-dark);
}
.legal__table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
}
.legal__table th,
.legal__table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
}
.legal__table th {
    width: 35%;
    color: var(--gray-600);
    font-weight: 500;
    background: var(--gray-50);
}
.legal__table td {
    color: var(--gray-800);
}
.legal__warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 32px;
}
.legal__warning strong {
    display: block;
    color: #92400e;
    margin-bottom: 4px;
}
.legal__warning p {
    color: #a16207;
    margin: 0;
    font-size: 0.9rem;
}
.legal__pending {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}
.legal__date {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-400);
    font-size: 0.85rem;
}

@media (max-width: 767px) {
    .legal h1 { font-size: 1.5rem; }
    .legal h2 { font-size: 1rem; }
    .legal__table th,
    .legal__table td {
        display: block;
        width: 100%;
    }
    .legal__table th {
        border-bottom: none;
        padding-bottom: 4px;
    }
    .legal__table td {
        padding-top: 4px;
    }
}
