/* ============================================================
   MERCABASTOS — Capa MODERNA institucional (solo index)
   Tema claro gubernamental · glass sutil · gradientes suaves
   Se carga DESPUÉS de styles.css.
   ============================================================ */

:root {
    --gov-1: #0d47a1;   /* azul institucional */
    --gov-2: #1565c0;
    --gov-3: #1e88e5;
    --gov-4: #00acc1;   /* cian suave */
    --gov-red: #e63946; /* rojo institucional (acento) */
    --gov-gold: #f4a261;
    --ink: #16233a;
    --ink-soft: #46566f;
    --paper: #f4f8fd;
    --line: rgba(13, 71, 161, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-bd: rgba(255, 255, 255, 0.9);
}

/* ---------- Fondo claro institucional ---------- */
body.home-modern {
    background: var(--paper);
    color: var(--ink);
}

.mesh-bg {
    position: fixed;
    inset: 0;
    z-index: -10;
    overflow: hidden;
    background:
        radial-gradient(1000px 700px at 85% -5%, rgba(30, 136, 229, 0.12), transparent 60%),
        radial-gradient(900px 600px at 0% 100%, rgba(0, 172, 193, 0.10), transparent 60%),
        linear-gradient(180deg, #f4f8fd 0%, #eaf2fb 100%);
}
.mesh-bg span {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.28;
    will-change: transform;
    animation: meshFloat 26s ease-in-out infinite;
}
.mesh-bg .m1 { width: 42vw; height: 42vw; background: var(--gov-3); top: -12%; left: -8%; }
.mesh-bg .m2 { width: 36vw; height: 36vw; background: var(--gov-4); top: 15%; right: -10%; animation-delay: -8s; }
.mesh-bg .m3 { width: 34vw; height: 34vw; background: #90caf9; bottom: -10%; left: 25%; animation-delay: -14s; }
.mesh-bg .m4 { display: none; }

@keyframes meshFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(4vw, 5vh) scale(1.12); }
}

/* Grid muy sutil */
.mesh-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(13,71,161,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13,71,161,0.04) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 70%);
}

/* Partículas tenues */
#fx-particles { position: fixed; inset: 0; z-index: -9; pointer-events: none; opacity: 0.5; }

/* ============================================================
   HEADER
   ============================================================ */
body.home-modern .site-header {
    background: linear-gradient(100deg, #0a2f6b 0%, #0d47a1 45%, #1565c0 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
body.home-modern .site-header.scrolled {
    background: linear-gradient(100deg, #082656 0%, #0d47a1 50%, #1565c0 100%);
    box-shadow: 0 8px 30px rgba(13, 71, 161, 0.3);
}

/* ============================================================
   HERO institucional
   ============================================================ */
.hero-x {
    position: relative;
    min-height: 96vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 130px 16px 90px;
    overflow: hidden;
}
/* imagen institucional de fondo del hero, suave */
.hero-x::before {
    content: "";
    position: absolute; inset: 0; z-index: -1;
    background: url('../imagenes/Comercializadora mercabastos.png') center/cover no-repeat;
    opacity: 0.55;
    mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 96%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 96%);
}

.hero-x__inner { max-width: 980px; position: relative; z-index: 2; }

.hero-x .eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 22px; border-radius: 999px;
    background: rgba(13, 71, 161, 0.92);
    border: 1px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(12px);
    font-size: 0.82rem; letter-spacing: 1.2px; text-transform: uppercase;
    color: #fff; font-weight: 800;
    margin-bottom: 26px;
    box-shadow: 0 8px 24px rgba(13, 71, 161, 0.35);
}
.hero-x .eyebrow .dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 12px #4ade80; }

.hero-x h1 {
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 900; line-height: 1.05; letter-spacing: -1px;
    margin-bottom: 20px; color: #0a2f66;
    text-shadow: 0 2px 4px rgba(255,255,255,0.7), 0 6px 26px rgba(255,255,255,0.9);
}
.hero-x h1 .shine {
    background: linear-gradient(100deg, #1565c0, #00acc1 50%, #0d47a1);
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: shineMove 7s linear infinite;
    text-shadow: none;
    filter: drop-shadow(0 2px 10px rgba(255,255,255,0.8));
}
@keyframes shineMove { to { background-position: 200% center; } }

.hero-x p.lead {
    font-size: clamp(0.98rem, 1.6vw, 1.15rem);
    color: #16233a; font-weight: 600;
    max-width: 600px; margin: 0 auto 32px;
    text-shadow: 0 1px 3px rgba(255,255,255,0.9), 0 2px 14px rgba(255,255,255,0.8);
}

/* Velo suave detrás del contenido del hero para máxima legibilidad */
.hero-x__inner::before {
    content: "";
    position: absolute; inset: -40px -30px;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(244,248,253,0.85) 0%, rgba(244,248,253,0.55) 55%, transparent 80%);
    border-radius: 40px;
}

/* Botones institucionales */
.btn-x {
    position: relative; display: inline-flex; align-items: center; gap: 10px;
    padding: 15px 32px; border-radius: 999px; font-weight: 700; text-decoration: none; color: #fff;
    background: linear-gradient(135deg, var(--gov-1), var(--gov-3));
    box-shadow: 0 12px 30px rgba(13, 71, 161, 0.35);
    overflow: hidden;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn-x::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.5), transparent);
    transform: translateX(-130%); transition: transform 0.7s var(--ease);
}
.btn-x:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 18px 44px rgba(13, 71, 161, 0.5); color: #fff; }
.btn-x:hover::after { transform: translateX(130%); }

