/* ==========================
   PALETA APIASSA (BLANCO)
   ========================== */

:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f7f9fb;
    --color-primary: #00a500;              /* Verde APIASSA */
    --color-primary-soft: rgba(0,165,0,0.12);
    --color-text: #1d1f24;
    --color-text-soft: #4b4f5a;
    --color-border: #e2e5eb;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-soft: 0 10px 30px rgba(15,23,42,0.12);
    --container-width: 1120px;
    --transition: all 0.22s ease;
    --spacing-section: 4.2rem;
}

/* Reset básico */

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

/* Layout genérico */

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: var(--spacing-section) 0;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.section:first-of-type {
    border-top: none;
}

.section-alt {
    background: var(--color-bg-alt);
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.section-header p {
    color: var(--color-text-soft);
    max-width: 540px;
    margin: 0 auto;
}

/* ==========================
   HEADER + MENÚ
   ========================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(18px);
    background: rgba(255,255,255,0.9);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 0; /* un poquito más alto, elegante y proporcional */
}

/* Logo APIASSA en header (desktop y tablet horizontal) */
.logo {
    margin-left: 1.4rem;   /* lo mete más hacia adentro del header */
}

.logo img {
    height: 70px;          /* más grande, elegante */
    display: block;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

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

.main-nav a {
    color: var(--color-text-soft);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

.main-nav a:hover {
    color: var(--color-text);
}

/* Botones */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.6rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-small {
    padding: 0.55rem 1.3rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, #00a500, #35e95d);
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(0,165,0,0.25);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(0,165,0,0.35);
}

.btn-outline {
    border-color: rgba(0,0,0,0.08);
    color: var(--color-text);
    background: transparent;
}

.btn-outline:hover {
    background: rgba(0,0,0,0.02);
}

/* Botón especial WhatsApp: negro -> verde APIASSA */
.btn-whatsapp {
    background: linear-gradient(135deg, #000000, #00a500);
    color: #ffffff !important;          /* fuerza el blanco */
    border: none;
    box-shadow: 0 8px 22px rgba(0,0,0,0.35);
    text-decoration: none;
}
.btn-whatsapp:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}

/* Texto del botón por dispositivo */
.btn-text-desktop {
    display: inline;
}

.btn-text-mobile {
    display: none;
}

@media (max-width: 767px) {
    .btn-text-desktop {
        display: none;
    }

    .btn-text-mobile {
        display: inline;
    }
}


/* Menú móvil (burger) */

.nav-toggle {
    width: 38px;
    height: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: #1f2937;
    transition: var(--transition);
}

/* Estado abierto */

.main-nav.nav-open ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 52px;
    right: 0;
    background: #ffffff;
    padding: 1rem 1.2rem;
    border-radius: 18px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    gap: 0.75rem;
    min-width: 210px;
}

/* ==========================
   HERO
   ========================== */

.hero {
    padding: 4.4rem 0 3.6rem;
}

.hero-grid {
    display: grid;
    gap: 2.5rem;
}

.hero-text h1 {
    font-size: 2.4rem;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-text p {
    color: var(--color-text-soft);
    max-width: 520px;
    margin-bottom: 1.8rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.hero-side {
    display: grid;
    gap: 1rem;
}

.hero-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 1.5rem 1.4rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-border);
}

.hero-card h2 {
    font-size: 1.2rem;
    margin-bottom: 0.7rem;
}

.hero-card p {
    color: var(--color-text-soft);
}

.hero-tag {
    border-radius: 999px;
    border: 1px dashed rgba(0,0,0,0.15);
    padding: 0.75rem 1.3rem;
    font-size: 0.9rem;
    color: var(--color-text-soft);
    max-width: 260px;
}

/* ==========================
   DOS COLUMNAS (QUIÉNES SOMOS / TECH)
   ========================== */

.two-column {
    display: grid;
    gap: 2rem;
}

.about-highlight {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.4rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.check-list li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.4rem;
    color: var(--color-text-soft);
    font-size: 0.95rem;
}

.check-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-primary);
}

/* ==========================
   STATS
   ========================== */

.stats {
    background: var(--color-bg-alt);
}

/* Base: móvil y tablet vertical = 2 columnas */
.stats-grid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Desktop / laptop / tablet horizontal (>=1024px) = 4 columnas */
@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}


.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.3rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 600;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-text-soft);
}

/* ==========================
   SERVICIOS – TARJETAS
   ========================== */

.services-grid-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Tarjeta base */

.service-card-modern {
    position: relative;
    border-radius: 24px;
    padding: 1.6rem;
    overflow: hidden;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 220px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.18);
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

/* Imagen de fondo de la tarjeta */
.service-card-modern__image {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    border-radius: inherit;
}

.service-card-modern__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.55); /* oscurece la imagen para que el texto se lea */
}

