:root {
    --primary: #0078d7;
    --primary-dark: #005a9e;
    --secondary: #6c757d;
    --light: #f8f9fa;
    --dark: #343a40;
    --border: #dee2e6;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.4;
    overflow-x: hidden;
}


.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}


.logo-text .tagline {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
    color: white;
}

/* BUSCADOR HEADER ORIGINAL */
.buscador-header {
    display: flex;
    gap: 0.5rem;
    margin: 0 1rem;
    flex: 1;
    max-width: 500px;
}

.buscador-container {
    position: relative;
    flex: 1;
}

.buscador-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 0.9rem;
    background: white;
    transition: all 0.3s ease;
}

.buscador-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.1);
}

.buscador-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.buscador-btn {
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.buscador-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* NAV SECTION ORIGINAL */
.nav-section {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.nav-btn {
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-btn.tiendas-btn {
    background: white;
    color: black;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-btn.tiendas-btn:hover {
    background: #f8f9fa;
    color: black;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-btn.cta-btn {
    background: white;
    color: var(--primary);
    position: relative;
    overflow: hidden;
}

.nav-btn.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ESTRUCTURA PRINCIPAL */
.contenedor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-bottom: 2rem;
}

/* TOGGLE CATEGORÍAS MÓVIL */
.categorias-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    margin: 0 auto;
    width: 100%;
    max-width: 300px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.categorias-toggle:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* CATEGORÍAS MÓVIL */
.categorias-mobile {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    display: none;
    width: 100%;
}

.categorias-mobile.active {
    display: block;
}

.categorias-mobile h3 {
    margin: 0 0 0.8rem 0;
    color: var(--primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.categorias-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.categorias-list li {
    padding: 0.7rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 40px;
}

.categorias-list li:hover {
    background: #f8f9fa;
    border-color: var(--primary);
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.categoria-nombre {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: #333;
}

/* Botón de todas las categorías */
.todas-categorias-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.todas-categorias-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* FILTRO DE CIUDADES */
.filtro-ciudad {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #f1f3f4;
    width: 100%;
}

.filtro-ciudad h3 {
    margin: 0 0 0.8rem 0;
    color: var(--primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ciudades-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.ciudades-list li {
    padding: 0.7rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 40px;
}

.ciudades-list li:hover {
    background: #f8f9fa;
    border-color: var(--primary);
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ciudades-list li.ciudad-activa {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.ciudad-contador {
    background: #6c757d;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
    margin-left: 0.5rem;
    font-weight: 600;
}

.ciudades-list li.ciudad-activa .ciudad-contador {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.ciudad-nombre {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.ciudades-list li.ciudad-activa .ciudad-nombre {
    color: white;
}

.limpiar-ciudad {
    width: 100%;
    padding: 0.7rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 0.8rem;
    transition: all 0.3s ease;
    font-weight: 600;
}

.limpiar-ciudad:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* CONTENIDO PRINCIPAL */
.main-content {
    width: 100%;
}

/* TÍTULO DE SECCIÓN */
.titulo-seccion {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.titulo-seccion h2 {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.titulo-seccion p {
    color: var(--secondary);
    font-size: 0.85rem;
    margin-top: 0.3rem;
    margin-bottom: 0;
}

/* GRID DE TIENDAS - OPTIMIZADO PARA 2 POR FILA EN MÓVIL */
.tiendas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    padding: 0;
    width: 100%;
}

/* TARJETAS - COMPACTAS Y AUTO-AJUSTABLES */
.tarjeta {
    background: white;
    border-radius: 10px;
    padding: 0.8rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 320px;
    position: relative;
    overflow: hidden;
}

.tarjeta:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.12);
}

.contenido-flexible {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.6rem;
}

/* LOGO - SIN RECUADRO, SOLO CON BORDES REDONDEADOS */
.logo-container {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.6rem auto;
    background: transparent;
    border-radius: 8px;
    padding: 0;
    flex-shrink: 0;
}

.tarjeta img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.placeholder-logo {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

/* CONTENIDO TARJETA - COMPACTO */
.nombre-tienda {
    color: var(--dark);
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
    text-transform: uppercase;
}

.rubro {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    text-align: center;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 120, 215, 0.1);
    border-radius: 12px;
    display: inline-block;
    align-self: center;
}

.localidad {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.descripcion {
    color: var(--secondary);
    font-size: 0.75rem;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    min-height: 40px;
    position: relative;
    word-wrap: break-word;
    padding: 0.3rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ENVÍOS Y PAGOS - COMPACTO */
.envios-pagos-info {
    margin: 0.5rem 0;
    padding: 0.6rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 2px solid #0078d7;
}

.envios-pagos-info h4 {
    margin: 0 0 0.4rem 0;
    font-size: 0.8rem;
    color: #495057;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.envios-pagos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3rem;
}

.envio-item, .pago-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-size: 0.65rem;
    transition: all 0.2s ease;
}

.envio-item:hover, .pago-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.envio-item {
    border-left: 2px solid #0078d7;
}

.pago-item {
    border-left: 2px solid #28a745;
}

.envio-item i, .pago-item i {
    font-size: 0.65rem;
    width: 12px;
    text-align: center;
}

.envio-gratis {
    color: #28a745;
    font-weight: 600;
    font-size: 0.6rem;
    margin-left: auto;
}

.no-info {
    color: #6c757d;
    font-style: italic;
    font-size: 0.7rem;
    text-align: center;
    padding: 0.3rem;
}

/* ACCIONES */
.acciones {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: auto;
}

.ver-tienda {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
}

.ver-tienda:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* TARJETAS DESTACADAS - COMPACTO */
.tarjeta-destacada {
    background: linear-gradient(135deg, #fff9e6 0%, #ffeb99 100%);
    border: 1px solid #FFD700;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.tarjeta-destacada::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
}

.badge-destacado {
    position: absolute;
    top: 6px;
    right: 6px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #8B6914;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: bold;
    box-shadow: 0 1px 4px rgba(255, 215, 0, 0.4);
    z-index: 2;
    animation: brillo 2s infinite alternate;
}

@keyframes brillo {
    from {
        box-shadow: 0 1px 4px rgba(255, 215, 0, 0.4);
    }
    to {
        box-shadow: 0 1px 8px rgba(255, 215, 0, 0.6), 0 0 12px rgba(255, 215, 0, 0.3);
    }
}

.tarjeta-destacada .nombre-tienda {
    color: #B8860B;
    font-weight: bold;
}

.tarjeta-destacada .rubro {
    background: rgba(255, 215, 0, 0.2);
    color: #8B6914;
    text-align: center;
}

.tarjeta-destacada .localidad {
    color: #8B6914;
    font-weight: 500;
}

/* CATEGORÍAS DESKTOP - OCULTAS EN MÓVIL */
.categorias-desktop {
    display: none;
}

/* ========== RESPONSIVE ========== */

/* TABLET (768px - 1024px) */
@media (min-width: 768px) {
    .contenedor {
        flex-direction: row;
        gap: 1.5rem;
    }
    
    .categorias-desktop {
        display: block;
        background: white;
        padding: 1.2rem;
        border-radius: 10px;
        box-shadow: var(--shadow);
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 20px;
        height: fit-content;
    }
    
    .categorias-toggle {
        display: none;
    }
    
    .categorias-mobile {
        display: none !important;
    }
    
    .tiendas-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.2rem;
    }
    
    .tarjeta {
        min-height: 350px;
        padding: 1rem;
    }
    
    .logo-container {
        height: 110px;
    }
    
    .nombre-tienda {
        font-size: 1rem;
    }
    
    .envios-pagos-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
   
    
    .buscador-header {
        order: 3;
        margin: 1rem 0 0 0;
        max-width: 100%;
    }
}

/* DESKTOP (1024px+) */
@media (min-width: 1024px) {
    .tiendas-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.5rem;
    }
    
    .tarjeta {
        min-height: 380px;
        padding: 1.2rem;
    }
    
    .logo-container {
        height: 120px;
    }
    
    .nombre-tienda {
        font-size: 1.1rem;
    }
    
 
    .buscador-header {
        order: 2;
        margin: 0 1rem;
        max-width: 500px;
    }
}

/* MÓVIL (hasta 767px) */
@media (max-width: 767px) {
    
    
    .logo-link {
        justify-content: center;
    }
    
    .nav-section {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .buscador-header {
        width: 100%;
        margin: 0;
    }
}

/* MÓVIL PEQUEÑO (hasta 480px) */
@media (max-width: 480px) {
    .tiendas-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .tarjeta {
        min-height: 300px;
        padding: 0.6rem;
    }
    
    .logo-container {
        height: 80px;
        margin-bottom: 0.5rem;
    }
    
    .nombre-tienda {
        font-size: 0.85rem;
        height: 2.2em;
    }
    
    .rubro {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }
    
    .localidad {
        font-size: 0.7rem;
    }
    
    .descripcion {
        font-size: 0.7rem;
        min-height: 35px;
        -webkit-line-clamp: 2;
    }
    
    .ver-tienda {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .envios-pagos-info {
        padding: 0.5rem;
        margin: 0.3rem 0;
    }
    
    .envios-pagos-info h4 {
        font-size: 0.75rem;
    }
    
    .envio-item, .pago-item {
        padding: 0.25rem 0.4rem;
        font-size: 0.6rem;
    }
}

/* RESULTADOS BÚSQUEDA */
.resultados-info {
    background: #e8f4fd;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
}

.resultados-info h3 {
    margin: 0 0 0.4rem 0;
    color: var(--primary);
    font-size: 1rem;
}

.resultados-info p {
    margin: 0;
    color: #495057;
    font-size: 0.85rem;
}

.limpiar-busqueda {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--secondary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
}

.limpiar-busqueda:hover {
    background: #dc3545;
}

/* FOOTER */
.footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    font-size: 0.85rem;
}