.btn-x.ghost {
    background: rgba(255,255,255,0.8); color: var(--gov-1);
    border: 1px solid var(--line); backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(13, 71, 161, 0.12);
}
.btn-x.ghost:hover { background: #fff; color: var(--gov-1); box-shadow: 0 16px 40px rgba(13, 71, 161, 0.22); }

/* Indicador scroll */
.hero-x__cue {
    position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 2;
    color: var(--gov-2); font-size: 0.7rem; letter-spacing: 3px;
    display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0.8;
}
.hero-x__cue .m { width: 24px; height: 40px; border: 2px solid var(--gov-2); border-radius: 14px; position: relative; }
.hero-x__cue .m::after {
    content: ""; position: absolute; top: 8px; left: 50%; width: 4px; height: 8px;
    background: var(--gov-3); border-radius: 4px; transform: translateX(-50%); animation: wheel 1.6s infinite;
}

/* ============================================================
   GLASS card claro
   ============================================================ */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-bd);
    border-radius: 24px;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px rgba(13, 71, 161, 0.12);
}

.tilt { transform-style: preserve-3d; transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease); will-change: transform; }
.tilt .tilt-in { transform: translateZ(30px); }

/* ============================================================
   STATS
   ============================================================ */
.stats-x { padding: 30px 0 10px; position: relative; z-index: 2; }
.stats-x .glass { padding: 40px; }
.stat-item { text-align: center; padding: 12px; }
.stat-item .num {
    font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 900; line-height: 1;
    background: linear-gradient(135deg, var(--gov-1), var(--gov-4));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-item .lbl { color: var(--ink-soft); margin-top: 8px; font-size: 0.9rem; letter-spacing: 0.3px; font-weight: 600; }

/* ============================================================
   SECCIÓN
   ============================================================ */
.sec-x { position: relative; z-index: 2; padding: 84px 0; }
.sec-x .kick {
    display: inline-block; font-size: 0.78rem; font-weight: 800; letter-spacing: 3px; text-transform: uppercase;
    color: var(--gov-red); margin-bottom: 10px;
}
.sec-x h2 { font-weight: 900; letter-spacing: -1px; color: var(--gov-1); font-size: clamp(1.8rem, 4vw, 2.8rem); }
.sec-x .sub { color: var(--ink-soft); max-width: 600px; }

/* ============================================================
   Servicios — panel elegante (círculo + badge + mini-iconos)
   ============================================================ */
.svc-x {
    position: relative;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 26px 26px 22px;
    border-radius: 24px;
    text-decoration: none;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--line);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(13, 71, 161, 0.08);
    overflow: hidden;
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
    height: 100%;
}
.svc-x::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
    background: linear-gradient(90deg, var(--gov-3), var(--gov-4));
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.45s var(--ease);
}
.svc-x:hover { transform: translateY(-6px); border-color: var(--gov-3); box-shadow: 0 24px 46px rgba(21, 101, 192, 0.2); color: var(--ink); }
.svc-x:hover::after { transform: scaleX(1); }

