/* ==========================================================
   HOME.CSS  – Estilos exclusivos de index.php
   Galerías, tarjetas, efectos, edge-to-edge, video embed
   ========================================================== */

.section-card {
    background: #fff;
    border-radius: var(--section-radius, 12px);
    padding-top: 2rem;
    padding-bottom: 1rem;
    box-shadow: var(--section-shadow, 0 4px 12px rgba(0,0,0,0.08));
    text-align: center;
    overflow: hidden;
    width: 100%;
    scroll-margin-top: 120px;
}

.section-card.shadow-none    { --section-shadow: none; }
.section-card.shadow-light   { --section-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.section-card.shadow-medium  { --section-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.section-card.shadow-strong  { --section-shadow: 0 12px 28px rgba(0,0,0,0.20); }

/* ---------- EDGE-TO-EDGE (Pantalla completa) ---------- */
.section-card.is-fullscreen {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
}
.section-card.is-fullscreen .image-gallery,
.section-card.is-fullscreen .effect-single-frame {
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    display: block !important;
}
.section-card.is-fullscreen .card-frame {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.section-card.is-fullscreen .card-img-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 480px;
    max-height: 640px !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    display: block !important;
    overflow: hidden !important;
}
.section-card.is-fullscreen .card-frame-img {
    width: 100% !important;
    height: 100% !important;
    max-height: 640px !important;
    object-fit: fill !important;
    display: block !important;
}

/* ---------- TÍTULO ---------- */
.card-header,
.section-content {
    padding-left: 2rem;
    padding-right: 2rem;
}

.section-card h2 {
    border-bottom: 3px solid var(--theme-color, var(--accent-orange));
    padding-bottom: .5rem;
    margin-bottom: 1.2rem;
    display: inline-block;
    position: relative;
}
.section-card h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    width: 40%;
    height: 3px;
    background: var(--theme-color, var(--accent-orange));
    transform: translateX(-50%);
    filter: brightness(1.2);
    border-radius: 2px;
}

.section-content {
    margin-bottom: 1.5rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.align-left   { text-align: left; }
.align-center { text-align: center; }
.align-right  { text-align: right; }
.align-left .section-card h2  { display: block; text-align: left; }
.align-right .section-card h2 { display: block; text-align: right; }

/* ---------- GALERÍA ESTÁNDAR (grid dinámico) ---------- */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--gallery-gap, 25px);
    width: 100%;
    padding: 1.5rem;
    align-items: stretch;
}

.section-card.cols-1 .image-gallery { grid-template-columns: 1fr; }
.section-card.cols-2 .image-gallery { grid-template-columns: repeat(2, 1fr); }
.section-card.cols-3 .image-gallery { grid-template-columns: repeat(3, 1fr); }
.section-card.cols-4 .image-gallery { grid-template-columns: repeat(4, 1fr); }

.card-frame {
    border-radius: 24px;
    padding: 20px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    transition: transform .35s ease, box-shadow .35s ease;
    position: relative;
}
.card-frame.has-border { border: 3px solid var(--theme-color, #CDDC39); }
.card-frame:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(0,0,0,0.10);
}

.card-img-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background-color: #f8fafc;
    position: relative;
}

.card-frame-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease-in-out;
}
.card-frame-img.is-contain {
    object-fit: contain !important;
    max-height: 52.5vh !important;
}
.card-img-wrapper.has-fit {
    aspect-ratio: auto;
    max-height: 52.5vh;
}

/* Overlay opcional sobre imagen */
.image-overlay-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,.55), transparent 55%);
    padding: 1.2rem;
    font-weight: 700;
    font-size: 1.1rem;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
    pointer-events: none;
    text-align: center;
}

