/* Mobile-first */

.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0;
}

.filter-btn {
    background-color: rgba(44, 44, 44, 0.9);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    font-weight: 500;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.filter-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.filter-btn.active {
    background-color: var(--color-accent);
    color: var(--text-light);
    border-color: var(--color-accent);
    font-weight: 600;
}

.filter-btn .category-image {
    display: block;
    width: 78px;
    height: 78px;
    margin: 0 auto 0.7rem;
    border-radius: 50%;
    object-fit: cover;
    background: var(--store-surface-soft, var(--bg-tertiary));
    border: 1px solid var(--store-line, rgba(255, 255, 255, 0.2));
}

/* --- NUEVAS REGLAS RESPONSIVE PARA EL HERO Y PROMO-STRIPE --- */

/* Dispositivos móviles (< 768px) */
@media (max-width: 767px) {
    .hero-content {
        left: 50%;
        width: 92%;
        max-width: 92%;
        padding: 0.5rem;
    }

    #hero-typing-text {
        font-size: clamp(2rem, 10vw, 3.75rem);
        letter-spacing: 0.045em;
    }

    .hero {
        height: 40vh;
        min-height: 280px;
    }

    .hero-image {
        object-position: 18% center;
    }

    .promo-stripe {
        padding: 1.5rem var(--spacing-sm);
    }

    .promo-copy {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
        padding: 0;
    }

    .promo-copy h1 {
        font-size: clamp(1.4rem, 4vw, 1.8rem);
        letter-spacing: 0.12em;
        margin: 0;
    }

    .promo-copy h2 p {
        font-size: clamp(0.8rem, 2.5vw, 0.9rem);
        line-height: 1.4;
        margin: 0;
        max-width: 100%;
    }
}

/* Dispositivo móvil en horizontal o pequeña tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero {
        height: 50vh;
        min-height: 320px;
    }

    .hero-image {
        object-position: 18% center;
    }

    .promo-stripe {
        padding: 2rem var(--spacing-md);
    }

    .promo-copy h1 {
        font-size: clamp(1.6rem, 3.5vw, 2rem);
    }

    .promo-copy h2 p {
        font-size: clamp(0.85rem, 2.2vw, 0.95rem);
    }
}

/* Dispositivos grandes (>= 1024px) */
@media (min-width: 1024px) {
    .hero {
        height: 65vh;
        min-height: 500px;
    }

    .hero-image {
        object-position: 18% center;
    }

    .promo-copy {
        padding: 3rem var(--spacing-md);
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .promo-copy h1 {
        font-size: clamp(1.8rem, 2.8vw, 2.4rem);
    }

    .promo-copy h2 p {
        font-size: clamp(0.9rem, 1.8vw, 1rem);
    }
}

/* Reglas para promo-stripe en pantallas < 1024px */
@media (max-width: 1023px) {
    .promo-copy {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
        padding: 1.5rem var(--spacing-sm);
    }

    .promo-copy .btn-promo {
        justify-self: center;
    }
}

@media (max-width: 767px) {
    body,
    html {
        overflow-x: hidden;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero {
        aspect-ratio: 4 / 5;
        min-height: clamp(320px, 75vw, 480px);
        max-height: 68vh;
    }

    .hero-image {
        object-position: left center;
    }

    .header-top {
        padding: 1rem 1rem;
    }

    /* Header adjustments for small screens: keep logo centered, prevent brand text cutoff */
    .header-top {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 0.5rem;
    }

    .header-brand {
        justify-self: start;
        transform: none;
        overflow: visible;
    }

    .header-brand a {
        font-size: clamp(0.95rem, 4.2vw, 1.05rem);
        letter-spacing: 0.12em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-logo {
        position: static;
        left: auto;
        top: auto;
        transform: none;
        justify-self: center;
    }

    .header-actions {
        justify-self: end;
        gap: 0.5rem;
    }

    .icon-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.25rem;
    }

    /* Ensure header elements receive pointer events and sit above potential overlays */
    .header-top,
    .header-actions,
    .icon-btn {
        z-index: 1000;
        pointer-events: auto;
    }


    .header-search.mobile-search-bar {
        display: none;
        gap: 0.75rem;
    }

    .header-search.mobile-search-bar.active {
        display: flex;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-card {
        min-height: auto;
        width: 100%;
        max-width: 100%;
    }

    .card-image-container {
        padding: 0;
        overflow: hidden;
        border-radius: 12px;
    }

    .card-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        border-radius: 12px;
        display: block;
    }

    .card-info {
        padding: 1rem;
        gap: 0.75rem;
    }

    .card-price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .card-buy-button {
        width: 100%;
        min-width: 0;
    }

    .image-lightbox {
        padding: 0.75rem;
    }

    .image-lightbox-content {
        width: 100%;
        height: min(100%, 78dvh);
    }

    .image-lightbox-nav {
        width: 40px;
        height: 48px;
        font-size: 2.5rem;
    }

    .image-lightbox-close {
        top: -0.25rem;
        right: -0.25rem;
    }

    .filters {
        overflow-x: auto;
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.5rem;
        padding: 1rem 1rem 0.75rem;
        margin-bottom: 1.5rem;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .filters::-webkit-scrollbar {
        display: none;
        height: 0;
    }

    .filter-btn {
        flex: 0 0 auto;
        min-width: max-content;
        border-radius: 20px;
        padding: 0.6rem 1.2rem;
    }

    .filter-btn .category-image {
        width: 72px;
        height: 72px;
    }
}

@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        aspect-ratio: 16 / 9;
        min-height: 220px;
        max-height: 85vh;
    }

    .hero-image {
        object-position: 15% center;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero {
        aspect-ratio: 16 / 10;
        min-height: clamp(360px, 48vw, 520px);
        max-height: 72vh;
    }

    .hero-image {
        object-position: 20% center;
    }
}

@media (min-width: 768px) {
    .header-top {
        padding: 1.25rem var(--spacing-lg);
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }

    .product-card {
        min-height: auto;
    }

    .card-buy-button {
        width: 100%;
        min-width: 0;
    }

    .header-search.mobile-search-bar {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding: 0 0 1rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .hero {
        aspect-ratio: 16 / 9;
        min-height: clamp(480px, 42vw, 640px);
        max-height: min(78vh, 760px);
    }

    .hero-image {
        object-position: center center;
    }

    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .promo-copy {
        padding: 5rem var(--spacing-md);
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .promo-copy h2 {
        font-size: clamp(2.2rem, 2.4vw, 2.5rem);
    }

    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    .promo-copy {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .promo-copy .btn-promo {
        justify-self: center;
    }
}

@media (max-width: 767px) {
    .footer-content {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
}