.svc-x .ic {
    position: relative;
    flex-shrink: 0;
    width: 68px; height: 68px;
    display: grid; place-items: center;
    border-radius: 50%;
    font-size: 1.7rem; color: #fff;
    background: radial-gradient(circle at 32% 28%, var(--gov-3), var(--gov-1) 75%);
    box-shadow: 0 10px 26px rgba(21, 101, 192, 0.4), inset 0 2px 6px rgba(255,255,255,0.35);
    transition: transform 0.35s var(--ease);
}
.svc-x:hover .ic { transform: scale(1.08); }

.svc-x .svc-body { flex: 1; min-width: 0; }
.svc-x .svc-title {
    display: block;
    font-weight: 800; font-size: 1.02rem; color: var(--ink);
    margin-bottom: 2px;
}
.svc-x .svc-sub {
    display: block;
    font-size: 0.78rem; font-weight: 600; color: var(--ink-soft);
    margin-bottom: 10px;
}

.svc-x .svc-mini {
    display: flex; align-items: center; gap: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
}
.svc-x .svc-mini span {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.7rem; font-weight: 700; color: var(--gov-2);
    white-space: nowrap;
}
.svc-x .svc-mini span i { font-size: 0.75rem; color: var(--gov-3); }
.svc-x .svc-mini .sep { width: 1px; height: 12px; background: var(--line); flex-shrink: 0; }

.svc-x .svc-arrow {
    flex-shrink: 0;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--paper);
    color: var(--gov-2);
    font-size: 0.8rem;
    transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.svc-x:hover .svc-arrow { background: var(--gov-2); color: #fff; transform: translateX(3px); }

.svc-badge {
    position: absolute; top: 18px; right: 18px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 999px;
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32; font-size: 0.66rem; font-weight: 800;
    letter-spacing: 0.3px;
}
.svc-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #2e7d32; }

@media (max-width: 420px) {
    .svc-x { gap: 14px; padding: 20px 18px 18px; }
    .svc-x .ic { width: 54px; height: 54px; font-size: 1.4rem; }
    .svc-x .svc-arrow { display: none; }
}

/* ============================================================
   BANNER PSE — pagos en línea
   ============================================================ */
.pse-x { position: relative; z-index: 2; padding: 40px 0; }
.pse-banner {
    position: relative; overflow: hidden;
    border-radius: 28px;
    padding: 44px 40px;
    background: linear-gradient(120deg, #0d47a1 0%, #1565c0 55%, #1e88e5 100%);
    box-shadow: 0 24px 60px rgba(13, 71, 161, 0.35);
    display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.pse-banner::before {
    content: ""; position: absolute; top: -60%; right: -10%;
    width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0,172,193,0.5), transparent 70%);
    filter: blur(20px);
}
.pse-banner::after {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.12) 1px, transparent 1px);
    background-size: 22px 22px; opacity: 0.4;
    mask-image: linear-gradient(90deg, transparent, #000);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000);
}
.pse-banner .pse-txt { position: relative; z-index: 1; color: #fff; flex: 1 1 320px; }
.pse-banner .pse-txt .badge-pse {
    display: inline-block; padding: 5px 14px; border-radius: 999px;
    background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.35);
    font-size: 0.72rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 12px;
}
.pse-banner .pse-txt h3 { font-weight: 900; font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 8px; letter-spacing: -0.5px; }
.pse-banner .pse-txt p { margin: 0; color: #d7e6fb; font-size: 1rem; }
.pse-banner .pse-cta { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pse-logo {
    width: 82px; height: 82px; border-radius: 20px; background: #fff;
    display: grid; place-items: center; padding: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    flex-shrink: 0;
}
.pse-logo img { width: 100%; height: auto; }
.btn-pse {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 15px 30px; border-radius: 999px; font-weight: 800; text-decoration: none;
    color: #0d47a1; background: #fff;
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn-pse:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 18px 44px rgba(0,0,0,0.3); color: #0d47a1; }
.btn-pse i { transition: transform 0.3s var(--ease); }
.btn-pse:hover i { transform: translateX(4px); }

/* ============================================================
   GALERÍA / BENTO imágenes locales con nombre sobrepuesto
   ============================================================ */
.bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 210px;
    gap: 16px;
}
.bento-card {
    position: relative; overflow: hidden; border-radius: 22px;
    box-shadow: 0 16px 40px rgba(13, 71, 161, 0.18);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.6);
    padding: 0; margin: 0; cursor: pointer; width: 100%; display: block;
    background: none; font: inherit; text-align: left;
}
.bento-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.bento-card .cap {
    position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
    padding: 22px;
    background: linear-gradient(to top, rgba(9,29,66,0.92) 8%, rgba(9,29,66,0.35) 50%, rgba(9,29,66,0.05) 100%);
}
.bento-card .cap h3 {
    color: #fff; font-weight: 800; font-size: 1.15rem; margin: 0 0 4px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.bento-card .cap p {
    color: #d6e4ff; font-size: 0.85rem; margin: 0;
    opacity: 0.9; max-height: 0; overflow: hidden;
    transition: max-height 0.45s var(--ease), margin 0.45s var(--ease);
}
.bento-card:hover img { transform: scale(1.09); }
.bento-card:hover .cap p { max-height: 70px; margin-top: 4px; }
.bento-card .tag {
    position: absolute; top: 14px; left: 14px;
    padding: 6px 14px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
    background: rgba(255,255,255,0.9); color: var(--gov-1);
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
/* barra inferior de color por marca */
.bento-card::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
    background: linear-gradient(90deg, var(--gov-3), var(--gov-4));
    transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease);
}
.bento-card:hover::after { transform: scaleX(1); }

