/* ════════════════════════════════════════
   JJ Admin Dashboard — Shortcode overrides
   Adapta o layout para páginas front-end
════════════════════════════════════════ */

/* Wrapper externo */
.wdb-sc-wrapper {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

/* No shortcode o app ocupa 100% da página */
.wdb-sc-wrapper #wdb-app {
    margin: 0 !important;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

/* Sidebar: sticky dentro do wrapper, não fixed no viewport */
.wdb-sc-wrapper .wdb-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
}

/* Main sem margem extra */
.wdb-sc-wrapper .wdb-main {
    margin-left: 0 !important;
}

/* Topbar sticky dentro do main */
.wdb-sc-wrapper .wdb-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
}

/* Mensagem de acesso negado */
.wdb-sc-login-msg {
    padding: 24px;
    font-size: 14px;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    font-family: 'Inter', sans-serif;
}
.wdb-sc-login-msg a { color: var(--e-global-color-primary, #7c3aed); font-weight: 600; }

/* Overlay mobile */
.wdb-sc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 199;
}
.wdb-sc-overlay.open { display: block; }

/* Mobile */
@media (max-width: 768px) {
    .wdb-sc-wrapper .wdb-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 200;
        display: flex !important; /* override o display:none do admin */
    }
    .wdb-sc-wrapper .wdb-sidebar.open {
        transform: translateX(0);
    }
    .wdb-sc-menu-btn { display: flex !important; }
    .wdb-sc-menu-btn:hover { background: rgba(0, 0, 0, 0.08) !important; }
}

/* ════════════════════════════════════════
   Shortcode [dashboard_loja_filtros] Styles
   ════════════════════════════════════════ */
.dashboard-loja-filters-container {
    /* Variáveis de cor — sobrescritas pelo PHP via <style> inline */
    --dl-color-range: var(--e-global-color-primary, #7c3aed);
    --dl-color-btn-bg: var(--e-global-color-primary, #7c3aed);
    --dl-color-btn-text: #ffffff;
    --dl-color-btn-hover: #6d28d9;

    display: flex;
    gap: 30px;
    margin: 30px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1f2937;
}

.dl-filters-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    height: fit-content;
}

.dl-filter-group {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
}
.dl-filter-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.dl-filter-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
    letter-spacing: -0.01em;
}

/* Range Slider */
.dl-price-slider-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dl-slider-range {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
}
.dl-slider-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--dl-color-range);
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.dl-slider-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.dl-price-label-wrap {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #4b5563;
}
.dl-price-label-wrap strong {
    color: var(--dl-color-range);
    font-weight: 600;
}

/* Categories List */
.dl-categories-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dl-cat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}
.dl-cat-label:hover {
    color: #111827;
}
.dl-cat-filter {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    accent-color: var(--dl-color-range);
    cursor: pointer;
}
.dl-cat-name {
    flex-grow: 1;
}
.dl-cat-count {
    color: #9ca3af;
    font-size: 12px;
}

/* Clear Button */
.dl-btn-clear {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--dl-color-range);
    border-radius: 8px;
    color: var(--dl-color-range);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: center;
}
.dl-btn-clear:hover {
    background: var(--dl-color-range);
    color: #ffffff;
}

/* Products Content & Grid */
.dl-products-content {
    flex-grow: 1;
    position: relative;
}

/* Sem sidebar: produtos ocupam 100% da largura */
.dashboard-loja-filters-container.dl-no-sidebar {
    gap: 0;
}

.dashboard-loja-filters-container.dl-no-sidebar .dl-products-content {
    width: 100%;
}


.dl-products-grid {
    display: grid;
    gap: 24px;
    transition: opacity 0.2s;
}
.dl-layout-3-columns {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.dl-layout-2-columns {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.dl-layout-compact {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

/* Product Card */
.dl-product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.dl-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -8px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}
.dl-product-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
}
.dl-product-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--dl-color-title, #111827);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
    line-height: 1.3;
}
.dl-product-title:hover {
    color: var(--dl-color-title, var(--dl-color-range, var(--e-global-color-primary, #7c3aed)));
    opacity: 0.85;
}
.dl-product-price {
    font-size: 16px;
    font-weight: 700;
    /* Preço normal: usa a cor de preço regular */
    color: var(--dl-color-price-regular, #64748b);
}
.dl-product-price del,
.dl-product-price del .amount,
.dl-product-price del bdi {
    /* Preço riscado (de) em promoção: cor apagada */
    color: var(--dl-color-price-regular, #94a3b8) !important;
    font-weight: 400;
    margin-right: 4px;
}
.dl-product-price ins,
.dl-product-price ins .amount,
.dl-product-price ins bdi {
    /* Preço promocional (por): cor de promoção */
    color: var(--dl-color-price-sale, #10b981) !important;
    font-weight: 700;
}

/* Load More Button */
.dl-load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 32px;
    width: 100%;
}
.dl-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: var(--dl-color-btn-bg);
    color: var(--dl-color-btn-text);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
}
.dl-load-more-btn:hover {
    background: var(--dl-color-btn-hover);
    transform: translateY(-1px);
}
.dl-load-more-btn:active {
    transform: translateY(0);
}

/* Loader */
.dl-loader-wrap {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
}
.dl-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--dl-color-range);
    border-radius: 50%;
    animation: dl-spin 0.6s linear infinite;
}
.dl-spinner-small {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: dl-spin 0.6s linear infinite;
}
@keyframes dl-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-loja-filters-container {
        flex-direction: column;
    }
    .dl-filters-sidebar {
        width: 100%;
    }
}
