/* 
   css/style.css
   Wrapito PWA Base Styles
   Mobile First Approach
*/

:root {
    /* Paleta de colores solicitada */
    --primary-color: #f76e08;      /* Naranja para botones (CTA) */
    --primary-hover: #e06004;      
    --accent-color: #69851f;       /* Verde para acentos */
    --bg-color: #ffffff;           /* Fondo blanco */
    
    /* Colores neutros */
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #e5e5e5;
    --modal-overlay: rgba(0, 0, 0, 0.4);
    
    /* Tipografía */
    --font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Mejora en móviles */
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 16px;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
}

/* ==========================================================================
   Header (Sticky)
   ========================================================================== */
.header {
    background-color: var(--bg-color);
    padding: 12px 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}

.header.sticky {
    position: sticky;
    top: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); /* Sombra sutil */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Logo */
.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color); /* Acento verde para el logo */
    letter-spacing: -0.5px;
}

/* Nav Links (Ocultos en móviles, enfocados al diseño mobile-first) */
.main-nav {
    display: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    margin: 0 12px;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   Botones
   ========================================================================== */
.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px; /* Bordes redondeados modernos */
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 6px rgba(247, 110, 8, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.96);
}

.btn-block {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 1.05rem;
    margin-top: 20px;
}

/* ==========================================================================
   Secciones Principales (Hero y Menú)
   ========================================================================== */
.main-content {
    min-height: calc(100vh - 65px);
    padding-bottom: 40px;
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #ffffff;
    padding: 40px 20px;
    text-align: center;
    border-radius: 0 0 24px 24px;
    margin-bottom: 32px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.banner-content h1 {
    font-size: 2.2rem;
    margin-bottom: 12px;
    color: #ffffff;
}

.banner-content p {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Sección de Menú */
.menu-section {
    padding: 0 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 24px;
    text-align: center;
}

/* Cuadrícula de Menú (CSS Grid) */
.menu-grid {
    display: grid;
    /* Grid responsivo: mínimo 280px por tarjeta, máximo lo que de la pantalla */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Tarjeta de Producto */
.product-card {
    background-color: var(--bg-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* Placeholder de Imagen */
.card-image-placeholder {
    width: 100%;
    height: 180px;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Contenido de la Tarjeta */
.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1; /* Permite que el footer empuje hacia abajo si las descripciones tienen diferentes alturas */
}

.product-title {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.product-ingredients {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
    flex: 1; /* Empuja el footer hacia abajo */
}

/* Footer de la Tarjeta */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-color);
}

.btn-add-cart {
    padding: 8px 18px;
    font-size: 0.9rem;
}

/* ==========================================================================
   Modal de Login/Registro
   ========================================================================== */
.modal {
    display: none; /* Controlado por JS */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    align-items: flex-end; /* Mobile-first: Modal estilo bottom sheet */
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-color);
    width: 100%;
    padding: 32px 24px 40px; /* Padding extra abajo para móviles */
    border-radius: 24px 24px 0 0; /* Curvas arriba solo */
    position: relative;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Transición suave */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-content h2 {
    color: var(--accent-color);
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* Input Group (Teléfono) */
.input-group {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--bg-color);
    transition: border-color 0.2s ease;
}

.input-group:focus-within {
    border-color: var(--primary-color);
}

.prefix-phone {
    padding: 14px 16px;
    background-color: #f7f7f7;
    color: var(--text-main);
    font-weight: 600;
    border-right: 1px solid var(--border-color);
    font-size: 1rem;
}

input[type="tel"] {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--font-family);
    background: transparent;
    outline: none;
    color: var(--text-main);
    width: 100%;
}

input[type="tel"]::placeholder {
    color: #a0a0a0;
}

/* ==========================================================================
   Media Queries (Escritorio / Tablets Grandes)
   ========================================================================== */
@media (min-width: 768px) {
    /* Mostrar navegación en pantallas grandes */
    .main-nav {
        display: flex;
        align-items: center;
    }
    
    /* El modal se centra en pantallas grandes en lugar de estar abajo */
    .modal {
        align-items: center;
    }
    
    .modal-content {
        max-width: 420px;
        border-radius: 20px;
        transform: scale(0.9) translateY(0);
        padding: 40px 30px;
    }
    
    .modal.show .modal-content {
        transform: scale(1) translateY(0);
    }
}
