/* =========================================
   GALOPER BRANDING - SYSTEM DESIGN
   Cliente: Coelho Conecta
   Versión: Mobile First 2.0
   ========================================= */

:root {
    /* PALETA DE COLORES */
    --brand-magenta: #B0008E;  /* Color Principal */
    --brand-black: #111111;
    --brand-grey: #F8F8F8;     /* Fondo General */
    --bg-card: #FFFFFF;
    
    /* TIPOGRAFÍA & TEXTO */
    --text-main: #1F1F1F;
    --text-muted: #6B7280;
    --font: 'Inter', sans-serif;
    
    /* UI VALUES */
    --radius-card: 16px;
    --radius-img: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* RESET BÁSICO */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--brand-grey);
    font-family: var(--font);
    color: var(--text-main);
    padding-top: 70px; /* Compensa el navbar fixed */
    padding-bottom: 80px;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   1. NAVBAR (SOLUCIÓN AL ERROR)
   ========================================= */
.navbar {
    background-color: #ffffff;
    width: 100%;
    height: 70px; /* Altura fija para evitar colapsos */
    padding: 0 5%;
    
    /* FLEXBOX OBLIGATORIO */
    display: flex;
    flex-direction: row; /* Fuerza fila horizontal */
    justify-content: space-between;
    align-items: center;
    
    /* FIJACIÓN (Fixed para que siempre esté visible al hacer scroll) */
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000; /* Capa superior asegurada */
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Contenedor del Logo */
.logo-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Evita que el logo se aplaste */
    height: 100%;
}

.brand-logo {
    height: 38px; /* Tamaño controlado */
    width: auto;
    display: block;
}

/* Contenedor de Filtros (Scroll horizontal) */
.filters-container {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    margin-left: 15px;
    
    /* Scroll invisible para que quepan */
    overflow-x: auto;
    white-space: nowrap;
    -ms-overflow-style: none;  /* IE */
    scrollbar-width: none;  /* Firefox */
}

.filters-container::-webkit-scrollbar { display: none; } /* Chrome */

.filter-btn {
    background: transparent;
    border: 1px solid #E5E7EB;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--brand-magenta);
    color: #fff;
    border-color: var(--brand-magenta);
    box-shadow: 0 4px 10px rgba(176, 0, 142, 0.25);
}

/* =========================================
   2. HEADER & HERO
   ========================================= */
.hero-header {
    padding: 3rem 1.5rem 2.5rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.04em;
    color: var(--brand-black);
    line-height: 1.1;
}

.hero-header p {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
}

/* =========================================
   3. GRID SYSTEM (ESCRITORIO)
   ========================================= */
.grid-container {
    display: grid;
    /* Escritorio: Tarjetas mínimas de 260px */
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
    padding: 0 5%;
    max-width: 1400px;
    margin: 0 auto;
}

/* =========================================
   4. TARJETAS (CARD DESIGN)
   ========================================= */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.03);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(176, 0, 142, 0.15);
}

/* Imagen "Sandwich" */
.card-img-wrapper {
    padding: 10px;
    height: 240px;
    width: 100%;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-img);
    background-color: #f3f4f6;
}

/* Cuerpo de Info */
.card-body {
    padding: 0.5rem 1.2rem 1.2rem;
    flex-grow: 1;
}

.cat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--brand-magenta);
    margin-bottom: 5px;
    display: block;
    letter-spacing: 0.05em;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--brand-black);
}

/* Datos Meta */
.card-meta {
    padding: 0.8rem 1.2rem;
    border-top: 1px solid #F3F4F6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.min-order { color: var(--brand-black); font-weight: 700; }

/* Botón Footer */
.card-link {
    padding: 1rem;
    border-top: 1px solid #F3F4F6;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.card-link:hover {
    background-color: #FFF0FA;
    color: var(--brand-magenta);
}

/* =========================================
   5. FOOTER DE PAGINA
   ========================================= */
.footer {
    text-align: center;
    padding: 4rem 1rem 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.03);
}

.galoper-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 800;
}
.galoper-link:hover {
    color: var(--brand-magenta);
    text-decoration: underline;
}

/* =========================================
   6. MOBILE OPTIMIZATION (VERSIÓN APP)
   ========================================= */
@media (max-width: 768px) {
    
    /* --- NAVBAR APP STYLE (Logo Arriba, Botones Abajo) --- */
    .navbar {
        height: auto; /* Dejar que crezca verticalmente */
        padding: 1rem 0; /* Padding arriba/abajo */
        flex-direction: column; /* APILAR ELEMENTOS */
        gap: 12px; /* Espacio entre Logo y Botones */
        align-items: center; /* Todo centrado */
        position: fixed; /* Siempre visible en mobile */
        top: 0;
        left: 0;
    }

    body {
        padding-top: 110px; /* Compensa navbar más alto en mobile */
    }

    .logo-wrapper {
        width: 100%;
        display: flex;
        justify-content: center; /* Logo perfectamente centrado */
    }

    .brand-logo { 
        height: 40px; /* Logo un poco más grande y protagonista */
    }
    
    .filters-container {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start; /* Alineación natural del scroll */
        padding: 0 1rem; /* Espacio a los costados para que no toque bordes */
        
        /* Aseguramos que se pueda scrollear si hay muchos botones */
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; /* Scroll suave en iPhone */
    }

    /* Ajuste visual de los botones en móvil */
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
        background-color: #f9f9f9; /* Fondo ligero para que parezcan botones táctiles */
    }
    
    .filter-btn.active {
        background-color: var(--brand-magenta);
        color: #fff;
    }
    
    /* --- HEADER RESUMIDO --- */
    .hero-header { 
        padding: 1.5rem 1rem 1rem; /* Menos espacio, más contenido */
    }
    
    .hero-header h1 { 
        font-size: 1.8rem; /* Título grande pero que no ocupe toda la pantalla */
        line-height: 1.1;
    }
    
    .hero-header p {
        font-size: 0.9rem; /* Texto legible y directo */
        margin-top: 8px;
    }

    /* --- GRILLA 2x2 (MANTENEMOS LO QUE FUNCIONA) --- */
    .grid-container {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
        padding: 0 1rem;
    }

    /* Ajuste tarjetas */
    .card-img-wrapper { height: 140px; padding: 6px; }
    .card-body { padding: 0.5rem 0.8rem 0.8rem; }
    
    .card-title {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .cat-label { display: none; } /* Limpiamos ruido visual */

    .card-meta {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 0.8rem 0.5rem;
        font-size: 0.7rem;
    }

    /* Botón de Cotizar "Limpio" */
    .card-link {
        padding: 0.6rem;
        font-size: 0.8rem;
        justify-content: center;
    }
    .card-link span { display: none; }
    .card-link::after { content: "Cotizar"; }
}

/*Estilos generales del boton whatsapp*/
.whatsapp-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  animation: breathe 2s ease-in-out infinite;
  }
  
  /*Estilos solo al icono whatsapp*/
  .whatsapp-btn i {
  color: #fff;
  font-size: 24px;
  animation: beat 2s ease-in-out infinite;
  text-decoration: none;
  }

  /*Estilos con animation contorno respirando*/
  @keyframes breathe {
    0% {
      box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    }
    70% {
      box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
    }
    
    /*Estilos de animacion del icono latiendo*/
    @keyframes beat {
    0% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.2);
    }
    100% {
      transform: scale(1);
    }
    }