/* ---------- BADGE (píldora / rectángulo / cuadrado / gradient) ---------- */
.oferton-badge {
    background-color: var(--theme-color, #CDDC39);
    color: #fff;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: 12px 32px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: transform .3s ease, filter .2s ease, box-shadow .3s ease;
    display: inline-block;
    white-space: nowrap;
    margin-top: 10px;
    animation: pulseBadge 2.6s infinite;
}
.oferton-badge.badge-rectangle { border-radius: 8px; }
.oferton-badge.badge-square    { border-radius: 0; }
.oferton-badge.badge-gradient  {
    background: linear-gradient(90deg, var(--theme-color, #CDDC39), #ff9800);
}
.oferton-badge.badge-outline {
    background: transparent;
    color: var(--theme-color, #CDDC39);
    border: 2px solid var(--theme-color, #CDDC39);
    animation: none;
}

@keyframes pulseBadge {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.05); }
}

/* ---------- HOVER ZOOM ---------- */
.has-hover-zoom .card-frame-img { transition: transform .4s ease-in-out; }
.has-hover-zoom .card-frame-img:hover { transform: scale(1.08); }
.has-hover-zoom .oferton-badge:hover {
    transform: scale(1.15) translateY(-3px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

/* ---------- MODO EFECTO TRANSICIÓN (slider) ---------- */
.effect-single-frame {
    width: 100%;
    max-width: 100%;
    padding: 1.5rem;
    margin: 0 auto;
}
.effect-single-frame .card-frame {
    max-width: 100%;
    width: 100%;
}
.effect-single-frame .card-img-wrapper {
    position: relative;
    width: 100%;
    height: 480px;
    overflow: hidden;
}
.effect-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity .8s ease-in-out, transform .8s ease-in-out;
    z-index: 1;
}
.effect-slide.active {
    opacity: 1;
    visibility: visible;
    transform: none !important;
    z-index: 2;
}
.effect-fade .effect-slide         { opacity: 0; }
.effect-fade .effect-slide.active  { opacity: 1; }

.effect-slide-left .effect-slide         { transform: translateX(100%);  opacity: 0; }
.effect-slide-left .effect-slide.active  { transform: translateX(0);     opacity: 1; }
.effect-slide-right .effect-slide        { transform: translateX(-100%); opacity: 0; }
.effect-slide-right .effect-slide.active { transform: translateX(0);     opacity: 1; }
.effect-slide-up .effect-slide           { transform: translateY(100%);  opacity: 0; }
.effect-slide-up .effect-slide.active    { transform: translateY(0);     opacity: 1; }
.effect-slide-down .effect-slide         { transform: translateY(-100%); opacity: 0; }
.effect-slide-down .effect-slide.active  { transform: translateY(0);     opacity: 1; }
.effect-zoom .effect-slide               { transform: scale(.8);         opacity: 0; }
.effect-zoom .effect-slide.active        { transform: scale(1);          opacity: 1; }
.effect-flip .effect-slide               { transform: rotateY(90deg);    opacity: 0; }
.effect-flip .effect-slide.active        { transform: rotateY(0deg);     opacity: 1; }
.effect-blur .effect-slide               { filter: blur(20px);           opacity: 0; }
.effect-blur .effect-slide.active        { filter: blur(0);              opacity: 1; }
.effect-rotate .effect-slide             { transform: rotate(-45deg) scale(.5); opacity: 0; }
.effect-rotate .effect-slide.active      { transform: rotate(0) scale(1);       opacity: 1; }

/* ---------- CONTROLES SLIDER ---------- */
.slider-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}
.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0,0,0,.25);
    cursor: pointer;
    border: none;
    transition: background .3s, transform .3s;
}
.slider-dot.is-active {
    background: var(--theme-color, var(--accent-orange));
    transform: scale(1.25);
}
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.35);
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 3;
    transition: background .2s;
}
.slider-arrow:hover { background: rgba(0,0,0,.6); }
.slider-arrow.arrow-prev { left: 10px; }
.slider-arrow.arrow-next { right: 10px; }

/* ---------- VIDEO EMBED ---------- */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 1200px;
    margin: 1.5rem auto;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.15);
}
.video-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}
.section-card.is-fullscreen .video-embed { max-width: 100%; border-radius: 0; margin: 0; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .section-card.cols-4 .image-gallery { grid-template-columns: repeat(2, 1fr); }
    .section-card.cols-3 .image-gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .image-gallery,
    .section-card.cols-2 .image-gallery,
    .section-card.cols-3 .image-gallery,
    .section-card.cols-4 .image-gallery { grid-template-columns: 1fr; }
    .effect-single-frame .card-img-wrapper { height: 320px; }
    .section-card.is-fullscreen .card-img-wrapper,
    .section-card.is-fullscreen .card-frame-img { max-height: 400px !important; }
    .oferton-badge { font-size: .85rem; padding: 10px 22px; }
}
