/* ============================================
   RESET Y VARIABLES
   ============================================ */

:root {
    --primary-color: #ff8c00;
    --secondary-color: #1f2937;
    --text-color: #2a2a2a;
    --text-light: #5f6a76;
    --bg-color: #f3f6f3;
    --card-bg: #ffffff;
    --border-color: #d7d7d7;
    --star-gold: #ffb400;
    --star-empty: #dfe2e6;
    --checkbox-checked: #2d7d45;
    --consumed-bg: #eaf8ee;
    --badge-bg: #245c35;
    --badge-text: #f7fff6;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 5px 18px rgba(0, 0, 0, 0.15);
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.5;
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

/* ============================================
   HEADER
   ============================================ */

.header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: 0;
    border-bottom: 2px solid var(--primary-color);
}

.header img {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.header h1 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
}

.header .subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* ============================================
   SECCIÓN DE BÚSQUEDA (VERSIÓN ELEGANTE)
   ============================================ */

.search-sticky {
    position: sticky;
    top: 0;
    z-index: 20;

    /* Fondo elegante */
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.85);

    /* Más espacio para que no choque con stats */
    padding: 1rem 1.2rem 1.8rem;

    /* Bordes suaves */
    border-radius: 0 0 14px 14px;

    /* Sombra más ligera y elegante */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);

    /* Separación visual clara */
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Contenedor principal */
.search-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;

    /* Separación respecto al alfabeto */
    margin-top: 0.8rem;
}

/* Buscador alfabético */
.alphabet-search {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;

    /* Más aire visual */
    margin-bottom: 0.4rem;
}

/* Botones del alfabeto */
.letter-btn {
    width: 34px;
    height: 34px;

    background: #ffb400;
    color: white;

    border: none;
    border-radius: 8px;

    font-weight: 600;
    cursor: pointer;

    transition: all 0.2s ease;
}

.letter-btn:hover {
    background: #e09e00;
    transform: translateY(-2px);
}

/* Inputs */
.text-search,
.style-search {
    flex: 1;
    max-width: 300px;
}

.text-search input,
.style-search input {
    width: 100%;
    padding: 0.75rem 1rem;

    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 10px;

    background: rgba(255,255,255,0.95);
    font-size: 1rem;

    transition: border-color 0.2s ease;
}

.text-search input:focus,
.style-search input:focus {
    border-color: #ffb400;
    outline: none;
}

/* ============================================
   AJUSTE PARA EVITAR SOLAPAMIENTO CON STATS
   ============================================ */

.stats {
    margin-top: 1.4rem; /* separa los stats del sticky */
}



/* ============================================
   ESTADÍSTICAS
   ============================================ */

.stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--card-bg);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ============================================
   GRID DE FÁBRICAS
   ============================================ */

.breweries-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.brewery-card {
    scroll-margin-top: 140px;
}

.page-footer {
    background-color: #ffb400;
    width: 100%;
    margin-top: var(--spacing-lg);
    padding: 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* Imagen a full width */
.footer-image {
    width: 100%;
    height: auto; /* de momento sin recorte */
    display: block;
}

/* Texto centrado y discreto */
.footer-text {
    font-size: 0.8rem;
    color: black;
    margin: 0.4rem 0;
    line-height: 1.4;
}

/* Links integrados en el texto */
.footer-text a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}

.footer-text a:hover {
    text-decoration: underline;
}



/* ============================================
   TARJETA DE FÁBRICA
   ============================================ */

.brewery-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

@media (hover: hover) and (pointer: fine) {
    .brewery-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-hover);
    }
}

.brewery-header {
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-color), #ff7b00);
    color: white;
    display: flex;
    align-items: stretch;
    gap: var(--spacing-md);
}

.brewery-logo {
    flex-shrink: 0;
    width: 100px;
    height: 100%;
    min-height: 100px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.65);
}

.brewery-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brewery-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    text-align: left;
}

