/**
 * File: frontend-marketplace.css
 * Status: Responsive Engine 3.0 (Mobile Inline Filter Fix)
 * Config: Tablet (4 Col), Mobile (1 Col + Inline Topbar).
 */

/* ---------------------------------------------------------
   1. TOTAL THEME CLEANUP
   --------------------------------------------------------- */
body.daf-marketplace-active .entry-header, 
body.daf-marketplace-active .page-header, 
body.daf-marketplace-active .entry-title,
body.daf-marketplace-active .ast-breadcrumbs,
body.daf-marketplace-active .breadcrumb,
body.daf-marketplace-active .hdaf-breadcrumbs,
body.daf-marketplace-active .breadcrumb-area { 
    display: none !important; 
}

body.daf-marketplace-active #content,
body.daf-marketplace-active .site-content,
body.daf-marketplace-active .hdaf-main,
body.daf-marketplace-active .hdaf-section,
body.daf-marketplace-active #primary { 
    padding-top: 0 !important; 
    margin-top: 0 !important;
    border: none !important;
}

/* ---------------------------------------------------------
   2. VIEWPORT BREAKOUT (100% Fluid Width)
   --------------------------------------------------------- */
.daf-marketplace-master {
    position: relative !important;
    z-index: 10 !important;
    width: 100vw !important;
    left: 50% !important;
    margin-left: -50vw !important;
    background-color: #f8fafc !important;
    min-height: 100vh;
    overflow-x: hidden !important; 
    margin-top: 0 !important;
}

/* ---------------------------------------------------------
   3. ⚡ ELITE FILTER BAR (Base Styles)
   --------------------------------------------------------- */
.daf-shop-top-bar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #ffffff !important;
    padding: 15px 25px !important;
    border-radius: 12px !important;
    border: 1px solid #cbd5e1 !important; 
    margin-bottom: 25px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
}

.daf-result-count {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin: 0 !important;
}

/* ---------------------------------------------------------
   4. MAIN LAYOUT (Flex Engine)
   --------------------------------------------------------- */
.daf-marketplace-layout {
    display: flex !important;
    gap: 30px !important;
    max-width: 1500px !important;
    width: 95% !important;
    margin: 0 auto !important;
    padding: 20px 0 40px !important; 
    align-items: start !important;
}

.daf-marketplace-content {
    flex: 1 !important;
    min-width: 0 !important;
}

#daf-marketplace-wrapper .daf-elite-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    column-gap: 15px !important;
    row-gap: 20px !important;
}

/* ---------------------------------------------------------
   5. SIDEBAR & WIDGETS
   --------------------------------------------------------- */
.daf-marketplace-sidebar {
    width: 320px !important;
    flex-shrink: 0 !important;
}

.daf-sidebar-widget {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
}

/* ---------------------------------------------------------
   6. 📱 RESPONSIVE BREAKPOINTS
   --------------------------------------------------------- */

/* --- TABLET (1024px and below) --- */
@media (max-width: 1024px) {
    .daf-marketplace-sidebar { display: none !important; }
    #daf-marketplace-wrapper .daf-elite-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        column-gap: 10px !important;
    }
}

/* --- SMALL TABLET (900px and below) --- */
@media (max-width: 900px) {
    #daf-marketplace-wrapper .daf-elite-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* --- MOBILE (767px and below) --- */
@media (max-width: 767px) {
    .daf-marketplace-sidebar { display: none !important; }
    #daf-marketplace-wrapper .daf-elite-grid {
        grid-template-columns: 1fr !important;
    }

    /* 🎯 THE MOBILE INLINE FILTER BAR FIX */
    .daf-shop-top-bar {
        flex-direction: row !important; /* Force Inline */
        justify-content: space-between !important;
        padding: 10px 15px !important;
        gap: 10px !important;
    }

    .daf-top-bar-left {
        flex: 1 !important; /* Take left half area */
        text-align: left !important;
    }

    .daf-result-count {
        font-size: 11px !important; /* Slightly smaller to fit on one line */
        white-space: nowrap !important;
    }

    .daf-top-bar-right {
        flex: 1 !important; /* Take right half area */
        display: flex !important;
        justify-content: flex-end !important;
    }

    .daf-ordering, .daf-orderby {
        width: 100% !important; /* Dropdown fills its half */
        max-width: 160px !important; /* But not too wide */
    }

    .daf-orderby {
        height: 36px !important;
        font-size: 12px !important;
        padding: 0 25px 0 8px !important;
        background-position: right 5px center !important;
        background-size: 14px !important;
    }

    .daf-marketplace-layout {
        padding-top: 15px !important;
    }
}