/**
 * Home 2026 - Diseño basado en imagen de referencia
 * Todas las imágenes en assets/img/2026/
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Quicksand', Arial, sans-serif;
    background-image: url('../img/2026/fondo.jpg');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.home-container {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.header-home {
    width: calc(100% - 60px);
    max-width: 1400px;
    margin: 1vh auto 0;
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    padding: 2px 40px;
    z-index: 100;
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}


.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-ediba {
    height: 50px;
    width: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo-ediba:hover {
    transform: scale(1.05);
}

.header-buttons {
    display: flex;
    gap: 40px;
    align-items: center;
}

.btn-aula-digital,
.btn-promotor {
    height: 42px;
    max-width: 200px;
    width: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
    object-fit: contain;
}

.btn-aula-digital:hover,
.btn-promotor:hover {
    transform: translateY(-2px);
}

/* ===== CONTENIDO CENTRAL ===== */
.content-wrapper {
    width: 75%;
    max-width: 1400px;
    top: 2vh;
    margin: 0 auto;
    padding: 1.5vh 20px 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0px;
    flex: 1;
    min-height: 0;
}

.globo-section {
    position: relative;
    flex: 0 0 45%;
    max-width: 45%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-right: -2%;
    z-index: 1;
}


.globo-img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.libros-section {
    flex: 0 0 60%;
    max-width: 60%;
    max-height: 90%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-left: -2%;
    padding: 2%;
    container-type: inline-size;
    z-index: 1;
}

/* ===== TEXTO "ENSEÑA CON NUESTROS LIBROS" ===== */
.ensena-section {
    width: 100%;
    text-align: center;
    padding: 0 0 11% 0;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.ensena-img {
    width: auto;
    height: auto;
    max-width: 600px;
    max-height: 100px;
    display: block;
    margin: 0 auto;
}

/* ===== BOTONES INFERIORES ===== */
.buttons-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 20px 20px 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(10px, 2vw, 30px);
    flex-wrap: nowrap;
    z-index: 50;
}

.btn-bottom {
    flex: 1 1 0;
    min-width: 0;
    max-width: 350px;
    height: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    border-radius: 0;
}

.btn-bottom:hover {
    transform: translateY(-5px);
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
}

.btn-bottom:active {
    transform: translateY(-2px);
}

/* ===== RESPONSIVE TABLET ===== */
@media (max-width: 1024px) {
    .header-home {
        width: calc(90% - 40px);
        padding: 12px 30px;
        border-radius: 40px;
    }
    
    .logo-ediba {
        height: 45px;
    }
    
    .btn-aula-digital,
    .btn-promotor {
        height: 38px;
        max-width: 180px;
    }
    
    .content-wrapper {
        width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5vh 20px 0;
    position: relative;

    display: flex;
    justify-content: space-between;
    align-items: center;
    }
    
    .globo-section,
    .libros-section {
        max-width: 80%;
    }
    
    .globo-img {
        max-width: 400px;
    }
    
    .libros-img {
        max-width: 500px;
    }
    
    .ensena-img {
        max-width: 500px;
        max-height: 80px;
    }
    
    .buttons-bottom {
        gap: 20px;
        padding: 20px 20px 40px;
    }
}

/* ===== RESPONSIVE MÓVIL ===== */
@media (max-width: 768px) {
    body, html {
        background-attachment: scroll;
        overflow-y: auto;
    }
    
    .home-container {
        height: auto;
        min-height: 100vh;
        max-height: none;
        overflow: visible;
    }
    
    .header-home {
        width: calc(100% - 30px);
        margin: 3% auto 0;
        padding: 12px 20px;
        border-radius: 35px;
    }
    
    .header-content {
        
        gap: 10px;
    }
    
    .logo-ediba {
        height: 40px;
    }
    
    .header-buttons {
        gap: 10px;
    }
    
    .btn-aula-digital,
    .btn-promotor {
        height: 35px;
        max-width: 150px;
    }
    
    .content-wrapper {
        padding: 20px 15px 15px;
        gap: 15px;
        flex-direction: column;
        align-items: center;
    }
    
    .globo-section,
    .libros-section {
        width: 100%;
        max-width: 95%;
        max-height: none;
        flex: 0 1 auto;
        margin: 0;
        padding: 0;
    }
    
    .globo-section {
        display: flex;
        justify-content: center;
    }
    
    .libros-section {
        display: flex;
        justify-content: center;
    }
    
    .globo-img {
        max-width: 320px;
        max-height: none;
    }
    
    .libros-img {
        max-width: 380px;
        max-height: none;
    }
    
    .ensena-section {
        padding: 15px 0 15px 0;
    }
    
    .ensena-img {
        max-width: 90%;
        max-height: 60px;
    }
    
    .buttons-bottom {
        position: relative;
        left: auto;
        right: auto;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px 15px 30px;
    }
    
    .btn-bottom {
        width: 100%;
        max-width: 90%;
        min-width: auto;
        border-radius: 25px;
        overflow: hidden;
    }
    
    .covers-grid {
        width: 100%;
        max-width: 100%;
        padding: 10px;
    }
    
    .covers-grid img.cover {
        width: 100%;
        max-width: 100%;
    }
}

