/* ================================================================
   TuHiper — styleinicio.css  v4
   Dirección estética: editorial premium / grocery 2026
   Paleta: blanco #FFFFFF · gris base #FAFAFA · gris superficie #F0F0F0
           texto principal #1A1A1A · texto secundario #666
           acento verde #1a7a24
   Tipografía: Plus Jakarta Sans (display bold) + DM Sans (cuerpo)
   ================================================================ */

/* Fonts cargadas via <link> en HTML para paralelizar la descarga (antes @import bloqueaba) */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --bg:             #FFFFFF;
    --bg-soft:        #FAFAFA;
    --bg-muted:       #F0F0F0;
    --bg-subtle:      #F7F7F7;
    --text-primary:   #1A1A1A;
    --text-secondary: #666666;
    --text-muted:     #999999;
    --text-inverse:   #FFFFFF;
    --accent:         #1a7a24;
    --accent-light:   #E8F5E9;
    --accent-mid:     rgba(26,122,36,.12);
    --border:         #E8E8E8;
    --border-strong:  #D0D0D0;
    --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
    --shadow-md: 0 8px 32px rgba(0,0,0,.08);
    --shadow-lg: 0 20px 60px rgba(0,0,0,.10);
    --r-sm:  6px;
    --r:     10px;
    --r-lg:  16px;
    --r-pill:999px;
    --nav-h: 64px;
    --font:      'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'DM Sans',           -apple-system, BlinkMacSystemFont, sans-serif;
    --ease: cubic-bezier(.4,0,.2,1);
    --t:    0.18s;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img  { max-width: 100%; height: auto; display: block; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--t) var(--ease);
}
a:hover { color: #0f5218; }

p { line-height: 1.7; margin-bottom: 0; }

/* ================================================================
   LAYOUT DESKTOP — todo encaja en 100 vh (sin scroll)
   SOLO se activa en pantallas ≥ 992 px
   ================================================================ */
@media (min-width: 992px) {
    html {
        height: 100%;
        overflow: hidden;
    }
    body {
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    form#form1 {
        flex: 1;
        display: flex;
        flex-direction: column;
        height: calc(100vh - var(--nav-h));
        margin-top: var(--nav-h);
        overflow: hidden;
    }
    /* Hero ocupa ~62 % del espacio disponible bajo la navbar */
    form#form1 > header.masthead   { flex: 0 0 62%; }
    /* Servicios ocupa el resto entre hero y footer */
    form#form1 > section.page-section { flex: 1; min-height: 0; }
    form#form1 > footer.footer        { flex-shrink: 0; }
}

/* ================================================================
   LAYOUT TABLET / MÓVIL — scroll normal
   ================================================================ */
@media (max-width: 991px) {
    html { height: auto; overflow: auto; }
    body { height: auto; overflow: auto; overflow-x: hidden; }

    form#form1 {
        height: auto;
        overflow: visible;
        margin-top: var(--nav-h);
        display: block;
    }
    form#form1 > header.masthead {
        min-height: 56vh;
        flex: none;
        padding: 2.5rem 1.25rem;
    }
    form#form1 > section.page-section {
        flex: none;
        min-height: auto;
        padding: 2rem 0;
        align-items: flex-start;
    }
    form#form1 > footer.footer { flex-shrink: unset; }
}

/* ── Loading overlay ── */
#divprogress {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
}
#divprogress[hidden] { display: none !important; }

.loader-ring { position: relative; width: 56px; height: 56px; }
.loader-ring div {
    box-sizing: border-box; display: block; position: absolute;
    width: 56px; height: 56px;
    border: 5px solid transparent;
    border-radius: 50%;
    animation: loader-spin 1.1s cubic-bezier(.5,0,.5,1) infinite;
}
.loader-ring div:nth-child(1) { animation-delay:-.45s; border-top-color: #1a7a24; }
.loader-ring div:nth-child(2) { animation-delay:-.3s;  border-top-color: rgba(26,122,36,.55); }
.loader-ring div:nth-child(3) { animation-delay:-.15s; border-top-color: rgba(26,122,36,.25); }
.loader-ring div:nth-child(4) { animation-delay:  0s;  border-top-color: rgba(26,122,36,.10); }
@keyframes loader-spin { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }

/* ================================================================
   NAVBAR
   ================================================================ */
#mainNav {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 1030;
    height: var(--nav-h);
    background: rgba(255,255,255,.97) !important;
    border-bottom: 1px solid var(--border);
    padding: 0;
    display: flex;
    align-items: stretch;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
#mainNav.navbar-shrink {
    box-shadow: var(--shadow-sm);
    border-bottom-color: transparent;
}

