/* ================================================================
   EasyCatalog For Elementor â€” Frontend CSS
   Author: Elevate Hub | https://plugins.elevatehub.com.br
================================================================ */

/* â”€â”€ Reset â”€â”€ */
.eca-catalog-wrap *, .eca-catalog-wrap *::before, .eca-catalog-wrap *::after { box-sizing: border-box; }

/* ================================================================
   TOP BAR
================================================================ */
.eca-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.eca-search-input {
    flex: 1;
    min-width: 180px;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #111827;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.eca-search-input:focus {
    border-color: #5433FF;
    box-shadow: 0 0 0 3px rgba(84,51,255,.15);
}
.eca-orderby-select {
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    outline: none;
    max-width: 180px;
    flex-shrink: 0;
}
.eca-results-count {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    margin-left: auto;
}

/* ================================================================
   FILTER BAR
================================================================ */
.eca-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #f3f4f6;
}
.eca-filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.eca-filter-label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-right: 2px;
}

/* Pills style (default) */
.eca-filter-pills .eca-filter-btn {
    padding: 5px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}
.eca-filter-pills .eca-filter-btn:hover  { border-color: #5433FF; color: #5433FF; }
.eca-filter-pills .eca-filter-btn.active { background: #5433FF; border-color: #5433FF; color: #fff; font-weight: 600; }

/* Square style */
.eca-filter-square .eca-filter-btn {
    padding: 5px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}
.eca-filter-square .eca-filter-btn:hover  { border-color: #5433FF; color: #5433FF; }
.eca-filter-square .eca-filter-btn.active { background: #5433FF; border-color: #5433FF; color: #fff; font-weight: 600; }

/* Underline style */
.eca-filter-underline .eca-filter-btn {
    padding: 5px 10px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    border-radius: 0;
}
.eca-filter-underline .eca-filter-btn:hover  { color: #5433FF; }
.eca-filter-underline .eca-filter-btn.active { color: #5433FF; border-bottom-color: #5433FF; font-weight: 700; }

/* ================================================================
   LAYOUT: SIDEBAR
================================================================ */
.eca-layout-sidebar {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}
.eca-sidebar-filters {
    position: sticky;
    top: 80px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    padding: 16px;
}
.eca-sidebar-filters .eca-filters-bar {
    flex-direction: column;
    gap: 20px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}
.eca-sidebar-filters .eca-filter-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

/* Sidebar mobile breakpoint — see RESPONSIVIDADE section */

/* ================================================================
   PRODUCT GRID
================================================================ */
.eca-products-grid {
    display: grid;
    gap: 24px;
}
.eca-cols-1 { grid-template-columns: 1fr; }
.eca-cols-2 { grid-template-columns: repeat(2, 1fr); }
.eca-cols-3 { grid-template-columns: repeat(3, 1fr); }
.eca-cols-4 { grid-template-columns: repeat(4, 1fr); }
.eca-cols-5 { grid-template-columns: repeat(5, 1fr); }

/* Grid breakpoints — defined in RESPONSIVIDADE section below */

/* ================================================================
   PRODUCT CARD
================================================================ */
.eca-product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    /* Hover transform removed — no lift animation */
}

/* Card styles */
.eca-card-shadow .eca-product-card  { box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.eca-card-border .eca-product-card  { border: 1px solid #e5e7eb; }
.eca-card-minimal .eca-product-card { background: transparent; border-bottom: 2px solid #f3f4f6; border-radius: 0; }
.eca-card-overlay .eca-product-card { box-shadow: 0 4px 24px rgba(0,0,0,.08); }

/* ── Detailed card — foto + título + descrição sempre visível + botão ── */
.eca-card-detailed .eca-product-card {
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    display: flex;
    flex-direction: column;
}
.eca-card-detailed .eca-product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}
.eca-card-detailed .eca-product-excerpt {
    display: -webkit-box !important;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-shrink: 0;
}
.eca-card-detailed .eca-product-footer {
    margin-top: auto;
    padding-top: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.eca-card-detailed .eca-btn-cta {
    width: 100%;
    justify-content: center;
}

/* Image */
.eca-product-image-wrap { position: relative; overflow: hidden; }
.eca-image-ratio {
    position: relative;
    width: 100%;
    background: #f3f4f6;
    overflow: hidden;
}
.eca-img-main,
.eca-img-hover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Image swap hover removed */
.eca-img-hover { display: none; }
.eca-img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: #f3f4f6;
}

/* Overlay card style */
.eca-card-overlay .eca-image-ratio { padding-bottom: 140% !important; }
.eca-card-overlay .eca-product-body {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 100%);
    padding: 24px 16px 16px;
    transform: translateY(calc(100% - 68px));
    transition: transform .3s;
}
.eca-card-overlay .eca-product-card:hover .eca-product-body { transform: translateY(0); }
.eca-card-overlay .eca-product-title,
.eca-card-overlay .eca-product-price,
.eca-card-overlay .eca-product-excerpt,
.eca-card-overlay .eca-product-sku,
.eca-card-overlay .eca-attr-name,
.eca-card-overlay .eca-attr-value { color: #fff; }
.eca-card-overlay .eca-btn-cta {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.5);
    color: #fff;
    backdrop-filter: blur(4px);
}
.eca-card-overlay .eca-btn-cta:hover {
    background: #fff;
    color: #111827;
}

/* â”€â”€ Card Body â”€â”€ */
.eca-product-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    flex: 1;
}

.eca-product-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.4;
}
.eca-product-title a {
    color: inherit;
    text-decoration: none;
}
.eca-product-title a:hover { color: #5433FF; }

.eca-product-sku {
    font-size: 11px;
    color: #9ca3af;
    letter-spacing: .03em;
}

.eca-product-excerpt {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

/* â”€â”€ Attribute rows (filter values on card) â”€â”€ */
.eca-product-attrs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}
.eca-attr-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}
.eca-attr-name {
    color: #9ca3af;
    font-weight: 600;
    white-space: nowrap;
}
.eca-attr-value {
    color: #374151;
}

/* â”€â”€ Card Footer (price + CTA) â”€â”€ */
.eca-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}
.eca-card-overlay .eca-product-footer { border-top: none; }

.eca-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #059669;
    white-space: nowrap;
}

.eca-btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #5433FF;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, border-color .2s, color .2s, transform .15s, box-shadow .2s;
    text-decoration: none;
}
.eca-btn-cta:hover {
    background: #4424EE;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(84,51,255,.35);
}
.eca-btn-cta:active { transform: translateY(0); }

/* Outline variant */
.eca-btn-outline .eca-btn-cta {
    background: transparent;
    border-color: #5433FF;
    color: #5433FF;
}
.eca-btn-outline .eca-btn-cta:hover {
    background: #5433FF;
    color: #fff;
    box-shadow: 0 4px 12px rgba(84,51,255,.25);
}
/* Ghost variant */
.eca-btn-ghost .eca-btn-cta {
    background: transparent;
    border-color: transparent;
    color: #5433FF;
    box-shadow: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.eca-btn-ghost .eca-btn-cta:hover {
    background: transparent;
    color: #4424EE;
    transform: none;
    box-shadow: none;
}

/* ================================================================
   BADGES
================================================================ */
.eca-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    z-index: 2;
    pointer-events: none;
}
.eca-badge-new        { background: #5433FF; color: #fff; }
.eca-badge-sale       { background: #ef4444; color: #fff; }
.eca-badge-featured   { background: #f59e0b; color: #fff; }
.eca-badge-bestseller { background: #10b981; color: #fff; }

/* ================================================================
   NO RESULTS
================================================================ */
.eca-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: #9ca3af;
    font-size: 15px;
}
.eca-no-results p { margin: 0; }

/* ================================================================
   LOADING STATE
================================================================ */
.eca-catalog-wrap.eca-loading .eca-products-grid {
    position: relative;
    min-height: 200px;
    pointer-events: none;
    opacity: .5;
}
.eca-catalog-wrap.eca-loading .eca-products-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.6);
    z-index: 5;
}
.eca-spinner {
    display: none;
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #5433FF;
    border-radius: 50%;
    animation: eca-spin .7s linear infinite;
    margin: 24px auto;
}
.eca-catalog-wrap.eca-loading .eca-spinner { display: block; }

@keyframes eca-spin {
    to { transform: rotate(360deg); }
}

/* ================================================================
   PAGINATION
================================================================ */
.eca-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.eca-page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: none;
    background: #f9fafb;
    color: #4b5563;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.eca-page-btn.eca-page-nav {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #111827;
}
.eca-page-btn:hover:not(:disabled) {
    background: #5433FF;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(84, 51, 255, 0.25);
    transform: translateY(-2px);
}
.eca-page-btn.active {
    background: #5433FF;
    color: #fff;
    box-shadow: 0 4px 12px rgba(84, 51, 255, 0.3);
    pointer-events: none;
}
.eca-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
    color: #9ca3af;
    box-shadow: none;
}
.eca-page-dots {
    font-size: 16px;
    color: #9ca3af;
    padding: 0 8px;
    user-select: none;
    letter-spacing: 2px;
}