/* ===== HEADER DOS LÍNEAS ===== */
@media (max-width: 410px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== MÓVIL PEQUEÑO ===== */
@media (max-width: 480px) {
    .header-home {
        padding: 10px 15px;
        border-radius: 30px;
    }
    
    .logo-ediba {
        height: 35px;
    }
    
    .btn-aula-digital,
    .btn-promotor {
        height: 30px;
        max-width: 130px;
    }
    
    .globo-img {
        max-width: 280px;
    }
    
    .libros-img {
        max-width: 320px;
    }
    
    .ensena-img {
        max-width: 95%;
        max-height: 50px;
    }
    
    .btn-bottom {
        max-width: 95%;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-container .content-wrapper {
    animation: fadeIn 0.8s ease-out;
}

.home-container .buttons-bottom {
    animation: fadeIn 1s ease-out 0.3s both;
}


/* ===== ACCESIBILIDAD ===== */
.btn-bottom:focus,
.logo-ediba:focus,
.btn-aula-digital:focus,
.btn-promotor:focus {
    outline: 3px solid #4a90e2;
    outline-offset: 3px;
}

/* ===== GRID RESPONSIVO DE TAPAS ===== */
.covers-grid {
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.5vw, 20px);
  justify-items: center;
  align-items: start;
  padding: 0;
}

.covers-grid a {
  display: block;
  width: 100%;
}

.covers-grid img.cover {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  transition: transform .25s ease;
}

.covers-grid img.cover:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* Orden para desktop (3 columnas): reorganizar para mostrar libros arriba, cuadernos abajo */
.covers-grid a[data-order="1"] { order: 1; }
.covers-grid a[data-order="3"] { order: 2; }
.covers-grid a[data-order="5"] { order: 3; }
.covers-grid a[data-order="2"] { order: 4; }
.covers-grid a[data-order="4"] { order: 5; }
.covers-grid a[data-order="6"] { order: 6; }

/* Rotaciones para desktop */
.covers-grid a[data-order="1"] img { transform: rotate(0deg); }
.covers-grid a[data-order="3"] img { transform: rotate(4deg); }
.covers-grid a[data-order="5"] img { transform: rotate(-3deg); }
.covers-grid a[data-order="2"] img { transform: rotate(3deg); }
.covers-grid a[data-order="4"] img { transform: rotate(-5deg); }
.covers-grid a[data-order="6"] img { transform: rotate(4deg); }

/* Hover: enderezar y escalar */
.covers-grid a img:hover { 
    transform: scale(1.05) rotate(0deg) !important;
}

/* Responsive para grid de tapas */
@media (max-width: 992px) {
    .covers-grid {
        gap: 20px;
    }
    .covers-grid img.cover {
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .covers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Orden natural para 2 columnas: libro1-cuaderno1, libro2-cuaderno2, libro3-cuaderno3 */
    .covers-grid a[data-order="1"] { order: 1; }
    .covers-grid a[data-order="2"] { order: 2; }
    .covers-grid a[data-order="3"] { order: 3; }
    .covers-grid a[data-order="4"] { order: 4; }
    .covers-grid a[data-order="5"] { order: 5; }
    .covers-grid a[data-order="6"] { order: 6; }
}

@media (max-width: 480px) {
    .covers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .covers-grid img.cover {
        max-width: 100%;
        width: 100%;
    }
}