#mainNav > .container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    position: relative;
}

/* Brand / logo */
#mainNav .navbar-brand {
    display: flex; align-items: center;
    padding: 0; margin-right: 2rem; flex-shrink: 0;
}
#mainNav .navbar-brand img {
    height: 28px; width: auto; max-width: none;
    object-fit: contain;
    transition: opacity var(--t);
}
#mainNav .navbar-brand:hover img { opacity: .75; }

/* Toggler (mobile) */
#mainNav .navbar-toggler {
    display: flex; align-items: center; gap: .35rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: .4rem .7rem;
    font-family: var(--font);
    font-size: .7rem; font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase; letter-spacing: .07em;
    cursor: pointer;
    transition: border-color var(--t), background var(--t);
    margin-left: auto;
}
#mainNav .navbar-toggler:hover,
#mainNav .navbar-toggler:focus {
    border-color: var(--text-primary);
    background: var(--bg-soft);
    outline: none;
}

/* Collapse — menú desplegable en móvil */
#mainNav .navbar-collapse {
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: .75rem 1.5rem 1.25rem;
    z-index: 1020;
    animation: navSlideDown .2s var(--ease) both;
}
#mainNav .navbar-collapse:not(.show) { display: none; }

@keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Nav list */
#mainNav .navbar-nav {
    display: flex; flex-direction: column;
    list-style: none; padding: 0; margin: 0;
    position: relative;
}
#mainNav .navbar-nav .nav-item { position: relative; }

#mainNav .navbar-nav .nav-item .nav-link,
#mainNav .navbar-nav .nav-item > a.nav-link,
#mainNav .navbar-nav .nav-item > a {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .48rem .75rem;
    font-family: var(--font);
    font-size: .72rem; font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: .07em; text-transform: uppercase;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: color var(--t), background var(--t);
    text-decoration: none; background: none; border: none;
    white-space: nowrap; line-height: 1.4;
}
#mainNav .navbar-nav .nav-item .nav-link:hover,
#mainNav .navbar-nav .nav-item > a.nav-link:hover,
#mainNav .navbar-nav .nav-item > a:hover {
    color: var(--text-primary);
    background: var(--bg-soft);
}

/* Dropdown caret */
#mainNav .dropdown-toggle::after {
    display: inline-block; content: "";
    width: 0; height: 0; margin-left: .25em;
    border-top: .28em solid currentColor;
    border-right: .28em solid transparent;
    border-left: .28em solid transparent;
    border-bottom: 0; opacity: .5;
    transition: transform var(--t);
}

/* Dropdown menu */
#mainNav .dropdown-menu {
    position: absolute;
    top: calc(100% + 6px); right: 0; left: auto;
    min-width: 170px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    padding: .5rem; z-index: 2000; display: none;
}
#mainNav .dropdown-menu.show {
    display: block;
    animation: navSlideDown .15s var(--ease) both;
}

#mainNav .dropdown-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .75rem;
    font-family: var(--font-body);
    font-size: .82rem; font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--t), color var(--t);
    text-decoration: none; background: none; border: none;
    width: 100%; text-align: left;
    white-space: nowrap; border-radius: var(--r-sm);
}
#mainNav .dropdown-item:hover {
    background: var(--bg-soft); color: var(--accent);
}
#mainNav .dropdown-item img {
    height: 15px; width: auto;
    border-radius: 2px; flex-shrink: 0;
}

/* ── DESKTOP NAV ── */
@media (min-width: 992px) {
    #mainNav .navbar-toggler { display: none; }
    #mainNav .navbar-collapse {
        position: static !important;
        display: flex !important;
        background: none; border: none; box-shadow: none;
        padding: 0; flex: 1;
        align-items: center; justify-content: flex-end;
        animation: none;
    }
    #mainNav .navbar-nav {
        flex-direction: row; align-items: center; gap: 0;
    }
}