/* Overlay de color usando el gradiente de cada tipo */
.service-card-modern::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    background: inherit; /* toma el background de las clases --fianzas/--seguros/--avaluos */
    opacity: 0.75;
}

/* Gradientes por tipo */

.service-card-modern--fianzas {
    background: linear-gradient(135deg, #0047b3, #00a2ff);
}

.service-card-modern--seguros {
    background: linear-gradient(135deg, #6f2bff, #c44fff);
}

.service-card-modern--avaluos {
    background: linear-gradient(135deg, #00806b, #00c78a);
}

/* Contenido */

.service-card-modern__content {
    position: relative;
    z-index: 3;
}

.service-card-modern__content h3 {
    font-size: 1.2rem;
    margin: 0 0 0.6rem;
}

.service-card-modern__content p {
    margin: 0;
    font-size: 0.95rem;
    max-width: 90%;
}

/* Botón + (centrado) */

.service-card-modern__more {
    position: absolute;
    right: 1.4rem;
    bottom: 1.4rem;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 4;
    transition: background 0.22s ease, transform 0.22s ease;
}

.service-card-modern__more span {
    display: block;
    transform: none; /* sin desplazamiento, perfectamente centrado */
}

.service-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 50px rgba(0,0,0,0.25);
    filter: brightness(1.03);
}

.service-card-modern:hover .service-card-modern__more {
    background: rgba(255,255,255,0.25);
}

/* ==========================
   MODALES DE SERVICIOS
   ========================== */

.service-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1000;
}

.service-modal-backdrop.is-open {
    display: flex;
}

.service-modal {
    position: relative;
    background: #ffffff;
    border-radius: 26px;
    width: min(780px, 100%);
    max-height: 90vh;                 /* alto dinámico */
    height: auto;                     /* se ajusta al contenido */
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.service-modal__inner {
    flex: 1;
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 1.8rem;
    padding: 2.4rem 2.3rem 2.5rem;
    overflow-y: auto;
}

/* Botón cerrar */

.service-modal__close {
    position: absolute;
    right: 1.3rem;
    top: 1.1rem;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: #e4e6ea;
    color: #1e1e1e;
    font-size: 1.4rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
}

.service-modal__close:hover {
    background: #d1d4da;
}

/* Texto dentro del modal */

.service-modal__categoria {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #0060a8;
    margin: 0 0 0.4rem;
}

.service-modal__
titulo {
    margin: 0 0 0.6rem;
    font-size: 2rem;
    color: #14234b;
}

.service-modal__descripcion {
    margin: 0 0 1rem;
    font-size: 0.98rem;
    line-height: 1.6;
    color: #4b4f5c;
}

/* oferta de valor */

.service-modal__valor {
    margin: 0 0 1.2rem;
    font-size: 0.95rem;
    color: #293046;
}

/* Botones dentro del modal */

.service-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 0.8rem;
}

/* Lista derecha */

.service-modal__col--lista {
    border-left: 1px solid #ebedf1;
    padding-left: 1.6rem;
}

.service-modal__list {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
    font-size: 0.95rem;
    color: #3d4150;
}

.service-modal__list li {
    margin-bottom: 0.4rem;
}

/* ==========================
   CONTACTO
   ========================== */

.contact-section {
    background: var(--color-bg-alt);
}

.contact-grid {
    display: grid;
    gap: 2.5rem;
}

.contact-form {
    display: grid;
    gap: 1rem;
}

.form-group {
    display: grid;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    padding: 0.7rem 0.8rem;
    color: var(--color-text);
    font-size: 0.9rem;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
}

.contact-info {
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 1.7rem 1.6rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
}

.contact-info p {
    color: var(--color-text-soft);
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.contact-list li {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.contact-list a {
    color: var(--color-primary);
    text-decoration: none;
}

.small {
    font-size: 0.85rem;
    color: #7b7f8c;
}

/* ==========================
   FOOTER
   ========================== */

.site-footer {
    background: var(--color-bg);
    padding: 3rem 0 1.8rem;
}

.footer-panel {
    background: linear-gradient(135deg, #003b8e, #006edc);
    border-radius: 32px;
    padding: 2.4rem 2.3rem;
    color: #ffffff;
    box-shadow: 0 20px 55px rgba(15,23,42,0.35);
}

.footer-grid {
    display: grid;
    gap: 2rem;
}

.footer-logo {
    height: 34px;
    margin-bottom: 0.9rem;
}

.footer-col h4 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.footer-col p,
.footer-col li {
    font-size: 0.9rem;
}

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

.footer-col a {
    color: #ffffff;
    text-decoration: none;
}

.footer-col a:hover {
    text-decoration: underline;
}

.footer-bottom {
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom small {
    font-size: 0.8rem;
    color: #6b7280;
}

/* ==========================
   RESPONSIVO
   ========================== */

@media (min-width: 768px) {
    .main-nav ul {
        display: flex;
        gap: 1.2rem;
    }

    .nav-toggle {
        display: none;
    }

    .hero {
        padding: 5.2rem 0 4.5rem;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        align-items: center;
    }

    .hero-text h1 {
        font-size: 2.8rem;
    }

    .two-column {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        align-items: start;
    }

    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .services-grid-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .service-card-modern {
        min-height: 230px;
    }

    .contact-grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        align-items: start;
    }

    .footer-grid {
        grid-template-columns: 2.1fr 1.3fr 1.2fr;
        align-items: flex-start;
    }
}

@media (max-width: 767px) {
    .service-modal {
        width: 100%;
        max-height: 85vh;
        border-radius: 20px;
    }

    .service-modal__inner {
        grid-template-columns: 1fr;
        padding: 1.9rem 1.4rem 2rem;
    }

    .service-modal__col--lista {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #ebedf1;
        padding-top: 1.2rem;
        margin-top: 0.6rem;
    }
}

/* ==========================
   FOOTER APIASSA (BLANCO + VERDE)
   ========================== */

.footer-panel-apiassa {
    background: linear-gradient(
        135deg,
        #000000 0%,
        #020805 35%,
        #006b1f 85%,
        #00a500 100%
    ); /* más negro que verde, con toque institucional */
    border-radius: 32px;
    padding: 2.4rem 2.3rem;
    border: 1px solid rgba(0,165,0,0.35);
    box-shadow: 0 20px 55px rgba(0,0,0,0.45);
}

.footer-logo-apiassa {
    height: 70px;              /* más grande */
    display: block;
    margin: 0 auto 1rem;       /* centrado dentro del panel */
}

/* Textos en blanco dentro del panel */
.footer-panel-apiassa p,
.footer-panel-apiassa li,
.footer-panel-apiassa a {
    color: #ffffff;
    font-size: 0.95rem;
}

/* Links blancos con hover verde APIASSA */
.footer-panel-apiassa a {
    text-decoration: none;
    font-weight: 500;
}

.footer-panel-apiassa a:hover {
    color: #8dff9f;
}

/* Títulos con acento verde */
.footer-panel-apiassa h4 {
    color: #9bffb5;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

/* Línea inferior del footer en oscuro suave */
.footer-bottom-apiassa small {
    color: #e5e7eb;
    font-size: 0.85rem;
}

/* Texto legal del footer en negro */
.footer-bottom-apiassa small {
    color: #000000 !important;
}

/* Desktop */
@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
        align-items: flex-start;
    }
}

/* Ajuste del menú en móvil: que salga debajo del burger */
@media (max-width: 767px) {

    /* Mantiene el botón Cotiza a la derecha */
    .main-nav {
        position: static;
        margin-left: auto;
    }

    .main-nav.nav-open ul {
        top: 56px;        /* altura bajo el header */
        left: 0.75rem;    /* alineado visualmente con el burger */
        right: auto;      /* IMPORTANT: ya no se ancla al botón verde */
    }
}

/* ==========================
   HEADER SOLO EN MÓVIL / TABLET VERTICAL
   ========================== */
@media (max-width: 767px) {

    .header-inner {
        display: flex;
        align-items: center;
        justify-content: center;   /* centro visual del header */
        position: relative;
        gap: 0.4rem;
    }

    /* LOGO centrado */
    .logo {
        order: 2;
        margin: 0 auto;           /* lo centra */
    }

    .logo img {
        height: 56px;             /* un poco más grande en móvil */
    }

    /* BURGER a la izquierda */
    .nav-toggle {
        order: 1;
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }

    /* MENÚ + BOTÓN a la derecha */
    .main-nav {
        order: 3;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        margin-left: 0;
    }

       /* Dropdown EN MÓVIL: debajo del burger */
    .main-nav.nav-open ul {
        display: flex;
        flex-direction: column;
        position: fixed;          /* se ancla a la ventana, no al botón verde */
        top: 64px;                /* justo debajo del header */
        left: 1rem;               /* alineado con el burger */
        right: auto;
        background: #ffffff;
        padding: 1rem 1.2rem;
        border-radius: 18px;
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-soft);
        gap: 0.75rem;
        min-width: 230px;
        z-index: 9999;
    }
}

/* Apple iOS: cambiar ícono automáticamente según modo claro/oscuro */
@media (prefers-color-scheme: light) {
    link[rel="apple-touch-icon"] {
        content: url("../img/apiassa-icon-light.png");
    }
}

@media (prefers-color-scheme: dark) {
    link[rel="apple-touch-icon"] {
        content: url("../img/apiassa-icon-dark.png");
    }
}

