
/* ─── LOCAL FONTS ─── */

@font-face {
    font-family: 'Inter';
    src: url('fonts/inter/Inter-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/inter/Inter-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/inter/Inter-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/inter/Inter-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Rambla';
    src: url('fonts/rambla/Rambla-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Rambla';
    src: url('fonts/rambla/Rambla-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ─── CSS VARIABLES ─── */
:root {
    /* Corporativos oficiales */
    --cieb-blue: #5C88DA;
    --cieb-dark: #101820;
    --cieb-slate: #869CAE;
    --cieb-light: #B1C9E8;
    --cieb-deep: #254A5D;
    --cieb-white: #F5F7F6;

    /* Derivados UI */
    --cieb-blue-hover: #4A75C7;
    --cieb-blue-active: #3D65B0;
    --cieb-blue-ghost: rgba(92, 136, 218, 0.1);

    /* Estados */
    --success: #2E7D5A;
    --warning: #C78A2E;
    --error: #B54242;

    /* Modo claro (default) */
    --bg-page: var(--cieb-white);
    --bg-card: #FFFFFF;
    --text-primary: var(--cieb-dark);
    --text-secondary: var(--cieb-slate);
    --border: var(--cieb-light);
    --link: var(--cieb-blue);

    /* Fonts */
    --font-display: 'Rambla', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* =========================
    LAYOUT SCALE
    ========================= */

    --container-width: 1200px;
    --container-wide: 1400px;

    /* spacing scale */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.5rem;   /* 24px */
    --space-6: 2rem;     /* 32px */
    --space-8: 3rem;     /* 48px */
    --space-10: 4rem;    /* 64px */

    /* =========================
       TYPOGRAPHY SCALE
    ========================= */

    --text-xs: 0.75rem;   /* 12px */
    --text-sm: 0.875rem;  /* 14px */
    --text-md: 1rem;      /* 16px */
    --text-lg: 1.25rem;   /* 20px */
    --text-xl: 1.5rem;    /* 24px */
    --text-2xl: 2rem;     /* 32px */
    --text-3xl: 2.75rem;  /* 44px */
    --text-4xl: 3.5rem;   /* 56px */

    /* line heights */
    --lh-tight: 1.2;
    --lh-normal: 1.5;
    --lh-relaxed: 1.8;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

/* Header section */

.services-controls,
.news-controls {
    display: none !important;
}

.header {
    background: var(--bg-page);
    padding: 40px 0; /* replaces margin */
}

.header-container {
    width: min(var(--container-width), 92%);
    margin: 0 auto;

    padding: 10px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 40px;
}

.header-toggle {
    display: none;
}

.header-menu {
    display: contents; /* KEY FIX for desktop */
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    flex-wrap: nowrap;
    overflow: hidden;
}

.header-nav {
    flex: 1;
    justify-content: center;
}

.header-nav-btn {
    font-family: var(--font-body), serif;
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--text-primary);
    
    text-decoration: none;
    
    position: relative;
    padding: 10px 16px;
    display: inline-block;
}

.header-nav-btn::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 4px;
    height: 2px;
    background: var(--cieb-blue);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.header-nav-btn:hover::after {
    transform: scaleX(1);
}

.header-nav-2 {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-account-nav-btn {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-sm);
    font-weight: 400;

    padding: 0.75rem 1.5rem;
    border-radius: 80px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    text-decoration: none;

    transition: all 0.2s ease;
}

.header-account-nav-btn.primary {
    background: var(--cieb-blue);
    color: var(--cieb-white);
    border: none;
}

.header-account-nav-btn.primary:hover {
    background: var(--cieb-blue-hover);
}

.header-account-nav-btn.secondary {
    background: var(--cieb-dark);
    color: var(--cieb-white);
    border: 1px solid var(--cieb-light);
}

.header-account-nav-btn.secondary:hover {
    background: var(--cieb-deep);
}

.header-logo-img {
    width: 120px;
    height: auto;
}

/* end of Header section */

/* Main section */

.hero {
    background: var(--bg-page);
    padding: 2rem 0;
}

.hero-container {
    width: min(var(--container-width), 92%);
    margin: 0 auto;

    display: flex;
    align-items: stretch;
    justify-content: space-between;

    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 40px;

    padding: 3rem;
    box-sizing: border-box;
    gap: var(--space-6);
}

.hero-content {
    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-tag {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;

    color: var(--cieb-blue);
}

.hero-title {
    font-family: var(--font-display), sans-serif;
    font-size: var(--text-4xl);
    line-height: var(--lh-tight);
    font-weight: 700;

    color: var(--text-primary);
}

.hero-highlight {
    color: var(--cieb-blue);
}

.hero-description {
    font-family: var(--font-body), sans-serif;
    font-size: 1.25rem;
    line-height: 1.8;

    color: var(--text-secondary);
}

.hero-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: fit-content;

    padding: 0.9rem 1.8rem;
    border-radius: 80px;

    background: var(--cieb-slate);
    color: var(--cieb-white);

    font-family: var(--font-body), sans-serif;
    font-weight: 600;
    font-size: var(--text-sm);

    text-decoration: none;
    transition: 0.2s ease;
}

.hero-button:hover {
    background: var(--cieb-deep);
}

.hero-image {
    flex: 1;

    border-radius: 40px;

    background-image: url('../images/constelation.jpg');
    background-size: cover;
    background-position: center;
}

/* end of Main section */

/* Servicios section */

.services {
    background: var(--bg-page);
    padding: 4rem 0;
}

.services-container {
    width: min(var(--container-width), 92%);

    margin: 0 auto;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 4rem;

    box-sizing: border-box;
}

.services-header {
    width: 800px;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
    gap: 1.5rem;
}

.services-tag {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;

    color: var(--cieb-blue);
}

.services-title {
    font-family: var(--font-display), sans-serif;
    font-size: var(--text-3xl);
    font-weight: 700;

    color: var(--text-primary);
}

.services-description {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-md);
    line-height: 1.8;

    color: var(--text-secondary);
}

.services-grid {
    display: flex;
    justify-content: space-between;
    gap: var(--space-6);
    width: 100%;
    flex-wrap: wrap;
}

.service-card {
    width: 300px;
    min-height: 260px;

    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 40px;

    padding: 2rem;

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    gap: 1rem;
    box-sizing: border-box;
}

.service-card h3 {
    font-family: var(--font-display), sans-serif;
    font-size: 1.5rem;
    font-weight: 700;

    color: var(--cieb-deep);
}

.service-card p {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-sm);
    line-height: 1.6;

    color: var(--text-secondary);
}

.service-btn {
    margin-top: auto;

    padding: 0.75rem 1.5rem;
    border-radius: 80px;

    background: var(--cieb-blue);
    color: var(--cieb-white);

    text-decoration: none;
    font-weight: 600;
    font-size: var(--text-sm);
    font-family: var(--font-body), sans-serif;

    transition: 0.2s ease;
}

.service-btn:hover {
    background: var(--cieb-blue-hover);
}

.service-btn.disabled {
    background: var(--cieb-slate);
    cursor: not-allowed;
}
/* end servicios section */

/* Sobre nosotros section */
.about {
    background: var(--bg-page);
    padding: 4rem 0;
}

.about-container {
    width: min(var(--container-width), 92%);

    margin: 0 auto;

    display: flex;
    align-items: stretch;
    justify-content: space-between;

    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 40px;

    padding: 3rem;
    box-sizing: border-box;

    gap: 3rem;
}

.about-image {
    flex: 1;
    height: 540px;
    border-radius: 40px;

    background-image: url('../images/constelation.jpg');
    background-size: cover;
    background-position: center;
}

.about-content {
    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-tag {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;

    color: var(--cieb-blue);
}

.about-title {
    font-family: var(--font-display), sans-serif;
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.2;

    color: var(--text-primary);
}

.about-text {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-md);
    line-height: 1.8;

    color: var(--text-secondary);
}

/* end of sobre nosotros section */

/* Novedades section */

.news {
    background: var(--bg-page);
    padding: 4rem 0;
}

.news-container {
    width: min(1200px, 92%);
    margin: 0 auto;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 3rem;
}

.news-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-tag {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;

    color: var(--cieb-blue);
}

.news-title {
    font-family: var(--font-display), sans-serif;
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    width: 100%;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 40px;

    overflow: hidden;

    display: flex;
    flex-direction: column;

    min-height: 380px;
}

.news-image {
    height: 140px;
    background-size: cover;
    background-position: center;
}

.news-content {
    padding: 1.5rem;

    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-content h3 {
    font-family: var(--font-display), sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cieb-deep);
}

.news-content p {
    font-family: var(--font-body), sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* end Novedades section */

/* Contacto section */
.contact {
    background: var(--bg-page);
    padding: 4rem 0;
}

.contact-container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;

    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 3rem;

    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 40px;

    padding: 3rem;
    box-sizing: border-box;
}

/* LEFT SIDE */
.contact-content {
    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.contact-tag {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;

    color: var(--cieb-blue);
}

.contact-title {
    font-family: var(--font-display), sans-serif;
    font-size: 2.75rem;
    color: var(--text-primary);
}

.contact-text {
    font-size: var(--text-md);
    font-family: var(--font-body), sans-serif;
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* FORM */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.7rem;
}

.contact-row {
    display: flex;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;

    border-radius: 20px;
    border: 1px solid var(--cieb-dark);

    font-family: var(--font-body), sans-serif;
    font-size: 14px;
}

.contact-form textarea {
    min-height: 140px;
    resize: none;
}

.contact-form button {
    padding: 1rem;
    border-radius: 80px;
    border: none;

    background: var(--cieb-blue);
    color: var(--cieb-white);

    font-weight: 600;
    cursor: pointer;
}

/* RIGHT SIDE IMAGE */
.contact-image {
    flex: 1;

    border-radius: 40px;

    background-image: url('../images/constelation.jpg');
    background-size: cover;
    background-position: center;
}

/* end contacto section */

/* footer section */

.footer {
    background: var(--bg-page);
    padding: 4rem 0;
}

/* DARK CARD */

.footer-container {
    width: 92%;
    margin: 0 auto;

    background: var(--cieb-dark);
    color: var(--cieb-white);

    border-radius: 40px;

    padding: 4rem;
    box-sizing: border-box;
}

/* CONTENT LIMITER */

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* TOP SECTION */

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    font-family: var(--font-body), sans-serif;
}

/* LEFT SECTION */

.footer-left {
    flex: 2;

    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-logo {
    width: 240px;
    height: auto;
}

.footer-description {
    max-width: 320px;

    font-size: 14px;
    line-height: 1.6;

    color: var(--cieb-white);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 1rem;

    font-family: var(--font-body), sans-serif;
    color: var(--cieb-white);
}

.social {
    display: flex;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.social li {
    --size: 42px;
}

.social-btn {
    width: var(--size);
    height: var(--size);

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);

    color: var(--cieb-white);
    position: relative;

    overflow: hidden;
    transition: all 0.3s ease;
}

/* THIS is what makes icons visible */
.social-btn svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
    position: relative;
    z-index: 2;
}

/* hover background fill */
.social-btn::after {
    content: "";
    position: absolute;
    inset: 100% 0 0 0;
    background: var(--bg);
    transition: inset 0.3s ease;
    z-index: 1;
}

.social-btn:hover::after {
    inset: 0;
}

.social-btn:hover {
    color: white;
    border-color: var(--bg);
}

/* MENU + SERVICES */

.footer-menu,
.footer-services {
    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-menu h4,
.footer-services h4 {
    font-family: var(--font-display), sans-serif;
    font-size: 18px;
    font-weight: 400;

    color: var(--cieb-slate);

    margin-bottom: 0.5rem;
}

.footer-menu a,
.footer-services a {
    font-family: var(--font-body), sans-serif;
    font-size: 18px;

    color: var(--cieb-white);
    text-decoration: none;

    transition: color 0.2s ease;
}

.footer-menu a:hover,
.footer-services a:hover {
    color: var(--cieb-blue);
}

/* BOTTOM BAR */

.footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;

    border-top: 1px solid rgba(255,255,255,0.15);

    display: flex;
    justify-content: space-between;
    align-items: center;

    flex-wrap: wrap;
    font-family: var(--font-body), sans-serif;
    font-size: 18px;
    font-weight: 400;
}

.footer-bottom a {
    color: var(--cieb-white);
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--cieb-blue);
}

/* end footer section */

@media (max-width: 1200px) {

    .services-controls,
    .news-controls {
        display: none !important;
    }

    /* header section */
    .header-nav {
        gap: 0.75rem;
        min-width: 0;
    }

    .header-nav-btn {
        font-size: 12px;
        padding: 6px;
        white-space: nowrap;
    }

    .header-account-nav-btn {
        padding: 0.65rem 0.85rem;
        font-size: 12px;
    }

    .header-logo-img {
        width: 70px;
        height: auto;
    }
    /* end header section */
    
    /* main section */
    .hero-container {
        padding: 2.5rem;
        gap: 1.5rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1rem;
        line-height: 1.8;
    }

    .hero-image {
        min-height: 400px;
    }

    .hero-button {
        padding: 0.8rem 1.5rem;
    }
    /* end main section */
    
    /* servicios section */
    .services-container {
        gap: 3rem;
    }

    .services-header {
        width: 100%;
        max-width: 700px;
    }

    .services-title {
        font-size: 2.25rem;
    }

    .services-grid {
        justify-content: center;
        gap: 1.5rem;
    }

    .service-card {
        width: 280px;
        min-height: 240px;
        padding: 1.75rem;
    }

    .service-card h3 {
        font-size: 1.35rem;
    }

    .service-card p {
        font-size: 13px;
    }
    /* end servicios section */
    
    /* sobre nosotros section */
    .about-container {
        flex-direction: column;
        padding: 2.5rem;
        gap: 2rem;
    }

    .about-image {
        flex: none;
        width: 100%;
        height: 350px;
        min-height: 350px;
    }
    .about-content {
        text-align: center;
        align-items: center;
    }

    .about-title {
        font-size: 2.25rem;
    }

    .about-text {
        max-width: 700px;
    }
    
    /* end sobre nosotros section */

    /* novedades section */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .news-title {
        font-size: 2.25rem;
    }

    .news-card {
        min-height: 340px;
    }

    .news-image {
        height: 160px;
    }
    
    /* end novedades section */
    
    /* contacto section */
    .contact-container {
        flex-direction: column;
        align-items: stretch; /* IMPORTANT */
        padding: 2.5rem;
        gap: 2rem;
    }

    /* force full width for both blocks */
    .contact-content,
    .contact-image {
        width: 100%;
        flex: none;
    }

    /* image behaves like a proper block */
    .contact-image {
        height: 380px;
        order: 0; /* ensures image stays BELOW form */
    }

    .contact-content {
        order: 1;
        text-align: left;
        align-items: stretch; /* IMPORTANT for inputs */
    }

    /* fix form stretching */
    .contact-form input,
    .contact-form textarea {
        width: 100%;
    }

    .contact-row {
        flex-direction: column;
    }

    .contact-title {
        font-size: 2.25rem;
    }
    /* end contacto section */
    
    /* footer section */
    
    .footer-container {
        padding: 3rem;
    }

    .footer-top {
        gap: 2rem;
    }

    .footer-logo {
        width: 180px;
        height: auto;
    }
    
    .footer-description {
        max-width: 260px;
        font-size: 12px;
    }

    .footer-menu a,    
    .footer-services a, 
    .footer-bottom {  
        font-size: 16px;    
    }

    .footer-menu h4, 
    .footer-services h4 {       
        font-size: 16px;  
    }

    .social li {    
        --size: 38px;  
    }     
    
    .social-btn svg {     
        width: 18px;       
        height: 18px;  
    }
    /* end footer section */
}

@media (max-width: 576px) {

    .services-controls,
    .news-controls {
        display: flex !important;
    }
    
    /* header section */
    
    .header-container {
        position: relative;
        padding: 12px 16px;
        border-radius: 40px;
    }

    .header-nav,
    .header-nav-2 {
        display: none;
    }

    .header-toggle {
        display: block;
        font-size: 28px;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text-primary);
    }

    .header-logo-img {
        width: 60px;
        height: 60px;
    }

    /* dropdown menu */
    .header-menu {
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;

        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 30px;

        padding: 1rem;

        display: flex;
        flex-direction: column;
        gap: 1rem;

        transform: scaleY(0);
        transform-origin: top;
        opacity: 0;
        pointer-events: none;

        transition: 0.25s ease;
    }

    .header-menu.active {
        transform: scaleY(1);
        opacity: 1;
        pointer-events: auto;
    }

    .header-menu .header-nav,
    .header-menu .header-nav-2 {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    /* end header section */
    
    /* main section */
    
    .hero-container {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    /* IMAGE FIRST (Figma has image on top) */
    .hero-image {
        order: -1;
        width: 100%;
        min-height: 320px;
        border-radius: 40px;
    }

    /* CONTENT spacing reset */
    .hero-content {
        gap: 1rem;
    }

    /* small tag (top line) */
    .hero-tag {
        font-size: 10px;
        font-weight: 600;
        color: var(--cieb-blue);
    }

    /* TITLE matches Figma hierarchy */
    .hero-title {
        font-size: 2.25rem; /* close to 36px */
        line-height: 1.2;
    }

    /* DESCRIPTION tighter like Figma */
    .hero-description {
        font-size: 14px;
        line-height: 1.6;
    }

    /* BUTTON matches compact Figma style */
    .hero-button {
        width: 120px;
        height: 46px;
        padding: 0;
        font-size: 14px;
    }
    /* end main section */
    
    /* servicios section */
    
    /* header stays centered */
    .services-container {
        gap: 2rem;
    }

    .services-controls {
        display: flex;
        justify-content: center;
        gap: 1rem;
    }

    .services-btn {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: 1px solid var(--border);
        background: var(--bg-card);
        color: var(--cieb-dark);
        font-size: 1.5rem;
        cursor: pointer;
    }

    /* title section full width */
    .services-header {
        width: 100%;
        padding: 0 1rem;
    }

    .services-title {
        font-size: 2rem;
    }

    .services-description {
        font-size: 14px;
        line-height: 1.6;
    }

    /* ===== CAROUSEL MAGIC ===== */
    .services-grid {
        justify-content: flex-start;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
        padding: 0 1rem;
    }

    /* hide scrollbar (optional clean UI) */
    .services-grid::-webkit-scrollbar {
        display: none;
    }

    /* each card becomes full swipe page */
    .service-card {
        flex: 0 0 85%;
        scroll-snap-align: center;

        width: auto;
        min-height: 260px;
    }

    /* make text slightly bigger for readability */
    .service-card h3 {
        font-size: 1.3rem;
    }

    .service-card p {
        font-size: 14px;
    }
    /* end servicios section */
    
    /* sobre nosotros section */
    
    .about-container {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
        text-align: center;
    }

    /* IMAGE — more Figma-like proportion */
    .about-image {
        width: 100%;
        height: 260px;   /* reduce from 350px */
        border-radius: 30px;
    }

    /* CONTENT alignment */
    .about-content {
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .about-tag {
        font-size: 10px;
    }

    .about-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .about-text {
        font-size: 14px;
        line-height: 1.6;
        max-width: 100%;
    }
    
    /* end sobre nosotros section */
    
    /* novedades section */
    
    /* header spacing */
    .news-container {
        gap: 2rem;
    }

    .news-header {
        padding: 0 1rem;
    }

    .news-title {
        font-size: 2rem;
    }

    /* ===== CAROUSEL MODE ===== */
    .news-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;

        gap: 1rem;
        padding: 0 1rem;
    }

    /* hide scrollbar */
    .news-grid::-webkit-scrollbar {
        display: none;
    }

    /* cards become slides */
    .news-card {
        flex: 0 0 85%;
        scroll-snap-align: center;

        min-height: 340px;
    }

    /* image slightly taller for better preview */
    .news-image {
        height: 160px;
    }

    /* text readability */
    .news-content h3 {
        font-size: 1.2rem;
    }

    .news-content p {
        font-size: 14px;
    }

    .news-controls {
        display: flex;
        justify-content: center;
        gap: 1rem;
    }

    .news-btn {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: 1px solid var(--border);
        background: var(--bg-card);
        font-size: 1.5rem;
        cursor: pointer;
    }
    
    /* end novedades section */
    
    /* contacto section */
    /* container breathing room */
    .contact-container {
        padding: 2rem;
        gap: 1.5rem;
        border-radius: 30px;
    }

    /* title */
    .contact-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    /* text readability */
    .contact-text {
        font-size: 14px;
        line-height: 1.6;
    }

    /* form spacing tighter */
    .contact-form {
        gap: 1rem;
    }

    /* inputs slightly smaller and cleaner */
    .contact-form input,
    .contact-form textarea {
        padding: 0.85rem;
        font-size: 14px;
        border-radius: 16px;
    }

    /* button more compact */
    .contact-form button {
        padding: 0.85rem;
        font-size: 14px;
        border-radius: 60px;
    }

    /* image height tuned for mobile */
    .contact-image {
        height: 260px;
        border-radius: 30px;
    }

    /* tag spacing */
    .contact-tag {
        font-size: 11px;
    }
    
    /* end cotnacto section */

    /* footer section */

    /* container padding */
    .footer-container {
        padding: 2rem;
    }

    /* stack everything vertically */
    .footer-top {
        flex-direction: column;
        gap: 2rem;
    }

    /* logo + text */
    .footer-left {
        gap: 1rem;
    }

    .footer-logo {
        width: 140px;
    }

    /* IMPORTANT: allow full width text */
    .footer-description {
        max-width: 100%;
        font-size: 14px;
        line-height: 1.5;
    }

    /* social row fix */
    .footer-social {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 1rem;
    }

    /* MENU + SERVICES SIDE BY SIDE (KEY FIX) */
    .footer-menu,
    .footer-services {
        flex: 1;
    }

    .footer-top {
        flex-wrap: wrap;
    }

    /* force menu layout row-like structure */
    .footer-menu,
    .footer-services {
        min-width: 45%;
    }

    /* headings smaller */
    .footer-menu h4,
    .footer-services h4 {
        font-size: 14px;
    }

    .footer-menu a,
    .footer-services a {
        font-size: 14px;
    }

    /* bottom links row */
    .footer-bottom {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.75rem;
        font-size: 12px;
        text-align: center;
    }
    
    /* end footer section */
}

/* ========== EDITORIAL ========== */
.catalog-toolbar {
    background: var(--bg-page);
    padding: 0 0 4rem 0;
}
.catalog-container {
    width: min(var(--container-width), 92%);
    margin: 0 auto;
}
.search-box {
    position: relative;
    max-width: 100%;
    margin: 0 auto 2rem;
}
.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    fill: var(--cieb-slate);
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.25rem;
    border: 1px solid var(--cieb-dark);
    border-radius: 20px;
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input:focus {
    outline: none;
    border-color: var(--cieb-blue);
    box-shadow: 0 0 0 3px var(--cieb-blue-ghost);
}
.search-input::placeholder {
    color: var(--cieb-slate);
}
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.filter-label {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}
.filter-select {
    padding: 0.6rem 2.25rem 0.6rem 1rem;
    border: 1px solid var(--cieb-dark);
    border-radius: 20px;
    background: var(--bg-card);
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-sm);
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23869CAE' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: border-color 0.2s ease;
}
.filter-select:focus {
    outline: none;
    border-color: var(--cieb-blue);
}
.results-count {
    margin-left: auto;
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-sm);
    color: var(--cieb-slate);
}
.catalog {
    background: var(--bg-page);
    padding: 0 0 4rem 0;
}
.books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    margin-bottom: 3rem;
}
.book-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 40px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(16, 24, 32, 0.08);
    border-color: var(--cieb-blue);
}
.book-cover {
    position: relative;
    width: 100%;
    height: 260px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--cieb-light) 0%, var(--border) 100%);
}
.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.book-card:hover .book-cover img {
    transform: scale(1.05);
}
.book-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--cieb-blue);
    color: var(--cieb-white);
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.35rem 0.85rem;
    border-radius: 80px;
}
.book-badge--soon {
    background: var(--cieb-slate);
}
.book-info {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.book-title {
    font-family: var(--font-display), sans-serif;
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: var(--lh-tight);
    color: var(--cieb-deep);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-authors {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-sm);
    font-style: italic;
    color: var(--text-secondary);
    line-height: var(--lh-normal);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.book-pill {
    display: inline-block;
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 80px;
}
.book-pill--year {
    background: var(--bg-page);
    color: var(--cieb-deep);
}
.book-pill--type {
    background: var(--cieb-blue-ghost);
    color: var(--cieb-blue);
}
.book-identifiers {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.identifier {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: var(--text-xs);
}
.identifier-label {
    font-family: var(--font-body), sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 36px;
}
.identifier-value {
    font-family: 'Courier New', monospace;
    color: var(--cieb-slate);
    font-size: var(--text-xs);
}
.identifier-link {
    font-family: 'Courier New', monospace;
    color: var(--cieb-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--text-xs);
    transition: color 0.2s ease;
}
.identifier-link:hover {
    color: var(--cieb-blue-hover);
    text-decoration: underline;
}
.book-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.book-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 1rem;
    border-radius: 80px;
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}
.book-btn svg {
    fill: currentColor;
    flex-shrink: 0;
}
.book-btn--primary {
    background: var(--cieb-blue);
    color: var(--cieb-white);
}
.book-btn--primary:hover {
    background: var(--cieb-blue-hover);
}
.book-btn--secondary {
    background: transparent;
    color: var(--cieb-blue);
    border: 1.5px solid var(--border);
}
.book-btn--secondary:hover {
    border-color: var(--cieb-blue);
    background: var(--cieb-blue-ghost);
}
.book-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 2rem 0;
}
.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.pagination-btn svg {
    fill: currentColor;
}
.pagination-btn:hover {
    border-color: var(--cieb-blue);
    color: var(--cieb-blue);
}
.pagination-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
}
.pagination-pages {
    display: flex;
    gap: 0.3rem;
}
.pagination-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 0.6rem;
    border-radius: 50%;
    text-decoration: none;
    font-family: var(--font-body), sans-serif;
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.pagination-page:hover {
    background: var(--bg-page);
    color: var(--cieb-blue);
    border-color: var(--border);
}
.pagination-page.is-active {
    background: var(--cieb-blue);
    color: var(--cieb-white);
    border-color: var(--cieb-blue);
}
@media (max-width: 1200px) {
    .books-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-group { width: 100%; }
    .filter-select { flex: 1; }
    .results-count { margin-left: 0; text-align: center; }
}
@media (max-width: 576px) {
    .books-grid { grid-template-columns: 1fr; }
    .book-cover { height: 300px; }
    .book-actions { flex-direction: column; }
    .pagination-page, .pagination-btn { min-width: 38px; width: 38px; height: 38px; font-size: var(--text-xs); }
}