/* ================================================================
   HERO
   ================================================================ */
header.masthead {
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1.5rem;
    background-image:
        linear-gradient(155deg, rgba(0,0,0,.60) 0%, rgba(0,0,0,.34) 50%, rgba(0,0,0,.18) 100%),
        url('../Img/fondo.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    text-align: center;
    color: var(--text-inverse);
    position: relative;
    overflow: hidden;
}

/* ── Keyframes hero ── */
@keyframes titleBlurSlide {
    from { opacity: 0; filter: blur(18px); transform: translateX(-36px); }
    to   { opacity: 1; filter: blur(0);    transform: translateX(0); }
}
@keyframes labelReveal {
    from { opacity: 0; letter-spacing: .30em; transform: translateY(8px); }
    to   { opacity: 1; letter-spacing: .12em; transform: translateY(0); }
}
@keyframes btnPop {
    0%   { opacity: 0; transform: translateY(18px) scale(.88); }
    65%  { transform: translateY(-4px) scale(1.04); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

header.masthead .masthead-heading,
header.masthead span.masthead-heading {
    animation: titleBlurSlide .85s cubic-bezier(.25,.46,.45,.94) .05s both;
}
header.masthead .section-heading {
    animation: labelReveal .65s var(--ease) .55s both;
}
header.masthead #PIslas .btn-warning:nth-child(1) { animation: btnPop .5s cubic-bezier(.34,1.56,.64,1) .75s  both; }
header.masthead #PIslas .btn-warning:nth-child(2) { animation: btnPop .5s cubic-bezier(.34,1.56,.64,1) .90s  both; }
header.masthead #PIslas .btn-warning:nth-child(3) { animation: btnPop .5s cubic-bezier(.34,1.56,.64,1) 1.05s both; }

/* Contenedor hero */
header.masthead .container {
    max-width: 760px; margin: 0 auto;
    display: flex; flex-direction: column;
    align-items: center; gap: 1.5rem;
    position: relative; z-index: 1;
}

/* El div que genera el UpdatePanel no debe romper el flex */
header.masthead [id$="updatepanel_cp"] {
    width: 100%;
    display: flex; flex-direction: column;
    align-items: center; gap: 1rem;
}

/* ── Heading ── */
header.masthead .masthead-heading,
header.masthead span.masthead-heading {
    font-family: var(--font);
    font-size: clamp(1.6rem, 5.5vw, 4.8rem);
    font-weight: 300;
    line-height: 1.1;
    color: var(--text-inverse);
    letter-spacing: -.03em;
    display: block;
    text-shadow: 0 2px 24px rgba(0,0,0,.25);
    word-break: break-word;
}
header.masthead .masthead-heading::after {
    content: '';
    display: block;
    width: 40px; height: 2px;
    background: rgba(255,255,255,.5);
    margin: .85rem auto 0;
}

/* Subheading */
header.masthead .masthead-subheading {
    font-family: var(--font-body);
    font-size: 1rem; font-weight: 300;
    color: rgba(255,255,255,.78);
    letter-spacing: .01em;
}

/* Label "Elija lugar de entrega" */
header.masthead .section-heading {
    font-family: var(--font);
    font-size: .9rem; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase;
    color: rgba(255,255,255,.78);
    margin: 0; width: 100%; text-align: center;
}

/* Paneles islas / CP */
header.masthead #PIslas,
header.masthead #P_CP {
    width: 100%;
    display: flex; flex-direction: column;
    align-items: center; gap: .65rem;
}

/* Fila de botones dentro del panel */
header.masthead #PIslas > div,
header.masthead #P_CP > div {
    display: flex; flex-wrap: wrap;
    align-items: center; justify-content: center;
    gap: .5rem;
}

header.masthead #PIslas h6 { margin-bottom: 0; }

/* ── Botones isla (glassmorphism) ── */
header.masthead .btn-warning {
    display: inline-block;
    font-family: var(--font);
    font-size: .95rem; font-weight: 600;
    letter-spacing: .04em;
    padding: .72rem 1.75rem;
    border-radius: var(--r-pill);
    background: rgba(255,255,255,.14);
    color: var(--text-inverse);
    border: 1px solid rgba(255,255,255,.38);
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition:
        background var(--t) var(--ease),
        border-color var(--t) var(--ease),
        transform var(--t) var(--ease),
        box-shadow var(--t) var(--ease);
    text-decoration: none;
    vertical-align: middle;
    -webkit-appearance: button;
    white-space: nowrap;
}
header.masthead .btn-warning:hover,
header.masthead .btn-warning:focus {
    background: rgba(255,255,255,.26);
    border-color: rgba(255,255,255,.70);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.20);
    outline: none;
}
header.masthead .btn-warning:active { transform: translateY(0); box-shadow: none; }