.bento-card.big { grid-column: span 2; grid-row: span 2; }
.bento-card.wide { grid-column: span 2; }
.bento-card.tall { grid-row: span 2; }

@media (max-width: 900px) {
    .bento { grid-template-columns: repeat(2, 1fr); }
    .bento-card.big { grid-column: span 2; grid-row: span 2; }
    .bento-card.wide { grid-column: span 2; }
    .bento-card.tall { grid-row: span 1; }
}
@media (max-width: 560px) {
    .bento { grid-template-columns: 1fr; }
    .bento-card, .bento-card.big, .bento-card.wide, .bento-card.tall { grid-column: span 1; grid-row: span 1; }
}

/* ============================================================
   NOTICIAS
   ============================================================ */
.news-x {
    display: flex; gap: 16px; padding: 16px; border-radius: 20px; text-decoration: none;
    background: rgba(255,255,255,0.85); border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(13, 71, 161, 0.08);
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); height: 100%;
}
.news-x img { width: 108px; height: 108px; object-fit: cover; border-radius: 14px; flex-shrink: 0; }
.news-x .bd { color: var(--ink-soft); }
.news-x .bd .dt { color: var(--gov-3); font-size: 0.75rem; font-weight: 800; }
.news-x .bd p { margin: 4px 0 8px; font-size: 0.9rem; color: var(--ink); }
.news-x .bd .more { color: var(--gov-red); font-weight: 700; font-size: 0.85rem; }
.news-x:hover { transform: translateY(-6px); box-shadow: 0 22px 46px rgba(13, 71, 161, 0.16); }

/* CTA final */
.cta-x { position: relative; z-index: 2; padding: 90px 0; }
.cta-x .glass {
    padding: 60px 30px; text-align: center;
    background: linear-gradient(135deg, rgba(13,71,161,0.96), rgba(30,136,229,0.92));
    border: 0;
}
.cta-x h2 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; color: #fff; letter-spacing: -1px; }
.cta-x p { color: #dceafc; max-width: 560px; margin: 12px auto 30px; }
.cta-x .btn-x { background: #fff; color: var(--gov-1); }
.cta-x .btn-x:hover { color: var(--gov-1); }
.cta-x .btn-x.ghost { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.5); }

/* Footer */
body.home-modern .site-footer { position: relative; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
    .mesh-bg span { animation: none; }
    .hero-x h1 .shine { animation: none; }
}
