/* ============================================
   TIENDAS ALIADAS - ESTILOS COMPLETOS
   Catálogo + Página individual + Panel Admin
   ============================================ */

/* ============================================
   1. CATÁLOGO DE TIENDAS (public/tiendas.php)
   ============================================ */

.tiendas-filtros-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 0.75rem;
    align-items: end;
}

.tiendas-filtro-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.tiendas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tienda-card {
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}
.tienda-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.tienda-card-cover {
    height: 120px;
    overflow: hidden;
    background: #f1f5f9;
}
.tienda-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tienda-card-cover-placeholder {
    height: 120px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 3rem;
}

.tienda-card-body {
    padding: 1.25rem;
}

.tienda-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.tienda-card-logo {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.tienda-card-logo-placeholder {
    width: 50px;
    height: 50px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.tienda-card-name {
    margin: 0;
    font-size: 1.1rem;
    color: #1e293b;
}

.tienda-card-desc {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.tienda-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}
.tienda-card-footer small {
    color: #64748b;
}

/* ============================================
   2. PÁGINA INDIVIDUAL DE TIENDA (public/tienda.php)
   Banner ancho completo + Franja azul sin fondo extra
   ============================================ */

/* ===== HERO - CONTENEDOR PRINCIPAL ===== */
.store-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    overflow: hidden;
    background: #1e40af;
}

/* ===== BANNER (Imagen de portada) ===== */
.store-hero-cover {
    width: 100%;
    height: 300px;
    position: relative;
    overflow: hidden;
}
.store-hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== FRANJA AZUL (Información de la tienda) ===== */
.store-hero-content {
    width: 100%;
    background: linear-gradient(135deg, #1e40af, #3b82f6) !important;
    color: #fff;
    padding: 2rem 1rem 2.5rem;
    position: relative;
    border: none !important;
    box-shadow: none !important;
}

/* ✅ Quitar fondo del container dentro del hero */
.store-hero-content.container,
.store-hero-content .container,
.store-hero-content[class*="container"] {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

.store-hero-inner {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: transparent !important;
}

/* Logo que sobresale entre el banner y la franja */
.store-logo-wrap {
    width: 140px;
    height: 140px;
    border-radius: 20px;
    border: 5px solid #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    flex-shrink: 0;
    margin-top: -90px;
    position: relative;
    z-index: 2;
}
.store-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-info {
    flex: 1;
    min-width: 280px;
    background: transparent !important;
}

.store-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.store-name {
    margin: 0.5rem 0;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
}

.store-description {
    opacity: 0.95;
    max-width: 700px;
    line-height: 1.6;
    margin: 0.5rem 0 1rem;
    color: #fff;
}

/* ===== CONTACTO Y REDES EN UNA SOLA FILA ===== */
.store-contact-grid {
    display: inline-flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    vertical-align: middle;
    background: transparent !important;
}

.store-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.45rem 0.9rem;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    transition: background 0.2s, transform 0.2s;
}
.store-contact-item:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.store-social {
    display: inline-flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
    margin-left: 1rem;
    flex-wrap: wrap;
    vertical-align: middle;
    background: transparent !important;
}
.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.social-btn.facebook { background: #1877F2; }
.social-btn.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-btn.tiktok { background: #000; }

/* ===== OVERLAY (Oculto) ===== */
.store-hero-overlay {
    display: none;
}

/* ============================================
   3. GRID DE PRODUCTOS PROFESIONAL
   ============================================ */

.products-section {
    padding: 3rem 0;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.products-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.products-count {
    background: #1e40af;
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.products-hours {
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.product-card {
    background: #fff;
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}
.product-card:hover {
    transform: scale(1.08) translateY(-8px);
    box-shadow: 0 20px 40px rgba(30, 64, 175, 0.25);
    z-index: 10;
    border-color: #3b82f6;
}

.product-image-wrap {
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
    border-radius: 16px 16px 0 0;
}
.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.product-card:hover .product-image-wrap img {
    transform: scale(1.1);
}
.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #cbd5e1;
}

.product-stock-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #059669;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 2;
}
.product-stock-badge.low {
    color: #dc2626;
    background: rgba(254, 226, 226, 0.95);
}

.product-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    min-height: 2.4em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.3s;
}
.product-card:hover .product-name {
    -webkit-line-clamp: unset;
    min-height: auto;
}

.product-description {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0 0 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.7;
    max-height: 2.8em;
    transition: all 0.3s;
}
.product-card:hover .product-description {
    -webkit-line-clamp: unset;
    max-height: 500px;
    opacity: 1;
}

.product-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.product-price {
    color: #059669;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.product-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    background: #25D366;
    color: #fff !important;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}
.product-whatsapp-btn:hover {
    background: #1ea855;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.5);
}
.product-card:hover .product-whatsapp-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* ============================================
   4. PANEL ADMIN DE TIENDAS (admin/tiendas.php)
   ============================================ */

.admin-store-header-card {
    margin-bottom: 1.5rem;
}
.admin-store-header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}
.admin-store-logo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}
.admin-store-info {
    flex: 1;
}
.admin-store-name {
    margin: 0;
}
.admin-ubicacion-cell {
    color: #64748b;
}

.admin-product-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}
.admin-product-thumb-placeholder {
    width: 60px;
    height: 60px;
    background: #f1f5f9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-product-desc-preview {
    font-size: 0.8rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-price {
    color: #059669;
}

.admin-redes-box {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}
.admin-redes-box .form-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
}
.admin-redes-label {
    font-size: 0.85rem;
}

.admin-img-preview {
    max-width: 200px;
    border-radius: 8px;
}

.admin-store-subtitle {
    display: block;
    margin-top: 0.25rem;
}

/* ============================================
   5. RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .tiendas-filtros-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}
@media (max-width: 550px) {
    .tiendas-filtros-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 1100px) {
    .products-grid { grid-template-columns: repeat(4, 1fr); }
    .store-name { font-size: 1.8rem; }
}
@media (max-width: 900px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .store-name { font-size: 1.5rem; }
    .store-logo-wrap { width: 100px; height: 100px; margin-top: -60px; }
    .store-hero-cover { height: 220px; }
}
@media (max-width: 600px) {
    .store-contact-grid,
    .store-social {
        display: flex;
        width: 100%;
        margin-left: 0;
    }
    .store-social {
        margin-top: 0.5rem;
    }
}
@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr; }
    .store-hero-cover { height: 180px; }
}

/* ===== EVITAR SCROLL HORIZONTAL ===== */
body {
    overflow-x: hidden;
}