/* Botón Entrar / Volver */
header.masthead .boton_entrar1,
header.masthead .boton_entrar2 {
    background: var(--text-inverse) !important;
    color: var(--text-primary) !important;
    border-color: var(--text-inverse) !important;
    font-weight: 700;
}
header.masthead .boton_entrar1:hover,
header.masthead .boton_entrar2:hover {
    background: var(--bg-soft) !important;
    color: var(--accent) !important;
}

/* Listbox CP */
header.masthead .form-control {
    display: block;
    width: 100%; max-width: 320px;
    padding: .72rem 1.1rem;
    font-family: var(--font-body);
    font-size: .95rem; font-weight: 400;
    color: var(--text-primary);
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.5);
    border-radius: var(--r);
    appearance: none;
    transition: border-color var(--t), box-shadow var(--t);
}
header.masthead .form-control:focus {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,.30);
    outline: none;
}
header.masthead .float-left,
header.masthead .float-center { float: none !important; }
header.masthead .codPostal2   { width: 100%; max-width: 320px; }
header.masthead .boton_entrar2 { display: inline-block; margin-top: .25rem; }

/* Indicador de scroll (solo desktop) */
@media (min-width: 992px) {
    @keyframes scrollLine {
        0%,100% { opacity: 0; transform: translateX(-50%) scaleY(0.2); }
        40%      { opacity: 1; transform: translateX(-50%) scaleY(1); }
        80%      { opacity: 0.6; }
    }
    header.masthead::after {
        content: '';
        position: absolute; bottom: 1.25rem;
        left: 50%; transform: translateX(-50%);
        width: 1px; height: 36px;
        background: linear-gradient(to bottom, rgba(255,255,255,.55), transparent);
        animation: scrollLine 2.2s ease-in-out infinite;
        transform-origin: top; z-index: 1;
    }
}

/* ================================================================
   SERVICIOS — 3 columnas limpias (mismo sistema que Login)
   ================================================================ */
.page-section {
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: flex; align-items: center;
}
.page-section > .container {
    max-width: 1100px; width: 100%;
    margin: 0 auto; padding: 0 1.5rem;
}

.page-section .row.text-center {
    display: flex; flex-wrap: nowrap; align-items: stretch;
}

.page-section .col-md-4 {
    flex: 1 1 0; min-width: 0;
    padding: 1.75rem 1.5rem;
    text-align: center;
    border-right: 1px solid var(--border);
    position: relative;
    transition: background var(--t) var(--ease);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: .5rem;
}
.page-section .col-md-4:last-child { border-right: none; }

/* Línea verde de acento en hover — solo dispositivos con puntero real */
.page-section .col-md-4::after {
    content: '';
    position: absolute; bottom: 0;
    left: 50%; transform: translateX(-50%);
    width: 0; height: 2px;
    background: var(--accent);
    transition: width .3s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
    .page-section .col-md-4:hover              { background: var(--bg-subtle); }
    .page-section .col-md-4:hover::after       { width: 36px; }
    .page-section .col-md-4:hover .fa-stack    { background: var(--accent-light); transform: translateY(-2px); }
    .page-section .col-md-4:hover .fa-stack svg{ color: var(--accent); }
}

/* Icono */
.page-section .fa-stack {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background: var(--bg-muted); border-radius: 50%;
    flex-shrink: 0;
    transition: background var(--t), transform var(--t);
}
.page-section .fa-stack svg {
    width: 20px; height: 20px;
    color: var(--text-muted);
    transition: color var(--t);
}

