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

html {
    background: linear-gradient(135deg, #0b2545 0%, #132f5b 100%);
}

:root{
    --bg-1: #f8fbfd;
    --bg-2: #f0f6fb;
    --primary: #0b2545;
    --primary-2: #132f5b;
    --accent: #ff6b6b;
    --gold: #f2c94c;
    --muted: #2b2b2b;
    --card: #ffffff;
    --card-border: #ececec;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
    color: var(--muted);
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

header {
    background-color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    padding: 50px 20px;
    padding-top: calc(env(safe-area-inset-top) + 20px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    color: white;
    margin: 0;
    position: relative;
    z-index: 9999;
}

h1 {
    font-size: 2.8em;
    font-weight: 800;
    margin: 0 0 12px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

h2 {
    font-size: 1.3em;
    color: var(--gold);
    letter-spacing: 1px;
    margin: 0;
    font-weight: 500;
}

.portada {
    margin: 40px auto;
    width: 90%;
    max-width: 500px;
    position: relative;
    padding-bottom: 60px;
}

.portada img {
    width: 100%;
    border-radius: 15px;
    display: block;
    box-shadow: 0 8px 24px rgba(11,37,69,0.12);
}

.btn-pedidos {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    color: white;
    font-weight: 700;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1.2em;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(11,37,69,0.15);
}

.btn-pedidos:hover {
    background: linear-gradient(135deg, var(--primary-2) 0%, var(--primary) 100%);
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 8px 24px rgba(11,37,69,0.2);
}

.historia {
    margin: 60px auto;
    padding: 0 20px;
    max-width: 800px;
    flex: 1;
}

.historia h3 {
    font-size: 1.6em;
    margin-bottom: 20px;
    color: var(--primary);
    font-weight: 700;
}

.historia p {
    font-size: 1em;
    line-height: 1.6;
    color: #555;
}

footer {
    margin-top: auto;
    padding: 40px 20px;
    background: linear-gradient(180deg, rgba(248,251,253,0.5) 0%, rgba(240,246,251,0.5) 100%);
    border-top: 1px solid var(--card-border);
}

/* Media query para móviles: aumentar padding-top del header */
@media (max-width: 768px) {
    header {
        padding-top: max(60px, calc(env(safe-area-inset-top) + 16px));
    }
}

/* ===== GRID RESPONSIVE ===== */
.opciones {
    display: grid;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    /* DESKTOP: 3 columnas */
    grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.opcion {
    background: var(--card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 18px rgba(11,37,69,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    min-height: 160px;
    border: 2px solid transparent;
}

.opcion img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.opcion p {
    font-weight: 700;
    font-size: 0.95em;
    color: var(--primary);
    margin: 0;
}

.opcion:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(11,37,69,0.15);
    border-color: var(--gold);
}

.opcion:hover img {
    transform: scale(1.12);
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* TABLET (768px - 1024px): 2 columnas */
@media (max-width: 1024px) {
    .opciones {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    h1 {
        font-size: 2.8em;
    }

    h2 {
        font-size: 1.3em;
    }

    .opcion {
        padding: 18px;
        gap: 12px;
    }

    .opcion img {
        width: 70px;
        height: 70px;
    }
}

/* MÓVIL (480px - 767px): 2 columnas */
@media (max-width: 768px) {
    .opciones {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    header {
        margin-top: 0;
        padding-top: max(48px, calc(env(safe-area-inset-top) + 12px));
        padding-left: 15px;
        padding-right: 15px;
        padding-bottom: 15px;
    }

    h1 {
        font-size: 2.3em;
    }

    h2 {
        font-size: 1.2em;
    }

    .portada {
        margin: 20px auto;
        padding-bottom: 50px;
    }

    .btn-pedidos {
        padding: 10px 20px;
        /* match responsive .historia h3 */
        font-size: 1.4em;
    }

    .historia {
        margin: 40px auto;
    }

    .historia h3 {
        font-size: 1.4em;
    }

    .historia p {
        font-size: 0.95em;
    }

    footer {
        margin-top: 40px;
        padding: 20px 15px;
    }

    .opcion {
        padding: 16px;
        gap: 10px;
    }

    .opcion img {
        width: 60px;
        height: 60px;
    }

    .opcion p {
        font-size: 0.95em;
    }
}

/* MÓVIL PEQUEÑO (menos de 480px): 1 columna */
@media (max-width: 480px) {
    .opciones {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    header {
        margin-top: 0;
        padding-top: max(40px, calc(env(safe-area-inset-top) + 10px));
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: 10px;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.1em;
    }

    .portada {
        margin: 15px auto;
        padding-bottom: 45px;
        width: 95%;
    }

    .btn-pedidos {
        padding: 8px 16px;
        /* match small-screen .historia h3 */
        font-size: 1.2em;
    }

    .historia {
        margin: 30px auto;
        padding: 0 15px;
    }

    .historia h3 {
        font-size: 1.2em;
    }

    .historia p {
        font-size: 0.9em;
    }

    footer {
        margin-top: 30px;
        padding: 15px 10px;
    }

    .opcion {
        padding: 14px;
        gap: 8px;
    }

    .opcion img {
        width: 50px;
        height: 50px;
    }

    .opcion p {
        font-size: 0.85em;
    }
}

/* Animación suave al cargar */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.opcion {
    animation: fadeIn 0.5s ease-out;
}

.opcion span {
    font-size: 1.5em;
}

.opcion p {
    margin-top: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

.opcion img {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Place each option explicitly so layout is:
   HTML order: 1=MENU, 2=TURISMO, 3=GALERIA, 4=CONTACTOS, 5=RESEÑAS
   Desktop (3 cols):
    col1 row1: MENU
    col2 row1: TURISMO
    col3 row1: GALERIA
    col1 row2: CONTACTOS
    col2 row2: RESEÑAS
*/
.opciones .opcion:nth-child(1) { /* MENU */
    grid-column: 1;
    grid-row: 1;
}

.opciones .opcion:nth-child(2) { /* TURISMO */
    grid-column: 2;
    grid-row: 1;
}

.opciones .opcion:nth-child(3) { /* GALERIA */
    grid-column: 3;
    grid-row: 1;
}

.opciones .opcion:nth-child(4) { /* CONTACTOS */
    grid-column: 1;
    grid-row: 2;
}

.opciones .opcion:nth-child(5) { /* RESEÑAS */
    grid-column: 2;
    grid-row: 2;
}

/* Responsive: switch to 2 columns on narrow screens, then 1 column */
@media (max-width: 800px) {
    .opciones {
        grid-template-columns: repeat(2, 1fr);
    }

    /* reflow: MENU, TURISMO, GALERIA, CONTACTOS, RESEÑAS */
    .opciones .opcion:nth-child(1) { /* MENU */
        grid-column: 1;
        grid-row: 1;
    }

    .opciones .opcion:nth-child(2) { /* TURISMO */
        grid-column: 2;
        grid-row: 1;
    }

    .opciones .opcion:nth-child(3) { /* GALERIA */
        grid-column: 1;
        grid-row: 2;
    }

    .opciones .opcion:nth-child(4) { /* CONTACTOS */
        grid-column: 2;
        grid-row: 2;
    }

    .opciones .opcion:nth-child(5) { /* RESEÑAS */
        grid-column: 1 / -1;
        grid-row: 3;
    }
}

@media (max-width: 500px) {
    .opciones {
        grid-template-columns: 1fr;
    }

    .opciones .opcion {
        grid-column: 1;
        grid-row: auto;
    }
}