/* --- START OF FILE selection.css --- */

html {
    background-color: #1a1a1a;
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: transparent;
    color: #fff;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Fundo desfocado */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/images/background.jpg');
    background-size: cover;
    background-position: center;
    background-blend-mode: multiply;
    background-color: rgba(0, 0, 0, 0.7);
    filter: blur(2px);
    z-index: -1;
}

/* Cabeçalho: logo + barra de pesquisa */
.header-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 15px 10px 5px;
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.app-logo {
    width: 85%;
    max-width: 200px;
    height: auto;
    margin-bottom: 10px;
    object-fit: contain;
}

.search-bar {
    display: flex;
    width: 90%;
    max-width: 300px;
    background-color: #ffffff;
    border-radius: 25px;
    padding: 8px 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    z-index: 20;
}

.search-bar input {
    flex-grow: 1;
    border: none;
    outline: none;
    background: none;
    font-size: 0.95rem;
    color: #333;
    padding-right: 8px;
}

.search-bar input::placeholder {
    color: #888;
}

.search-bar button {
    background: none;
    border: none;
    color: #333;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Container dos cards */
.selection-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 0;
    width: 100%;
    max-width: 420px;
    margin: 5px auto 0;
    padding: 0;
    box-sizing: border-box;
    flex-grow: 1;
    overflow-y: hidden;
    position: relative;
}

.selection-card-link {
    display: block;
    width: 100%;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.2s ease;
    position: relative;
    outline: none;
}

.selection-card-link:hover {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.selection-card-link:focus {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.4);
    z-index: 10;
}

.selection-card-image {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
    /* REMOVIDO max-height para evitar corte em telas pequenas */
    object-fit: contain; /* Garante que a imagem inteira apareça */
}

/* --- MEDIA QUERY: TELAS MÓVEIS (até 480px) --- */
@media (max-width: 480px) {

    .header-section {
        padding: 10px 5px 5px;
    }

    .app-logo {
        width: 80%;
        max-width: 180px;
        margin-bottom: 8px;
    }

    .search-bar {
        width: 90%;
        max-width: 280px;
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .search-bar input {
        font-size: 0.9rem;
    }

    .selection-container {
        grid-gap: 0;
        margin-top: 5px;
        padding: 0;
        max-height: calc(100vh - 180px);
    }

    .selection-card-image {
        max-height: calc((100vh - 180px) / 3);
        object-fit: cover;
    }
}

/* --- MEDIA QUERY: TELAS MUITO ESTREITAS (ex: iPhone SE) --- */
@media (max-width: 360px) {
    .app-logo {
        width: 75%;
        max-width: 160px;
    }

    .search-bar {
        max-width: 260px;
        padding: 5px 8px;
    }

    .selection-container {
        max-height: calc(100vh - 170px);
    }

    .selection-card-image {
        max-height: calc((100vh - 170px) / 3);
        object-fit: cover;
    }
}

/* --- MEDIA QUERY: DESKTOP (a partir de 481px) --- */
@media (min-width: 481px) {

    .selection-container {
        grid-gap: 15px;
        padding: 15px;
        margin: 10px auto 0; /* ← reduzido de 20px para 10px */
        max-height: none;
        overflow-y: visible;
        width: 100%;
        max-width: 500px;
    }

    .selection-card-link {
        width: 100%;
        max-width: 220px;
        aspect-ratio: 1 / 1; /* força o card ser quadrado */
    }

    .selection-card-image {
        width: 100%;
        height: 100%;
        border: 1px solid #C6A66C;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        background-color: #420d04;
        object-fit: contain; /* Garante que a imagem inteira apareça */
    }

    .selection-card-link:hover {
        transform: scale(1.03);
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
        z-index: 10;
    }

    .selection-card-link:focus {
        box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.5);
        z-index: 10;
    }

    .header-section {
        padding: 20px 15px 10px;
    }

    .app-logo {
        width: 90%;
        max-width: 220px;
        margin-bottom: 15px;
    }

    .search-bar {
        width: 85%;
        max-width: 320px;
        padding: 10px 15px;
    }
}
/* --- END OF FILE selection.css --- */