/* ========== Admin ========== */

.admin-btn--toggle-pub {
    background: rgba(46, 125, 90, 0.1);
    color: var(--success);
}
.admin-btn--toggle-draft {
    background: rgba(199, 138, 46, 0.1);
    color: var(--warning);
}


/* ===== Formulario de contacto: honeypot, estados y modal ===== */

/* Honeypot anti-spam: oculto visualmente, los bots lo rellenan */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Estado de envío del formulario */
.form-status {
    min-height: 1.2em;
    font-family: var(--font-body), sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin: -0.5rem 0 0;
    display: none;
}
.form-status.ok {
    display: block;
    color: var(--success);
}
.form-status.err {
    display: block;
    color: var(--error);
}

/* Botón en estado "Enviando…" */
.contact-form button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Modal de contacto (botón "Contactar al equipo editorial") */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(16, 24, 32, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.open {
    display: flex;
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    box-sizing: border-box;
    box-shadow: 0 20px 50px rgba(16, 24, 32, 0.3);
}

.modal-box .contact-title {
    font-size: 1.6rem;
    line-height: 1.2;
}

.modal-box .contact-text {
    font-size: var(--text-sm);
}

.modal-close {
    position: absolute;
    top: 0.4rem;
    right: 0.8rem;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
}
.modal-close:hover {
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .modal-box {
        padding: 1.5rem;
    }
    .contact-row {
        flex-direction: column;
    }
}

/* ═══════════════ Novedades (listado y detalle) ═══════════════ */
.news-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.news-cats a {
    padding: 0.45rem 1rem;
    border-radius: 80px;
    border: 1px solid var(--border);
    text-decoration: none;
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-sm);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.news-cats a.active {
    background: var(--cieb-blue);
    border-color: var(--cieb-blue);
    color: var(--cieb-white);
}

.news-cats a:hover:not(.active) {
    border-color: var(--cieb-blue);
    color: var(--cieb-blue);
}

a.news-card--link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

a.news-card--link:hover {
    transform: translateY(-3px);
    border-color: var(--cieb-blue);
    box-shadow: 0 12px 32px rgba(16, 24, 32, 0.08);
}

.news-card-meta {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-xs);
    color: var(--cieb-slate);
}

