/**
 * TeixeiraZap Ofertas - Feed Styles
 * Contém estilos para Hero Carousel, Busca, Filtros, Grid de Ofertas e Cards.
 */

/* Hero Slider / Banner Carousel */
.hero-carousel-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .hero-carousel-wrapper {
        margin: 12px auto;
        padding: 0 12px;
    }
}

.hero-carousel-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    width: 100%;
}

.hero-carousel-card {
    flex: 0 0 100%;
    width: 100%;
    display: none;
    border-radius: var(--gz-radius);
    overflow: hidden;
    box-shadow: var(--gz-shadow);
    background: #ffffff !important;
}

.hero-carousel-card.active {
    display: block;
}

.hero-card-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.hero-card-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 */
    overflow: hidden;
    background: #ffffff !important;
}

.hero-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    touch-action: pan-y;
}

.hero-card-link:hover .hero-card-image {
    transform: scale(1.05);
}

.hero-card-text-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 20px;
    z-index: 2;
}

.hero-card-text {
    display: block;
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.3;
}

/* Hub de Mercados - Cabeçalho e Vitrine */
.hub-mercados-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--gz-primary) 0%, var(--gz-secondary) 100%);
    color: white;
    border-radius: 24px;
    margin: 20px 0 30px;
    box-shadow: var(--gz-shadow);
}

.hub-mercados-header h1 {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 8px 0;
}

.hub-mercados-header p {
    opacity: 0.9;
    font-size: 16px;
    margin: 0;
}

.hub-lojas-vitrine {
    margin-bottom: 10px !important; /* Métrica de 10px */
}

.hub-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lojas-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 5px 10px !important; /* Métrica de 10px */
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lojas-carousel::-webkit-scrollbar {
    display: none;
}

.loja-bubble {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    width: 90px;
    transition: transform 0.3s ease;
}

.loja-bubble:hover {
    transform: translateY(-5px);
}

.loja-logo-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: white;
    border: 3px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.loja-logo-circle img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.loja-initials {
    font-size: 24px;
    font-weight: 800;
}

.loja-name-label {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

@media (max-width: 768px) {
    .hub-mercados-header {
        padding: 30px 15px;
        border-radius: 16px;
    }

    .hub-mercados-header h1 {
        font-size: 22px;
    }

    .loja-logo-circle {
        width: 60px;
        height: 60px;
    }

    .loja-bubble {
        width: 80px;
    }
}

/* Busca e Filtros */
.ofertas-busca-filtros-sticky {
    position: relative;
    z-index: 999;
    background: rgba(245, 245, 245, 0.9);
    backdrop-filter: blur(10px);
    padding: 2px 20px 10px 20px !important; /* Padding lateral e inferior corrigido */
    margin-bottom: 10px !important; /* Espaço padrão restaurado */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-left: -20px;
    margin-right: -20px;
    border-radius: 0 0 16px 16px;
}

.ofertas-busca-filtros-sticky.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--gz-primary);
    margin: 0;
    padding: 10px 15px;
    border-radius: 0;
    z-index: 9999;
}

.ofertas-search-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    background: #ffffff !important;
    border-radius: 50px !important;
    padding: 4px 4px 4px 20px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease;
    box-sizing: border-box !important;
}

.ofertas-search-wrapper:focus-within {
    border-color: var(--gz-primary) !important;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.15) !important;
}

.ofertas-search-input {
    all: unset !important;
    flex: 1 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 16px !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    color: #1f2937 !important;
    height: 44px !important;
    margin: 0 !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

.ofertas-search-form input.ofertas-search-input {
    border: none !important;
    background: none !important;
}

.ofertas-search-input::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

.ofertas-search-button {
    all: unset !important;
    background: var(--gz-primary) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.ofertas-search-button:hover {
    background: var(--gz-secondary) !important;
    transform: scale(1.05) !important;
}

.ofertas-search-button svg {
    width: 20px !important;
    height: 20px !important;
    color: white !important;
    stroke: white !important;
    stroke-width: 2.5 !important;
    display: block !important;
}

.ofertas-filtros-row {
    display: flex;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto 0 !important;
    padding-bottom: 0 !important;
    flex-wrap: wrap;
    position: relative;
    align-items: center;
}

.filtro-btn {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0 16px;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    flex: 1;
    min-width: 0;
}

.filtro-tipo {
    flex: 0 0 auto;
    min-width: 100px;
}

.filtro-categorias {
    flex: 1.5;
}

.filtro-btn:hover {
    background: #f9fafb;
    border-color: var(--gz-primary);
}

.filtro-btn.active {
    background: var(--gz-primary);
    color: white;
    border-color: var(--gz-primary);
}

.filtro-btn svg {
    transition: transform 0.3s ease;
}

.filtro-btn.open svg {
    transform: rotate(180deg);
}

.filtro-mercados {
    flex: 1;
    min-width: 100px;
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    color: #166534 !important;
    text-decoration: none !important;
    justify-content: center !important;
    white-space: nowrap !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
}

.filtro-mercados span {
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

/* Dropdowns */
.filtros-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    min-width: 220px;
    max-width: calc(100vw - 40px);
    width: max-content;
    background: white;
    border: 2px solid var(--gz-border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

#tipoDropdown {
    left: 0;
}

#categoriasDropdown {
    right: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.filtro-opcoes {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 400px;
    overflow-y: auto;
}

.filtro-opcao {
    background: transparent;
    border: none;
    padding: 12px 16px;
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    transition: all 0.2s ease;
    width: 100%;
}

.filtro-opcao:hover {
    background: var(--gz-bg-bubble);
    color: var(--gz-accent);
}

.filtro-opcao.active {
    background: var(--gz-primary);
    color: white;
    font-weight: 700;
}

/* Textos responsivos - Corrigindo "Tipo Tipo" */
.filtro-tipo-texto-mobile {
    display: none;
}

@media (max-width: 768px) {
    .filtro-tipo-texto-desktop {
        display: none;
    }

    .filtro-tipo-texto-mobile {
        display: inline-block;
    }
}

/* Grid de Ofertas */
.ofertas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 15px !important; /* Espaçamento padrão restaurado */
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .ofertas-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-top: 15px !important; /* Mobile também com respiro */
    }
}