/* Título */
.page-section h4.my-3 {
    font-family: var(--font);
    font-size: .88rem; font-weight: 600;
    color: var(--text-primary);
    letter-spacing: .01em; margin: 0;
}

/* Descripción */
.page-section .text-muted {
    color: var(--text-muted) !important;
    font-family: var(--font-body);
    font-size: .81rem; font-weight: 400;
    line-height: 1.55; margin: 0;
}

/* ── Keyframes servicios ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes iconPop {
    from { opacity: 0; transform: scale(.5) rotate(-20deg); }
    70%  { transform: scale(1.12) rotate(4deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.page-section .col-md-4.anim-ready { opacity: 0; }
.page-section .col-md-4.is-visible { opacity: 1; }

.page-section .col-md-4.is-visible .fa-stack { animation: iconPop  .6s cubic-bezier(.34,1.56,.64,1) .05s both; }
.page-section .col-md-4.is-visible h4        { animation: fadeInUp .5s var(--ease) .28s both; }
.page-section .col-md-4.is-visible p         { animation: fadeInUp .5s var(--ease) .42s both; }

.page-section .col-md-4.is-visible:nth-child(2) .fa-stack { animation-delay: .18s; }
.page-section .col-md-4.is-visible:nth-child(2) h4        { animation-delay: .38s; }
.page-section .col-md-4.is-visible:nth-child(2) p         { animation-delay: .52s; }

.page-section .col-md-4.is-visible:nth-child(3) .fa-stack { animation-delay: .32s; }
.page-section .col-md-4.is-visible:nth-child(3) h4        { animation-delay: .52s; }
.page-section .col-md-4.is-visible:nth-child(3) p         { animation-delay: .66s; }

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
    background: #1A1A1A;
    color: rgba(255,255,255,.45);
    font-family: var(--font);
    font-size: .75rem; font-weight: 400;
    letter-spacing: .01em;
    padding: 1.1rem 1.5rem;
    border-top: none;
    position: relative; z-index: 1;
}
.footer .container {
    max-width: 1100px; margin: 0 auto; padding: 0 1.5rem;
}
.footer .row.align-items-center {
    display: flex; flex-wrap: wrap;
    align-items: center; gap: .75rem;
}
.footer .col-lg-4 { flex: 1 1 auto; text-align: center; }

/* Links */
.footer a { color: rgba(255,255,255,.6); font-weight: 500; transition: color var(--t); }
.footer a:hover { color: var(--text-inverse); }

/* Social */
.footer .btn.btn-dark.btn-social {
    display: inline-flex; align-items: center; justify-content: center;
    width: auto; height: auto;
    padding: .38rem .52rem;
    border-radius: var(--r-sm);
    background: none; border: none;
    color: rgba(255,255,255,.4);
    transition: color var(--t), transform var(--t);
    text-decoration: none; margin: 0 .3rem;
}
.footer .btn.btn-dark.btn-social svg { width: 20px; height: 20px; display: block; flex-shrink: 0; }
.footer .btn.btn-dark.btn-social:hover {
    background: none; border: none;
    color: rgba(255,255,255,.9);
    transform: translateY(-2px);
}

/* Desktop: copyright izq · social centro · vacío der */
@media (min-width: 992px) {
    .footer .col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .footer .text-lg-left { text-align: left !important; }
    .footer .my-4 { margin: 0 !important; }

    /* Social va al centro */
    .footer .col-lg-4:nth-child(2) {
        order: 2; text-align: center !important;
    }
    .footer .col-lg-4:nth-child(3) {
        order: 3; text-align: right;
    }
}

/* Mobile footer */
@media (max-width: 991px) {
    .footer .row.align-items-center {
        flex-direction: column; gap: .5rem; text-align: center;
    }
    .footer .col-lg-4 { width: 100%; }
}

/* ================================================================
   RESPONSIVE HERO + SERVICIOS
   ================================================================ */