.brewery-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.brewery-origin {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

.beers-list {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* ============================================
   TARJETA DE CERVEZA
   ============================================ */

.beer-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-sm);
    background: #fafafa;
    transition: border-color 0.2s, background-color 0.2s;
    display: block;
    position: relative;
}

.beer-item:hover {
    border-color: var(--primary-color);
    background: white;
}

.beer-id {
    display: none;
}

.beer-content {
    display: grid;
    grid-template-columns: 70% 30%;
    gap: var(--spacing-sm);
    align-items: start;
}

.beer-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-color);
    line-height: 1.3;
}

.beer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.beer-status {
    align-items: center;
}

.beer-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-light);
    white-space: nowrap;
}

.beer-check::before {
    content: 'Bebida';
}

.beer-controls {
    grid-column: 1;
}

.beer-item.selected-beer {
    border-color: var(--primary-color);
    background: #fff8e0;
    box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.12);
}

.beer-item.checked-beer {
    background: var(--consumed-bg);
    border-color: var(--checkbox-checked);
}

.beer-item.hidden-by-style {
    display: none;
}

.five-stars-badge {
    display: none;
    background-image: url('imagenes/5estrellas.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    width: 142px;
    height: 142px;
    grid-column: 2;
    justify-self: center;
    align-self: center;
}

.beer-item.five-stars .five-stars-badge {
    display: block;
}

.beer-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.beer-badge {
    display: none;
}

/* ============================================
   CHECKBOX (Bebida/No Bebida)
   ============================================ */

.beer-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.checkbox-wrapper {
    display: none;
}

.beer-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--checkbox-checked);
    flex-shrink: 0;
    margin-top: 0px;
}

.checkbox-label {
    display: none;
}

/* ============================================
   SISTEMA DE ESTRELLAS
   ============================================ */

.rating-section {
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-sm);
}

.rating-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
    display: block;
}

.stars-container {
    display: flex;
    gap: 2px;
    margin-bottom: var(--spacing-sm);
}

.star {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.1s;
    user-select: none;
}

@media (hover: hover) and (pointer: fine) {
    .star:hover {
        transform: scale(1.15);
    }
}

.star.filled {
    color: var(--star-gold);
}

.star.empty {
    color: var(--star-empty);
}

.star.readonly {
    cursor: default;
}

.star.readonly:hover {
    transform: scale(1);
}

.rating-value {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
}

/* ============================================
   ENLACE A UNTAPPD
   ============================================ */

.untappd-link {
    display: block;
    width: 100%;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    transition: opacity 0.2s, transform 0.2s;
    cursor: pointer;
    border: none;
    margin-top: var(--spacing-sm);
}

.untappd-link:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE - TABLETS
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-sm);
    }

    .header h1 {
        font-size: 1.7rem;
    }

    .breweries-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .stats {
        gap: var(--spacing-sm);
    }

    .stat-item {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

/* ============================================
   RESPONSIVE - MÓVILes
   ============================================ */

@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }

    .search-section {
        flex-direction: row;
        gap: var(--spacing-sm);
    }

    .alphabet-search {
        justify-content: center;
        margin-bottom: var(--spacing-md);
    }

    .text-search,
    .style-search {
        flex: 1;
        max-width: none;
    }

    .brewery-header {
        padding: var(--spacing-sm);
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .brewery-logo {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        min-height: 80px;
    }

    .brewery-info {
        text-align: center;
    }

    .beers-list {
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }

    .beer-item {
        padding: var(--spacing-xs);
    }

    .beer-content {
        gap: var(--spacing-xs);
    }

    .beer-header {
        margin-bottom: var(--spacing-xs);
    }

    .five-stars-badge {
        width: 100px;
        height: 100px;
    }

    .star {
        width: 20px;
        height: 20px;
        font-size: 1rem;
    }

    .stats {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .stat-item {
        width: 100%;
        justify-content: space-between;
    }
}

