/* ====== NAVBAR ====== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--green);
    border-bottom: 2px solid var(--green-dark);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(47, 107, 79, 0.15);
}

.hamburger {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--white);
    cursor: pointer;
    padding: 0.5rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.hamburger:hover {
    opacity: 0.8;
}

.logo {
    font-family: 'Fraunces', Georgia, serif;
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    white-space: nowrap;
}

/* ============================================================ */
/* Zona derecha: busqueda + usuario + carrito                   */
/* ============================================================ */
.header-acciones {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    justify-content: flex-end;
    margin-left: 1rem;
}

.search-bar {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 550px;
    min-width: 280px;
    flex: 1 1 auto;
    margin: 0 0.5rem;
}

.search-bar input {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 0.9rem;
    border: 1px solid transparent;
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--white);
    color: var(--ink);
}

.search-bar input::placeholder {
    color: var(--ink-soft);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--amber);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(217, 118, 46, 0.25);
}

.search-bar button {
    padding: 0.7rem 1.1rem;
    background: var(--amber);
    border: 1px solid var(--amber);
    border-left: none;
    color: var(--white);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    transition: background 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.search-bar button:hover {
    background: var(--amber-dark);
    border-color: var(--amber-dark);
}

.carrito-btn {
    background: var(--white);
    color: var(--green-dark);
    border: none;
    padding: 0.7rem 1.3rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s, transform 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.carrito-btn:hover {
    background: var(--green-tint);
    transform: translateY(-1px);
}

.carrito-btn:active {
    transform: translateY(0);
}

/* ============================================================ */
/* CONTENIDO PRINCIPAL                                          */
/* ============================================================ */
.main-content {
    padding: 2rem;
    margin-top: 80px;
    margin-left: 0;
    transition: margin-left 0.3s;
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================ */
/* FOOTER                                                       */
/* ============================================================ */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    color: var(--ink);
    padding: 3rem 0 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--green-dark);
    font-size: 1.05rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.footer-bottom {
    text-align: center;
    padding: 1.25rem;
    margin-top: 2rem;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.85rem;
}

/* ============================================================ */
/* RESPONSIVE - TABLETS (900px hacia abajo)                     */
/* ============================================================ */
@media (max-width: 900px) {
    .navbar {
        padding: 0.85rem 1rem;
        gap: 0.6rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .header-acciones {
        flex: 0 1 auto;
    }

    .search-bar {
        width: 100%;
        max-width: 400px;
        min-width: 200px;
        margin: 0 0.35rem;
    }

    .search-bar input,
    .search-bar button {
        padding: 0.6rem 0.8rem;
        font-size: 0.88rem;
    }

    .carrito-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* ============================================================ */
/* RESPONSIVE - MOVILES (768px hacia abajo)                     */
/* DOS FILAS:                                                    */
/*   Fila 1: [☰] [Logo] [Ingresar/Usuario] [🛒]                 */
/*   Fila 2: [──────── Buscar... ────────]                      */
/* ============================================================ */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap !important;
        padding: 0.7rem 0.85rem !important;
        gap: 0.4rem !important;
        align-items: center;
    }

    /* Aplanamos header-acciones: sus hijos pasan a ser hijos directos */
    .header-acciones {
        display: contents !important;
    }

    /* -------- Fila 1 -------- */
    .hamburger {
        order: 1 !important;
        padding: 0.3rem !important;
        font-size: 1.3rem !important;
    }

    .logo {
        order: 2 !important;
        font-size: 1.05rem !important;
    }

    /* Ingresar / Usuario */
    .header-btn-login,
    .header-usuario {
        order: 3 !important;
        margin-left: auto !important;
    }

    .header-usuario {
        padding: 4px 4px 4px 10px !important;
        font-size: 0.78rem !important;
        gap: 6px !important;
    }

    .header-usuario-nombre {
        max-width: 90px !important;
    }

    .header-btn-salir {
        padding: 5px 10px !important;
        font-size: 0.72rem !important;
    }

    .header-btn-login {
        padding: 7px 12px !important;
        font-size: 0.8rem !important;
    }

    /* Carrito */
    .carrito-btn {
        order: 3 !important;
        padding: 0.55rem 0.8rem !important;
        font-size: 0.78rem !important;
        white-space: nowrap !important;
    }

    /* -------- Fila 2: búsqueda a lo ancho -------- */
    .search-bar {
        order: 4 !important;
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0.5rem 0 0 0 !important;
    }

    .search-bar input {
        padding: 0.6rem 0.8rem !important;
        font-size: 0.9rem !important;
    }

    .search-bar button {
        padding: 0.6rem 0.9rem !important;
        font-size: 0.85rem !important;
    }
}

/* ============================================================ */
/* RESPONSIVE - MOVILES CHICOS (480px hacia abajo)              */
/* ============================================================ */
@media (max-width: 480px) {
    .navbar {
        padding: 0.6rem 0.7rem !important;
    }

    .logo {
        font-size: 0.95rem !important;
    }

    .header-usuario-nombre {
        max-width: 70px !important;
    }

    .carrito-btn {
        padding: 0.5rem 0.7rem !important;
        font-size: 0.72rem !important;
    }

    .search-bar input {
        padding: 0.55rem 0.7rem !important;
        font-size: 0.85rem !important;
    }

    .search-bar button {
        padding: 0.55rem 0.75rem !important;
        font-size: 0.8rem !important;
    }
}

.footer-frase {
    text-align: center;
    font-style: italic;
    font-family: 'Fraunces', Georgia, serif;
    color: var(--green-dark);
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid var(--line);
    font-size: 0.95rem;
    line-height: 1.5;
}

.footer-frase p {
    margin: 0;
}