/* Tablet landscape (768 – 991 px): servicios 3 col, compacto */
@media (min-width: 768px) and (max-width: 991px) {
    header.masthead .masthead-heading,
    header.masthead span.masthead-heading {
        font-size: clamp(1.8rem, 5.5vw, 3rem);
    }
    header.masthead .btn-warning {
        font-size: .88rem; padding: .65rem 1.4rem;
    }
    .page-section .col-md-4 {
        padding: 1.25rem .75rem; gap: .35rem;
    }
    .page-section .fa-stack  { width: 38px; height: 38px; }
    .page-section .fa-stack svg { width: 17px; height: 17px; }
    .page-section h4.my-3   { font-size: .82rem; }
    .page-section .text-muted{ font-size: .75rem; }
}

/* Tablet portrait (< 768 px): servicios en columna */
@media (max-width: 767px) {
    form#form1 > header.masthead {
        min-height: 52vh; padding: 2rem 1rem;
    }
    header.masthead .masthead-heading,
    header.masthead span.masthead-heading {
        font-size: clamp(1.5rem, 7.5vw, 2.6rem);
    }
    header.masthead .container   { gap: 1.1rem; }
    header.masthead .section-heading { font-size: .82rem; }
    header.masthead .btn-warning { font-size: .87rem; padding: .62rem 1.3rem; }

    /* Servicios: 1 columna */
    .page-section .row.text-center { flex-wrap: wrap; }
    .page-section .col-md-4 {
        flex: 0 0 100%; max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1.25rem 1rem;
    }
    .page-section .col-md-4:last-child { border-bottom: none; }
}

/* Móvil pequeño (≤ 479 px) */
@media (max-width: 479px) {
    form#form1 > header.masthead {
        min-height: 50vh; padding: 1.75rem .75rem;
    }
    header.masthead .masthead-heading,
    header.masthead span.masthead-heading {
        font-size: clamp(1.35rem, 8.5vw, 2rem);
    }
    header.masthead .section-heading { font-size: .76rem; }
    header.masthead .container       { gap: .85rem; }

    /* Botones isla apilados */
    header.masthead #PIslas > div,
    header.masthead #P_CP > div {
        flex-direction: column; align-items: center; gap: .4rem;
    }
    header.masthead .btn-warning {
        font-size: .84rem; padding: .6rem 1.5rem;
        width: 100%; max-width: 220px; text-align: center;
    }
    .page-section .col-md-4 { padding: 1.1rem .85rem; }
}

/* Móvil landscape (altura muy pequeña) */
@media (max-height: 480px) and (max-width: 991px) {
    form#form1 > header.masthead {
        min-height: 80vh; padding: 1.25rem 1rem;
    }
    header.masthead .container { gap: .65rem; }
    header.masthead .masthead-heading,
    header.masthead span.masthead-heading {
        font-size: clamp(1.1rem, 5vw, 1.8rem);
    }
}

/* ================================================================
   BOTONES GLOBALES
   ================================================================ */
.btn {
    display: inline-block;
    font-family: var(--font);
    font-weight: 500; font-size: .85rem; line-height: 1.4;
    padding: .6rem 1.35rem;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    cursor: pointer; text-align: center;
    text-decoration: none; letter-spacing: .01em;
    transition:
        background var(--t) var(--ease),
        color var(--t) var(--ease),
        border-color var(--t) var(--ease),
        box-shadow var(--t) var(--ease),
        transform var(--t) var(--ease);
    vertical-align: middle;
    user-select: none; -webkit-user-select: none;
    -webkit-appearance: button;
}
.btn:focus  { outline: none; box-shadow: 0 0 0 3px rgba(26,122,36,.2); }
.btn:active { transform: translateY(1px); box-shadow: none; }

.btn-primary { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }
.btn-primary:hover { background: #0f5218; border-color: #0f5218; color: var(--text-inverse); box-shadow: var(--shadow-sm); }
.btn-primary:disabled, .btn-primary.disabled { opacity: .45; cursor: not-allowed; }

.btn-warning { background: var(--bg-muted); color: var(--text-primary); border-color: var(--border); }
.btn-warning:hover { background: var(--bg-soft); border-color: var(--border-strong); color: var(--text-primary); }

.btn-secondary { background: var(--bg-muted); color: var(--text-secondary); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text-primary); }