.noticia-article {
    background: var(--bg-page);
    padding: 2.5rem 0 4rem;
}

.noticia-container {
    width: min(760px, 92%);
    margin: 0 auto;
}

.noticia-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.news-cat {
    color: var(--cieb-blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: var(--text-xs);
}

.noticia-hero {
    border-radius: 32px;
    overflow: hidden;
    margin-bottom: 2rem;
    background: var(--border);
}

.noticia-hero img {
    width: 100%;
    display: block;
    max-height: 420px;
    object-fit: cover;
}

.noticia-cuerpo {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    font-family: var(--font-body), sans-serif;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.noticia-cuerpo h2,
.noticia-cuerpo h3,
.noticia-cuerpo h4 {
    font-family: var(--font-display), sans-serif;
    color: var(--cieb-deep);
    margin-top: 0.5rem;
}

.noticia-cuerpo ul,
.noticia-cuerpo ol {
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.noticia-cuerpo blockquote {
    border-left: 4px solid var(--cieb-blue);
    padding: 0.25rem 1.25rem;
    margin: 0;
    font-style: italic;
    color: var(--text-secondary);
}

.noticia-cuerpo blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-style: normal;
    font-size: var(--text-sm);
    color: var(--cieb-slate);
}

.noticia-cuerpo figure {
    margin: 0;
}

.noticia-cuerpo figure img {
    width: 100%;
    border-radius: 24px;
}

.noticia-cuerpo figcaption {
    margin-top: 0.5rem;
    font-size: var(--text-sm);
    color: var(--cieb-slate);
    text-align: center;
}

.noticia-cuerpo hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

/* ═══════════════ Editor de bloques (admin Noticias) ═══════════════ */
.noticia-editor {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.blk {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.85rem;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.blk-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blk-tipo {
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cieb-slate);
}

.blk-tools {
    display: flex;
    gap: 0.25rem;
}

.blk-btn {
    border: 1px solid var(--border);
    background: var(--bg-page);
    border-radius: 8px;
    cursor: pointer;
    padding: 0.15rem 0.5rem;
    font-family: var(--font-body), sans-serif;
    color: var(--text-primary);
}

.blk-btn:hover {
    border-color: var(--cieb-blue);
    color: var(--cieb-blue);
}

.blk input[type="text"],
.blk textarea,
.blk select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: var(--font-body), sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
}

.blk textarea {
    resize: vertical;
}

.blk-preview img {
    max-width: 220px;
    border-radius: 10px;
    display: block;
}

.blk-vacio {
    color: var(--cieb-slate);
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-sm);
    text-align: center;
    padding: 1rem 0;
}

.noticia-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.editor-add {
    border: 1px dashed var(--cieb-blue);
    background: transparent;
    color: var(--cieb-blue);
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    cursor: pointer;
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-sm);
}

.editor-add:hover {
    background: var(--cieb-blue);
    color: var(--cieb-white);
}
