/* --------------------
   Body Styles
-------------------- */
body {
    margin: 0 auto;
    overflow-x: hidden; /* Previene el scroll horizontal */
    box-sizing: border-box;
}

/* Asegura que todos los elementos incluyan bordes y paddings */
*,
*::before,
*::after {
    box-sizing: inherit;
}

/* --------------------
   Container Styles
-------------------- */
#container {
    width: 100%;
    min-height: 100vh;
    overflow: hidden; /* Evita desbordamiento accidental */
}

/* --------------------
   Article 1 Styles
-------------------- */
#article-1 {
    background-image: url('/img/bg-img/bg-1-opacity.jpg'); /* <- corregido */
    background-size: cover;
    background-repeat: no-repeat;
    min-height: 100vh;
    background-position: center center;
}


/* --------------------
   Search Bar Styles
-------------------- */
#buscador {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding-top: 10vh;
}

.search-box {
    display: flex;
    flex-direction: row-reverse;
    gap: 15px;
    border-bottom: 1px solid #ecf4d5;
    padding-bottom: 10px;
    max-width: 450px;
    width: 100%; /* Se adapta al contenedor */
}

.btn-search {
    width: 40px; /* Usa tamaño fijo para evitar desbordamiento */
    background-color: transparent;
    border: 0;
    color: #ecf4d5;
    cursor: pointer;
}

.input-search {
    all: unset;
    flex-grow: 1; /* Se expande para llenar el espacio restante */
    padding-left: 10px;
    height: 40px;
    background: transparent;
    border: 0;
    color: #ecf4d5;
    font-size: 18px;
    font-family: 'Zodiak', serif;
}

.resaltar {
    color: #9Ad0c2;
}

/* --------------------
   Title Styles
-------------------- */
#index-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #ecf4d5;
    padding-top: 12vh;
    text-align: center; /* Centra texto en pantallas pequeñas */
    font-family: 'Zodiak', serif;
}

/* --------------------
   Mini Button Styles
-------------------- */
#botones-minis {
    width: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
    gap: 10px;
    font-family: 'Zodiak', serif;
}

#botones-minis > a {
    background-color: #ecf4d511;
    color: #ecf4d5;
    border: 1px solid #ecf4d5;
    transition: background-color 0.6s ease, border-color 0.6s ease, color 0.6s ease;
    text-align: center;
}

#botones-minis > a:hover {
    background-color: #9Ad0c2;
    border-color: #9Ad0c2;
    color: #393e46;
}

/* --------------------
   Media Queries
-------------------- */
@media (max-width: 480px) {
    .search-box {
        width: 350px;
    }

    #botones-minis {
        width: 350px;
        gap: 0;
    }

    #botones-minis a {
        font-size: 0.9rem;
    }
}

/* --------------------
   Carousel Styles
-------------------- */
main#carousel {
    grid-row: 1 / 2;
    grid-column: 1 / 8;
    width: 100%; /* Mantener el ancho a 100% */
    max-width: 100%; /* Asegura que no exceda el contenedor */
    height: 450px; /* Reducir la altura */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 300px;
    --items: 5;
    --middle: 3;
    --position: 1;
    pointer-events: none;
    padding-top: 100px;
}

div.item {
    position: absolute;
    width: 270px; /* Reducir el tamaño de las cartas */
    height: 350px; /* Reducir la altura de las cartas */
    --r: calc(var(--position) - var(--offset));
    --abs: max(calc(var(--r) * -1), var(--r));
    transition: all 1s ease;
    transform: rotateY(calc(-10deg * var(--r))) translateX(calc(-250px * var(--r))); /* Ajustar la distancia entre las cartas */
    z-index: calc((var(--position) - var(--abs)));
    filter: blur(calc(0.5px * var(--abs))); /* Desenfoque en función de la posición */
}

div.item:nth-of-type(1) {
    --offset: 1;
}

div.item:nth-of-type(2) {
    --offset: 2;
}

div.item:nth-of-type(3) {
    --offset: 3;
}

div.item:nth-of-type(4) {
    --offset: 4;
}

div.item:nth-of-type(5) {
    --offset: 5;
}

.item > img {
    width: 100%;
    height: 100%;
    border-radius: 15px;
}

#article-2 {
    display: grid;
    grid-template-rows: 400px 100px; /* Reducir la altura del contenedor del carrusel */
    grid-template-columns: 1fr 30px 30px 30px 30px 30px 1fr;
    align-items: center;
    justify-items: center;
}

/* --------------------
   Styling Radio Inputs
-------------------- */
#article-2 input[type="radio"] {
    appearance: none; /* Elimina el estilo predeterminado */
    width: 20px;
    height: 20px;
    border: 2px solid #9Ad0c2; /* Color de borde */
    border-radius: 50%; /* Forma circular */
    background-color: transparent;
    margin: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Estado cuando el input está seleccionado */
#article-2 input[type="radio"]:checked {
    background-color: #9Ad0c2; /* Fondo cuando está seleccionado */
    border-color: #393e46; /* Cambia el color del borde */
    transform: scale(1.2); /* Efecto de agrandamiento */
}

/* Hover para inputs no seleccionados */
#article-2 input[type="radio"]:hover {
    background-color: #ecf4d5; /* Sutil cambio de fondo */
    border-color: #393e46; /* Color de borde en hover */
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    display: none;
}

input:nth-of-type(1) {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

input:nth-of-type(1):checked ~ main#carousel {
    --position: 1;
}

input:nth-of-type(2) {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}

input:nth-of-type(2):checked ~ main#carousel {
    --position: 2;
}

input:nth-of-type(3) {
    grid-column: 4 / 5;
    grid-row: 2 / 3;
}

input:nth-of-type(3):checked ~ main#carousel {
    --position: 3;
}

input:nth-of-type(4) {
    grid-column: 5 / 6;
    grid-row: 2 / 3;
}

input:nth-of-type(4):checked ~ main#carousel {
    --position: 4;
}

input:nth-of-type(5) {
    grid-column: 6 / 7;
    grid-row: 2 / 3;
}

input:nth-of-type(5):checked ~ main#carousel {
    --position: 5;
}