/* ================================================================
   PRODUCT POPUP
================================================================ */
.eca-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease, visibility .15s ease;
    will-change: opacity;
}
/* Bloquear scroll da página quando popup está aberto */
body.eca-popup-open {
    overflow: hidden !important;
}
.eca-popup-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.eca-popup-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.28);
    transform: translateY(14px);
    transition: transform .15s ease;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
    will-change: transform;
}
.eca-popup-overlay.is-open .eca-popup-box { transform: translateY(0); }
.eca-popup-box::-webkit-scrollbar { width: 5px; }
.eca-popup-box::-webkit-scrollbar-track { background: transparent; }
.eca-popup-box::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* Close button — fixed over popup, no layout impact */
.eca-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(243,244,246,.95);
    color: #374151;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s;
    z-index: 20;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.eca-popup-close:hover { background: #ef4444; color: #fff; }

.eca-popup-box { position: relative; }
.eca-popup-content { overflow: hidden; }

/* Popup Inner — 2 colunas: galeria | info */
.eca-popup-inner {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) 3fr;
}

/* Gallery column */
.eca-popup-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 28px 20px 28px 28px;
    background: #f9fafb;
    border-radius: 16px 0 0 16px;
}
.eca-popup-main-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #e5e7eb;
}
.eca-popup-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.eca-popup-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    color: #d1d5db;
}
.eca-popup-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.eca-popup-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 7px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: .65;
    transition: border-color .12s, opacity .12s;
}
.eca-popup-thumb:hover,
.eca-popup-thumb.active { border-color: #5433FF; opacity: 1; }
.eca-popup-thumb:focus  { outline: 2px solid #5433FF; outline-offset: 2px; }

/* Info column */
.eca-popup-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
    /* top padding ensures content starts below the absolute close button (34px + 12px top + margin) */
    padding: 28px 56px 28px 24px;
    overflow: hidden;
}
.eca-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}
.eca-popup-sku {
    font-size: 12px;
    color: #9ca3af;
    margin: -8px 0 0;
    letter-spacing: .02em;
}
.eca-popup-price {
    font-size: 24px;
    font-weight: 800;
    color: #059669;
    line-height: 1;
}
.eca-popup-description {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.7;
}
.eca-popup-description p { margin: 0 0 8px; }
.eca-popup-description p:last-child { margin-bottom: 0; }