.btn-danger { background: #DC2626; color: var(--text-inverse); border-color: #DC2626; }
.btn-danger:hover { background: #B91C1C; border-color: #B91C1C; color: var(--text-inverse); }

.btn-azul { background: #0369A1; color: var(--text-inverse); border-color: #0369A1; }
.btn-azul:hover { background: #075985; border-color: #075985; color: var(--text-inverse); }

.btn-dark { background: var(--text-primary); color: var(--text-inverse); border-color: var(--text-primary); }
.btn-dark:hover { background: #333; color: var(--text-inverse); }

.btn-xl { padding: .9rem 2.2rem; font-size: .95rem; border-radius: var(--r-pill); }

/* ================================================================
   FORMS
   ================================================================ */
.form-control {
    display: block; width: 100%;
    padding: .65rem 1rem;
    font-family: var(--font-body);
    font-size: .95rem; font-weight: 400;
    color: var(--text-primary); background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    transition: border-color var(--t), box-shadow var(--t);
    appearance: none; -webkit-appearance: none;
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26,122,36,.12);
    outline: none;
}
.form-control::placeholder { color: var(--text-muted); }

/* ================================================================
   LAYOUT HELPERS (Bootstrap-compat mínimo)
   ================================================================ */
.container {
    width: 100%;
    padding-right: 1.25rem; padding-left: 1.25rem;
    margin-right: auto; margin-left: auto;
}
@media (min-width: 576px)  { .container { max-width: 540px;  } }
@media (min-width: 768px)  { .container { max-width: 720px;  } }
@media (min-width: 992px)  { .container { max-width: 960px;  } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }

.row {
    display: flex; flex-wrap: wrap;
    margin-right: -.75rem; margin-left: -.75rem;
}
[class*="col-"] { padding-right: .75rem; padding-left: .75rem; }

.d-none          { display: none !important; }
.text-center     { text-align: center; }
.text-muted      { color: var(--text-muted) !important; }
.text-uppercase  { text-transform: uppercase !important; }
.my-3 { margin-top: .75rem !important; margin-bottom: .75rem !important; }
.my-4 { margin-top: 1.5rem  !important; margin-bottom: 1.5rem !important; }
.py-3 { padding-top: 1rem   !important; padding-bottom: 1rem !important; }
.mx-2 { margin-right: .5rem !important; margin-left: .5rem !important; }
.ml-auto { margin-left: auto !important; }
.ml-1    { margin-left: .25rem !important; }
.mt-3    { margin-top: 0 !important; }

.col-lg-4 { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 992px) {
    .col-lg-4    { flex: 0 0 33.333%; max-width: 33.333%; }
    .text-lg-left{ text-align: left !important; }
}

.align-items-center        { align-items: center; }
.justify-content-between   { justify-content: space-between; }

/* Bootstrap collapse / dropdown JS */
.collapse:not(.show)            { display: none; }
.navbar-collapse.collapse.show  { display: flex; }
.dropdown-menu                  { display: none; }
.dropdown-menu.show             { display: block; }

/* ================================================================
   GDPR / COOKIE BANNER
   ================================================================ */
#lopdgddd {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 9998;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: .9rem 1.5rem;
    font-family: var(--font-body);
    font-size: .82rem; color: var(--text-secondary);
    display: none;
    box-shadow: 0 -4px 24px rgba(0,0,0,.07);
}
#lopdgddd > div {
    max-width: 1100px; margin: 0 auto;
    display: flex; flex-wrap: wrap;
    align-items: center; gap: .75rem;
}
#lopdgddd span { flex: 1 1 220px; line-height: 1.55; }
#lopdgddd a    { text-decoration: none; transition: opacity var(--t); }
#lopdgddd a:hover { opacity: .75; }
#lopdgddd .btn-accept {
    background: var(--accent); color: var(--text-inverse);
    padding: .42rem .95rem; border-radius: var(--r-sm);
    font-family: var(--font); font-weight: 600; font-size: .78rem;
    border: none; cursor: pointer; white-space: nowrap;
}
#lopdgddd .btn-conf {
    background: var(--bg-muted); color: var(--text-secondary);
    padding: .42rem .95rem; border-radius: var(--r-sm);
    font-family: var(--font); font-weight: 600; font-size: .78rem;
    border: 1px solid var(--border); cursor: pointer; white-space: nowrap;
}

