/**
 * HOME2.CSS - Estilos para la nueva versión del Home
 * 
 * Diseño: Product-First Approach
 * - Productos visibles inmediatamente
 * - Barra de ubicación compacta (no bloqueante)
 * - Categorías como chips/iconos
 * - CTAs prominentes
 */

/* Variables */
:root {
    --home2-primary: #F47B6C;
    --home2-primary-dark: #E06A5B;
    --home2-primary-light: #FFF5F3;
    --home2-text-primary: #1A1918;
    --home2-text-secondary: #666666;
    --home2-text-tertiary: #999999;
    --home2-bg-primary: #FFFFFF;
    --home2-bg-secondary: #FAFAFA;
    --home2-border: #E5E5E5;
    --home2-shadow: rgba(0, 0, 0, 0.08);
    --home2-radius-sm: 8px;
    --home2-radius-md: 12px;
    --home2-radius-lg: 16px;
    --home2-radius-xl: 24px;
}

/* Utilidad: oculto visual pero presente para SEO/lectores */
.home2-visually-hidden{
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ========================================
   BARRA DE UBICACIÓN
   ======================================== */
.home2-location-bar {
    background: var(--home2-primary-light);
    padding: 6px 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.location-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.location-icon {
    color: var(--home2-primary);
    flex-shrink: 0;
}

.location-text {
    font-size: 12px;
    color: var(--home2-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-text strong {
    font-weight: 600;
}

.location-hint{
    font-size: 10px;
    color: var(--home2-text-secondary);
    background: rgba(255,255,255,0.7);
    padding: 1px 6px;
    border-radius: 999px;
    flex-shrink: 0;
}

.location-change-btn {
    background: var(--home2-primary);
    border: 1px solid rgba(0,0,0,0.06);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--home2-radius-sm);
    transition: background 0.2s;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(244, 123, 108, 0.30);
}

.location-change-btn:hover {
    background: var(--home2-primary-dark);
}

/* ========================================
   HERO / CARRUSEL PROMOCIONAL
   ======================================== */
.home2-hero {
    margin-bottom: 0;
}

.home2-hero .promo-carousel {
    position: relative;
    overflow: hidden;
}

.home2-hero .promo-track {
    position: relative;
    display: flex;
    width: 100%;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    transition: transform 520ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.home2-hero .promo-slide {
    display: block;
    width: 100%;
    flex: 0 0 100%;
}

.home2-hero .promo-slide.active {
    /* Se mantiene para estado/dots, no para layout */
}

.home2-hero .promo-slide img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .home2-hero .promo-track {
        transition: none;
    }
}

/* Desktop: hero más grande (sin afectar mobile) */
@media (min-width: 1024px) {
    .home2-hero .promo-carousel{
        height: clamp(420px, 52vh, 620px);
    }
    .home2-hero .promo-slide,
    .home2-hero .promo-slide picture{
        display:block;
        height: 100%;
    }
    .home2-hero .promo-slide img{
        height: 100%;
        max-height: none;
        object-fit: cover;
    }
}

.home2-hero .promo-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    color: var(--home2-text-primary);
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px var(--home2-shadow);
    transition: all 0.2s;
}

.home2-hero .promo-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.05);
}

.home2-hero .promo-nav-left {
    left: 12px;
}

.home2-hero .promo-nav-right {
    right: 12px;
}

.home2-hero .promo-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.home2-hero .promo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.home2-hero .promo-dot.active {
    background: #fff;
    width: 24px;
    border-radius: 4px;
}

/* ========================================
   CATEGORÍAS (estilo app)
   ======================================== */
.home2-categories {
    padding: 20px 0 12px;
    background: var(--home2-bg-primary);
}

.home2-categories .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--home2-text-primary);
    margin: 0 0 12px;
}

.categories-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.categories-list::-webkit-scrollbar {
    display: none;
}

.home2-category-card {
    width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s;
    flex-shrink: 0;
}

/* Scroller de categorías con flechas (1 sola fila siempre) */
.home2-categories-scroller{
    position: relative;
}

.home2-categories-nav{
    position: absolute;
    top: 34px; /* centrado visual con chips */
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.92);
    color: var(--home2-text-primary);
    box-shadow: 0 4px 14px var(--home2-shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    z-index: 2;
}

.home2-categories-nav:hover{
    background: #fff;
}

.home2-categories-nav-left{ left: -6px; }
.home2-categories-nav-right{ right: -6px; }

/* Desktop: asegurar que NO haga wrap, siempre 1 fila */
@media (min-width: 1024px) {
    .categories-list{
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0 22px 8px; /* espacio para flechas */
    }
}

@media (max-width: 1023px) {
    .categories-list{
        padding: 0 18px 8px; /* espacio para flechas */
    }
}

.home2-category-card:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.home2-category-image {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--home2-bg-secondary);
    box-shadow: 0 2px 8px var(--home2-shadow);
    margin-bottom: 8px;
}

.home2-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home2-category-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--home2-text-primary);
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   PRODUCTOS
   ======================================== */
.home2-products,
.home2-offers {
    padding: 20px 0;
    background: var(--home2-bg-primary);
}

