/**
 * Estilos frontend - Busca de Lojas
 * 
 * @author Dante Testa
 * @link https://dantetesta.com.br
 * @since 1.0.0
 * @modified 2026-01-22 12:44:00
 */

/* Container */
.bdl-lojas-wrapper {
    width: 100%;
}

/* Filtros */
.bdl-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    align-items: flex-end;
}

.bdl-filtros-com-labels {
    align-items: flex-end;
}

.bdl-filtro-item {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bdl-filtro-busca {
    flex: 2;
}

.bdl-filtro-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0;
    display: block;
}

.bdl-input-busca,
.bdl-select-estado,
.bdl-select-cidade {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    transition: all 0.3s ease;
    background-color: #fff;
    color: #333;
    box-sizing: border-box;
    height: 46px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.bdl-select-estado,
.bdl-select-cidade {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.bdl-input-busca:focus,
.bdl-select-estado:focus,
.bdl-select-cidade:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.bdl-select-estado:disabled,
.bdl-select-cidade:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Botão Limpar Filtros */
.bdl-filtro-limpar {
    flex: 0 0 auto;
    min-width: auto;
}

.bdl-btn-limpar-filtros {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.bdl-btn-limpar-filtros:hover {
    background-color: #e0e0e0;
    color: #333;
    border-color: #ccc;
}

.bdl-btn-limpar-filtros i {
    font-size: 12px;
}

/* Contador de Resultados */
.bdl-resultados-contador {
    margin-bottom: 20px;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
}

.bdl-resultados-texto {
    font-weight: 500;
}

/* Grid de Lojas */
.bdl-lojas-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Card da Loja */
.bdl-loja-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.bdl-loja-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.bdl-loja-header {
    margin-bottom: 15px;
}

.bdl-loja-titulo {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.bdl-loja-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bdl-loja-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.bdl-loja-info a {
    color: #2271b1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.bdl-loja-info a:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Ícones */
.bdl-icon {
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
}

.bdl-icon::before {
    font-family: dashicons;
    font-size: inherit;
}

.bdl-icon-endereco::before {
    content: "\f230";
}

.bdl-icon-localidade::before {
    content: "\f319";
}

.bdl-icon-cep::before {
    content: "\f322";
}

.bdl-icon-telefone::before {
    content: "\f525";
}

.bdl-icon-whatsapp::before {
    content: "\f232";
    font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands";
}

/* Botões de Navegação (Waze/Google Maps/WhatsApp) */
.bdl-loja-card {
    position: relative;
}

.bdl-loja-nav-buttons {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
}

.bdl-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.bdl-nav-btn i {
    font-size: 18px;
    line-height: 1;
}

.bdl-nav-btn svg,
.bdl-nav-btn img {
    display: block;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.bdl-nav-btn svg {
    fill: currentColor;
}

.bdl-nav-custom-svg {
    object-fit: contain;
}

/* Templates usados pelo JavaScript; nunca aparecem na página. */
.bdl-lojas-wrapper > template {
    display: none !important;
}

.bdl-nav-btn:hover {
    transform: scale(1.05);
}

/* Classe para Waze - usado pelo Elementor */
.bdl-waze-btn {
    background: #33ccff;
    color: #fff;
}

.bdl-waze-btn:hover {
    background: #00b8f0;
    color: #fff;
}

/* Classe para Google Maps - usado pelo Elementor */
.bdl-gmaps-btn {
    background: #4285f4;
    color: #fff;
}

.bdl-gmaps-btn:hover {
    background: #3367d6;
    color: #fff;
}

/* Loading */
.bdl-loading {
    --bdl-loader-color: #2271b1;
    --bdl-loader-track: #e5e5e5;
    --bdl-loader-size: 40px;
    --bdl-loader-speed: .8s;
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

.bdl-loader-visual {
    display: block;
    position: relative;
    width: var(--bdl-loader-size);
    height: var(--bdl-loader-size);
    margin: 0 auto 15px;
}

.bdl-loader-spinner .bdl-loader-visual {
    border: 3px solid var(--bdl-loader-track);
    border-top-color: var(--bdl-loader-color);
    border-radius: 50%;
    animation: bdl-spin var(--bdl-loader-speed) linear infinite;
}

.bdl-loader-dots .bdl-loader-visual {
    width: calc(var(--bdl-loader-size) * 1.7);
    background: radial-gradient(circle closest-side, var(--bdl-loader-color) 90%, transparent) 0 50%/33.333% 100% space;
    animation: bdl-dots var(--bdl-loader-speed) infinite linear;
}

.bdl-loader-pulse .bdl-loader-visual {
    border-radius: 50%;
    background: var(--bdl-loader-color);
    animation: bdl-pulse var(--bdl-loader-speed) ease-in-out infinite;
}

.bdl-loader-bars .bdl-loader-visual {
    width: calc(var(--bdl-loader-size) * 1.25);
    background: linear-gradient(90deg, var(--bdl-loader-color) 20%, transparent 20% 40%, var(--bdl-loader-color) 40% 60%, transparent 60% 80%, var(--bdl-loader-color) 80%);
    animation: bdl-bars var(--bdl-loader-speed) ease-in-out infinite;
    transform-origin: center bottom;
}

@keyframes bdl-spin { to { transform: rotate(360deg); } }
@keyframes bdl-dots { 33% { background-position: 50% 50%; } 66% { background-position: 100% 50%; } }
@keyframes bdl-pulse { 0%,100% { transform: scale(.55); opacity: .45; } 50% { transform: scale(1); opacity: 1; } }
@keyframes bdl-bars { 0%,100% { transform: scaleY(.45); opacity: .55; } 50% { transform: scaleY(1); opacity: 1; } }

/* Estado Vazio */
.bdl-estado-vazio {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Paginação */
.bdl-paginacao {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 30px;
}

.bdl-paginacao-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.bdl-paginacao-item:hover {
    background: #f5f5f5;
    border-color: #2271b1;
    color: #2271b1;
}

.bdl-paginacao-item.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.bdl-paginacao-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Botão Carregar Mais */
.bdl-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    background: #2271b1;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bdl-load-more:hover {
    background: #135e96;
}

.bdl-load-more:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.bdl-load-more.loading::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bdl-spin 0.8s linear infinite;
    margin-right: 10px;
}

/* Responsivo */
@media screen and (max-width: 1024px) {
    .bdl-lojas-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .bdl-filtros {
        flex-direction: column;
    }
    
    .bdl-filtro-item {
        min-width: 100%;
    }
    
    .bdl-lojas-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 480px) {
    .bdl-loja-card {
        padding: 15px;
    }
    
    .bdl-loja-titulo {
        font-size: 16px;
    }
    
    .bdl-loja-info {
        font-size: 13px;
    }
    
    .bdl-paginacao-item {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }
}


/* Classe para WhatsApp - usado pelo Elementor */
.bdl-whatsapp-btn {
    background: #25D366;
    color: #fff;
}

.bdl-whatsapp-btn:hover {
    background: #1ebe5d;
    color: #fff;
}