/* Modal Bootstrap-compat */
.modal {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1050; display: none;
    overflow-x: hidden; overflow-y: auto;
}
.modal.show { display: block; }
.modal-dialog {
    position: relative; max-width: 560px;
    margin: 2rem auto; pointer-events: none;
}
.modal-lg      { max-width: 740px; }
.modal-content {
    position: relative; pointer-events: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}
.modal-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(0,0,0,.4); }

#lopdgddd-modal .modal-content h3 {
    font-family: var(--font); font-weight: 700; font-size: 1.15rem;
    color: var(--text-primary); margin-bottom: .75rem; letter-spacing: -.01em;
}
#lopdgddd-modal .modal-content .content {
    background: var(--bg-soft); border: 1px solid var(--border);
    padding: 1rem; border-radius: var(--r);
    margin: .6rem 0 1rem;
    font-size: .85rem; line-height: 1.65; color: var(--text-secondary);
}
#lopdgddd-modal .modal-content .buttons {
    display: flex; flex-wrap: wrap; gap: .65rem; padding-top: .5rem;
}
#lopdgddd-modal .modal-content .buttons a {
    padding: .65rem 1.25rem; border-radius: var(--r-sm);
    font-family: var(--font); font-weight: 600; font-size: .83rem;
    text-decoration: none; transition: opacity var(--t);
}
#lopdgddd-modal .modal-content .buttons a:hover { opacity: .85; }
#lopdgddd-modal .modal-content .btn-accept { background: var(--accent); color: var(--text-inverse); }
#lopdgddd-modal .modal-content .btn-denied {
    background: var(--bg-muted); color: var(--text-secondary);
    border: 1px solid var(--border);
}
#lopdgddd-modal .modal-content .btn-close {
    position: absolute; top: 1rem; right: 1.25rem;
    font-size: 1.5rem; line-height: 1;
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); transition: color var(--t);
}
#lopdgddd-modal .modal-content .btn-close:hover { color: var(--text-primary); }

@media (max-width: 768px) {
    #lopdgddd {
        padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
        font-size: .82rem;
        max-height: 75vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    #lopdgddd > div {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "text   text"
            "accept conf";
        gap: .85rem .6rem;
        max-width: none;
    }
    #lopdgddd span {
        grid-area: text;
        flex: none;
        font-size: .85rem;
        line-height: 1.55;
        color: var(--text-secondary);
    }
    #lopdgddd .btn-accept {
        grid-area: accept;
        text-align: center;
        padding: .78rem .9rem;
        font-size: .87rem;
        border-radius: var(--r);
        box-shadow: 0 2px 8px rgba(26,122,36,.18);
    }
    #lopdgddd .btn-conf {
        grid-area: conf;
        text-align: center;
        padding: .78rem .9rem;
        font-size: .87rem;
        border-radius: var(--r);
    }
    #lopdgddd-modal .modal-content .buttons { flex-direction: column; }
    #lopdgddd-modal .modal-content .buttons a { text-align: center; }
}

@media (max-width: 380px) {
    #lopdgddd {
        padding: .9rem .85rem calc(.9rem + env(safe-area-inset-bottom, 0px));
    }
    #lopdgddd > div {
        grid-template-columns: 1fr;
        grid-template-areas:
            "text"
            "accept"
            "conf";
        gap: .55rem;
    }
    #lopdgddd span { font-size: .82rem; }
}

/* ================================================================
   MISC
   ================================================================ */
body { overflow-x: hidden; }

#PNavNoCompatible {
    padding: 2rem 1.5rem;
    background: #FFFBEB; color: #92400E;
    text-align: center;
    font-family: var(--font-body);
    border-bottom: 1px solid #FDE68A;
}
#PNavNoCompatible a { color: var(--accent); font-weight: 600; }
#PNavNoCompatible p { margin-top: .6rem; line-height: 1.8; }

::selection      { background: rgba(26,122,36,.15); color: var(--text-primary); }
::-moz-selection { background: rgba(26,122,36,.15); color: var(--text-primary); }

::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

@media print {
    #mainNav, #lopdgddd, #lopdgddd-modal, #divprogress { display: none !important; }
    body { min-width: 960px; }
}