.home2-products .container,
.home2-offers .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.see-all-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--home2-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.see-all-link:hover {
    color: var(--home2-primary-dark);
    text-decoration: none;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* San Valentín: 6 en móvil, 8 en desktop */
.home2-products-grid--sv .product-card { display: none; }

@media (max-width: 767px) {
    .home2-products-grid--sv .product-card:nth-child(-n+6) { display: block; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .home2-products-grid--sv .product-card:nth-child(-n+6) { display: block; }
}

@media (min-width: 1024px) {
    .home2-products-grid--sv .product-card:nth-child(-n+8) { display: block; }
}

/* =========================================================
   HOME2: Mostrar 8 productos también en móvil
   (8 en "Más Vendidos" + 8 en "Más Arreglos")
   ========================================================= */
.home2-products-grid--fixed-rows .product-card { display: block; }

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.product-card {
    background: var(--home2-bg-primary);
    border-radius: var(--home2-radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 8px var(--home2-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--home2-shadow);
}

.product-link {
    display: block;
    text-decoration: none;
}

.product-link:hover {
    text-decoration: none;
}

.product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--home2-bg-secondary);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--home2-text-primary);
    margin: 0 0 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--home2-primary);
    margin: 0;
}

.product-price-row{
    display:flex;
    align-items:baseline;
    gap:8px;
    flex-wrap:wrap;
}

.product-price-original{
    font-size: 12px;
    color: var(--home2-text-tertiary);
    text-decoration: line-through;
    font-weight: 600;
}

/* Nota: se eliminó el botón flotante “+” para evitar ruido visual.
   Toda la tarjeta es clickeable al detalle del producto. */

/* ========================================
   CTA PRINCIPAL
   ======================================== */
.main-cta {
    margin-top: 24px;
    text-align: center;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--home2-primary);
    color: #fff;
    padding: 14px 32px;
    border-radius: var(--home2-radius-lg);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(244, 123, 108, 0.4);
}

.cta-button:hover {
    background: var(--home2-primary-dark);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 123, 108, 0.5);
}

/* ========================================
   TRUST BADGES
   ======================================== */
.home2-trust {
    padding: 24px 0;
    background: var(--home2-bg-secondary);
}

.home2-trust .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.trust-icon {
    color: var(--home2-primary);
}

.trust-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--home2-text-secondary);
    text-align: center;
}

/* ========================================
   RESEÑAS (carrusel horizontal)
   ======================================== */
.home2-reviews {
    padding: 24px 0;
    background: var(--home2-bg-primary);
    --home2-reviews-duration: 85s; /* más lento */
}

.home2-reviews .container {
    max-width: none; /* full width */
    width: 100%;
    margin: 0;
    padding: 0;
}

.home2-reviews-header{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:12px;
    margin-bottom: 12px;
    padding: 0 16px; /* solo el header respira */
}

.home2-reviews-meta{
    display:flex;
    align-items:center;
    gap:8px;
}

.stars {
    font-size: 14px;
}

.rating-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--home2-text-secondary);
}

.home2-reviews-marquee{
    position: relative;
    overflow: hidden;
    width: 100%;
}

.home2-reviews-track{
    display:flex;
    gap:12px;
    width: max-content;
    will-change: transform;
    animation: home2ReviewsScroll var(--home2-reviews-duration, 85s) linear infinite;
    padding: 0 8px; /* evita que la primera tarjeta se pegue al borde */
}

.home2-reviews-marquee:hover .home2-reviews-track,
.home2-reviews-marquee:focus-within .home2-reviews-track{
    animation-play-state: paused;
}

.home2-review-card{
    width: 280px;
    flex: 0 0 auto;
    background: var(--home2-primary-light);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--home2-radius-lg);
    padding: 14px 14px 12px;
    box-shadow: 0 2px 10px var(--home2-shadow);
}

.home2-review-text{
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--home2-text-primary);
}

.home2-review-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}

.home2-review-author{
    font-size: 12px;
    font-weight: 700;
    color: var(--home2-text-primary);
    margin: 0;
}

.home2-review-city{
    font-size: 11px;
    font-weight: 600;
    color: var(--home2-text-secondary);
    margin: 0;
    white-space: nowrap;
}

.home2-review-time{
    font-size: 10px;
    color: var(--home2-text-tertiary);
    margin: 0;
    white-space: nowrap;
}

@keyframes home2ReviewsScroll{
    from { transform: translate3d(0,0,0); }
    to { transform: translate3d(-50%,0,0); }
}

@media (prefers-reduced-motion: reduce) {
    .home2-reviews-track{
        animation: none;
        transform: none;
    }
    .home2-reviews-marquee{
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .home2-reviews-marquee::-webkit-scrollbar{ display:none; }
}

/* ========================================
   CTA FINAL
   ======================================== */
.home2-final-cta {
    padding: 32px 0;
    background: var(--home2-bg-primary);
}

.home2-final-cta .container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 16px;
    text-align: center;
}

.cta-button-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--home2-primary);
    color: #fff;
    padding: 18px 32px;
    border-radius: var(--home2-radius-lg);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(244, 123, 108, 0.4);
}

.cta-button-large:hover {
    background: var(--home2-primary-dark);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 123, 108, 0.5);
}

.cta-trust-line {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.cta-trust-line span {
    font-size: 12px;
    color: var(--home2-text-secondary);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 767px) {
    .home2-hero .promo-nav {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .home2-hero .promo-nav-left {
        left: 8px;
    }
    
    .home2-hero .promo-nav-right {
        right: 8px;
    }
    
    .trust-badges {
        gap: 16px;
    }
    
    .trust-badge {
        min-width: 70px;
    }
    
    .cta-trust-line {
        gap: 12px;
    }
    
    .cta-trust-line span {
        font-size: 11px;
    }

    .home2-review-card{ width: 240px; }
}

/* ========================================
   ANIMACIONES
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.4s ease-out;
    animation-fill-mode: both;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

/* ========================================
   OCULTAR ELEMENTOS DEL HOME ORIGINAL
   ======================================== */
.location-form-section,
.info-section,
.about-section,
.faq-section,
.todas-ciudades-section {
    display: none !important;
}