/* Attribute grid */
.eca-popup-attrs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 12px 14px;
}
.eca-popup-attr-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}
.eca-popup-attr-name {
    font-weight: 600;
    color: #9ca3af;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.eca-popup-attr-value {
    color: #111827;
    font-weight: 500;
}

/* Specs table */
.eca-popup-specs { margin-top: 2px; }
.eca-popup-specs-title {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 0 0 8px;
}
.eca-popup-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.eca-popup-specs-table th,
.eca-popup-specs-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}
.eca-popup-specs-table th {
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    width: 38%;
    white-space: nowrap;
}
.eca-popup-specs-table td { color: #6b7280; }
.eca-popup-specs-table tr:last-child th,
.eca-popup-specs-table tr:last-child td { border-bottom: none; }

/* Popup responsive */
@media (max-width: 680px) {
    .eca-popup-inner { grid-template-columns: 1fr; }
    .eca-popup-gallery {
        padding: 20px 20px 12px;
        border-radius: 16px 16px 0 0;
        min-height: unset;
    }
    .eca-popup-main-img-wrap { aspect-ratio: 4 / 3; }
    .eca-popup-info  { padding: 16px 20px 24px; }
    .eca-popup-title { font-size: 17px; }
    .eca-popup-price { font-size: 20px; }
    .eca-popup-attrs { grid-template-columns: 1fr; }
}

/* ================================================================
   UTILITY / ACCESSIBILITY
================================================================ */
.eca-catalog-wrap :focus-visible {
    outline: 2px solid #5433FF;
    outline-offset: 2px;
}

/* Screen-reader only */
.eca-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ================================================================
   RESPONSIVIDADE
================================================================ */

/* ── ≤ 1100px (tablet landscape) ────────────────────────────── */
@media (max-width: 1100px) {
    .eca-cols-4,
    .eca-cols-5 { grid-template-columns: repeat(3, 1fr); }
}

/* ── ≤ 900px (tablet portrait) ───────────────────────────────── */
@media (max-width: 900px) {
    /* Sidebar vira top */
    .eca-layout-sidebar {
        grid-template-columns: 1fr;
    }
    .eca-sidebar-filters {
        position: static;
    }
    .eca-sidebar-filters .eca-filters-bar {
        flex-direction: row;
        flex-wrap: wrap;
        margin: 0;
        padding: 12px 14px;
    }
    .eca-sidebar-filters .eca-filter-group {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    /* Grid */
    .eca-cols-3,
    .eca-cols-4,
    .eca-cols-5 { grid-template-columns: repeat(2, 1fr); }

    /* Popup */
    .eca-popup-box { max-width: 720px; }
}

/* ── ≤ 680px (mobile) ────────────────────────────────────────── */
@media (max-width: 680px) {

    /* ── Esconder desktop UI ── */
    .eca-topbar      { display: none !important; }
    .eca-filters-bar { display: none !important; }

    /* ── Mostrar topbar mobile (2 linhas) ──
       !important garante que vence qualquer regra base fora da media query */
    .eca-mobile-topbar-row1 { display: flex !important; }
    .eca-mobile-topbar-row2 { display: flex !important; }

    /* ── Layout sidebar: colapsar independente do Elementor ──
       !important vence o inline style injetado pelo controle sidebar_filters_width */
    .eca-layout-sidebar {
        display: block !important;
        grid-template-columns: 1fr !important;
    }
    .eca-sidebar-filters { display: none !important; }
    .eca-sidebar-main    { width: 100%; min-width: 0; }

    /* ── Grid: sempre 2 colunas no mobile ── */
    .eca-products-grid,
    .eca-cols-1,
    .eca-cols-2,
    .eca-cols-3,
    .eca-cols-4,
    .eca-cols-5 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* ── Cards compactos (estilo Mercado Livre) ── */
    .eca-product-card {
        border-radius: 8px;
    }
    .eca-image-ratio {
        padding-bottom: 100% !important; /* sempre quadrado no mobile */
    }
    .eca-product-body {
        padding: 8px 8px 10px !important;
        gap: 4px !important;
    }
    .eca-product-title {
        font-size: 12px !important;
        font-weight: 600 !important;
        line-height: 1.35 !important;
        /* Limitar a 2 linhas */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .eca-product-excerpt { display: none !important; }
    .eca-product-sku     { display: none !important; }
    .eca-product-attrs   { display: none !important; }
    .eca-product-footer {
        padding-top: 6px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }
    .eca-product-price {
        font-size: 14px !important;
        font-weight: 700 !important;
    }
    .eca-btn-cta {
        width: 100% !important;
        padding: 7px 8px !important;
        font-size: 12px !important;
        border-radius: 6px !important;
        justify-content: center !important;
    }
    /* Badge menor */
    .eca-badge {
        font-size: 9px !important;
        padding: 2px 7px !important;
        top: 6px !important;
        left: 6px !important;
    }

    /* ── Results count ── */
    .eca-results-count {
        display: block;
        font-size: 12px;
        margin-bottom: 8px;
        color: #9ca3af;
    }

    /* ── Popup — bottom sheet ── */
    .eca-popup-overlay { padding: 0; align-items: flex-end; }
    .eca-popup-box {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 94vh;
    }
    .eca-popup-inner    { grid-template-columns: 1fr; }
    .eca-popup-gallery  { padding: 20px 20px 12px; border-radius: 0; background: #f9fafb; }
    .eca-popup-main-img-wrap { aspect-ratio: 4 / 3; }
    .eca-popup-info     { padding: 16px 20px 24px; }
    .eca-popup-title    { font-size: 17px; }
    .eca-popup-price    { font-size: 20px; }
    .eca-popup-attrs    { grid-template-columns: 1fr; }
}

/* ── ≤ 480px (mobile pequeno) ───────────────────────────────── */
@media (max-width: 480px) {
    /* Manter 2 colunas mesmo em telas pequenas — grid já definido em 680px */

    /* Paginação compacta */
    .eca-page-btn { min-width: 30px; height: 30px; font-size: 12px; }

    /* Popup */
    .eca-popup-box  { max-height: 96vh; }
    .eca-popup-info { padding: 14px 16px 20px; }
}
    .eca-popup-inner { padding: 0; }
    .eca-popup-info  { padding: 14px 16px 20px; }
}

/* ================================================================
   FILTER DRAWER (mobile)
================================================================ */
.eca-filter-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99998;
    opacity: 0;
    transition: opacity .25s;
}
.eca-filter-drawer-overlay.is-open {
    display: block;
}
.eca-filter-drawer-overlay.is-visible {
    opacity: 1;
}
.eca-filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 88vw);
    background: #fff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: -4px 0 32px rgba(0,0,0,.15);
}
.eca-filter-drawer-overlay.is-visible .eca-filter-drawer {
    transform: translateX(0);
}
.eca-filter-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.eca-filter-drawer-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}
.eca-filter-drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #374151;
    transition: background .15s;
}
.eca-filter-drawer-close:hover { background: #e5e7eb; }
.eca-filter-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.eca-filter-drawer-body .eca-filter-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
}
.eca-filter-drawer-body .eca-filter-label {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 2px;
}
.eca-filter-drawer-body .eca-filter-btn {
    font-size: 13px !important;
    padding: 6px 14px !important;
}
.eca-filter-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
    display: flex;
    gap: 10px;
}
.eca-filter-drawer-apply {
    flex: 1;
    padding: 10px;
    background: #5433FF;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.eca-filter-drawer-apply:hover { background: #4526d4; }
.eca-filter-drawer-clear {
    padding: 10px 16px;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}
.eca-filter-drawer-clear:hover { background: #e5e7eb; }

/* ================================================================
   MOBILE TOPBAR — base styles (sempre oculto, ativado por media query)
   IMPORTANTE: display:none aqui é o default. A media query ≤680px
   usa !important para garantir que sobrescreve independente da ordem.
================================================================ */
.eca-mobile-topbar-row1,
.eca-mobile-topbar-row2 {
    display: none;
    width: 100%;
}
.eca-mobile-topbar-row1 {
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.eca-mobile-topbar-row2 {
    margin-bottom: 14px;
}
.eca-mobile-topbar-spacer {
    flex: 1;
}

/* Botão "Filtrar produtos" */
.eca-mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    background: #111827;
    border: none;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}
.eca-mobile-filter-btn:hover  { background: #374151; }
.eca-mobile-filter-btn.has-filters { background: #5433FF; }
.eca-mobile-filter-count {
    background: rgba(255,255,255,.25);
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    display: none;
}
.eca-mobile-filter-btn.has-filters .eca-mobile-filter-count { display: inline; }

/* Botão de ordenação (ícone) */
.eca-mobile-sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    cursor: pointer;
    transition: border-color .15s, color .15s;
    flex-shrink: 0;
}
.eca-mobile-sort-btn:hover { border-color: #5433FF; color: #5433FF; }

/* Search wrap */
.eca-mobile-search-wrap {
    position: relative;
    width: 100%;
}
.eca-mobile-search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
}
.eca-mobile-search-wrap .eca-search-input {
    width: 100%;
    padding-left: 36px;
}

/* Sort popover */
.eca-sort-btn-wrap { position: relative; }
.eca-sort-popover {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 9999;
    min-width: 180px;
    overflow: hidden;
    display: none;
}
.eca-sort-popover.is-open { display: block; }
.eca-sort-popover-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background .12s;
}
.eca-sort-popover-item:hover  { background: #f9fafb; }
.eca-sort-popover-item.active { color: #5433FF; font-weight: 600; background: #f5f3ff; }
