/* Mega Menu Styles - Professional */

/* Dropdown container */
.nav-link-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

/* The mega menu - HIDDEN by default */
.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid #e5e7eb;
    padding: 20px;
    z-index: 9999;
    min-width: 720px;
    margin-top: 4px;
}

/* Show mega menu on hover */
.nav-link-dropdown:hover .mega-menu {
    display: block;
}

/* Grid layout for columns */
.mega-menu-inner {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

/* Each category column */
.mega-menu-column {
    min-width: 100px;
}

/* Category group title */
.mega-menu-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 10px;
    cursor: pointer;
    padding-bottom: 6px;
    border-bottom: 2px solid #0D9488;
}

.mega-menu-title:hover {
    color: #0D9488;
}

/* Category list */
.mega-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-list li {
    font-size: 13px;
    color: #4B5563;
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.15s;
}

.mega-menu-list li:hover {
    color: #0D9488;
}

.mega-menu-list li.see-all {
    color: #0D9488;
    font-weight: 500;
    margin-top: 6px;
}

/* ============================================ */
/* Category cards grid (for /categories page) */
/* ============================================ */

.category-section {
    margin-bottom: 48px;
}

.category-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0D9488;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.category-card {
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-card:hover {
    border-color: #0D9488;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.category-card h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #111827;
}

/* ============================================ */
/* Category group cards on home page */
/* ============================================ */

.category-groups-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.category-group-card {
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.category-group-card:hover {
    border-color: #0D9488;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.category-group-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

/* ============================================ */
/* Listing detail page additions */
/* ============================================ */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-label {
    color: #6B7280;
    font-size: 13px;
}

.detail-value {
    font-weight: 500;
    color: #111827;
    font-size: 13px;
}

.check-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 6px;
}

.check-item.passed .check-status {
    color: #059669;
    font-weight: 500;
}

.check-item.failed .check-status {
    color: #DC2626;
    font-weight: 500;
}

.listing-detail-actions {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.gallery-thumbs {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.gallery-thumb {
    width: 72px;
    height: 54px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: all 0.2s;
}

.gallery-thumb:hover,
.gallery-thumb.active {
    opacity: 1;
    border-color: #0D9488;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.seller-logo {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: contain;
}

/* Admin Panel */
.admin-panel {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
}

.admin-panel h3 {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 12px;
}

.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-actions .btn {
    font-size: 13px;
    padding: 8px 12px;
}

/* ============================================ */
/* Responsive */
/* ============================================ */

@media (max-width: 1024px) {
    .mega-menu {
        display: none !important;
    }
    .category-groups-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .category-groups-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================ */
/* Mobile Search & Filter System */
/* ============================================ */

/* Mobile Search Header - Only visible on mobile */
.mobile-search-header {
    display: none;
    background: var(--white);
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mobile-search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.mobile-search-input-wrapper svg {
    position: absolute;
    left: 12px;
    color: #9CA3AF;
}

.mobile-search-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: #f9fafb;
}

.mobile-search-input:focus {
    outline: none;
    border-color: #0D9488;
    background: white;
}

.mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    white-space: nowrap;
}

.filter-badge {
    background: white;
    color: #0D9488;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 2px;
}

/* Mobile Filter Drawer */
.mobile-filter-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 360px;
    height: 100%;
    height: 100dvh;
    background: white;
    z-index: 2000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-filter-drawer.active {
    right: 0;
}

.mobile-filter-drawer-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
}

.mobile-filter-drawer-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.mobile-filter-drawer-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mobile-filter-drawer-footer {
    flex-shrink: 0;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    background: white;
}

.mobile-filter-drawer-footer .btn {
    flex: 1;
}

.mobile-filter-section {
    margin-bottom: 24px;
}

.mobile-filter-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.mobile-price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-price-inputs span {
    color: #9CA3AF;
    font-size: 13px;
}

.mobile-price-inputs .form-input {
    flex: 1;
}

/* Filter Chips */
.mobile-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: #0D9488;
}

.filter-chip.active {
    background: #0D9488;
    border-color: #0D9488;
    color: white;
}

/* Filter Overlay */
.mobile-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.mobile-filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Active Filters Bar */
.active-filters-bar {
    background: #f9fafb;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    color: #374151;
}

.active-filter-chip button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #9CA3AF;
    font-size: 12px;
    line-height: 1;
}

.active-filter-chip button:hover {
    color: #DC2626;
}

/* Desktop Only Helper */
.desktop-only {
    display: block;
}

/* Browse Layout */
.browse-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

/* Responsive */
@media (max-width: 900px) {
    .mobile-search-header {
        display: block;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .browse-layout {
        grid-template-columns: 1fr !important;
    }
    
    .filter-sidebar {
        display: none;
    }
    
    .search-section.desktop-only {
        display: none;
    }
}

@media (min-width: 901px) {
    .mobile-search-header {
        display: none;
    }
    
    .mobile-filter-drawer,
    .mobile-filter-overlay {
        display: none !important;
    }
}

/* ============================================ */
/* Price Range Slider */
/* ============================================ */

.price-slider-container {
    padding: 8px 0;
}

.price-slider-values {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.price-slider-track {
    position: relative;
    height: 40px;
}

.price-slider {
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    top: 50%;
    transform: translateY(-50%);
}

.price-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #0D9488;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    margin-top: -9px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    z-index: 10;
}

.price-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 8px rgba(0,0,0,0.35);
}

.price-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
}

.price-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #0D9488;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.price-slider-min {
    z-index: 3;
}

.price-slider-max {
    z-index: 2;
}

/* Mobile Search Button */
.mobile-search-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #6B7280;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-search-btn:hover {
    border-color: #0D9488;
    background: white;
}

.mobile-search-btn svg {
    color: #9CA3AF;
    flex-shrink: 0;
}

.mobile-search-btn span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Update mobile filter chips to not auto-submit */
.mobile-filter-chips .filter-chip {
    transition: all 0.15s;
}

.mobile-filter-chips .filter-chip.active {
    background: #0D9488;
    border-color: #0D9488;
    color: white;
}

/* ============================================ */
/* Price Preset Buttons */
/* ============================================ */

.price-preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.price-preset-grid-desktop {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.price-preset {
    padding: 10px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.price-preset:hover {
    border-color: #0D9488;
    color: #0D9488;
}

.price-preset.active {
    background: #0D9488;
    border-color: #0D9488;
    color: white;
}

/* Ensure drawer body is scrollable and doesn't affect page */
.mobile-filter-drawer-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px;
    padding-bottom: 24px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

/* Overlay should prevent scroll through */
.mobile-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    touch-action: none;
}

.mobile-filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================ */
/* Mobile Listing Detail */
/* ============================================ */

.mobile-listing-header {
    display: none;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.mobile-listing-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
    color: #111827;
}

.mobile-listing-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0D9488;
    margin-bottom: 8px;
}

.mobile-listing-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #6B7280;
}

.mobile-listing-actions {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    gap: 8px;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

@media (max-width: 1024px) {
    .mobile-listing-header {
        display: block;
    }
    
    .mobile-listing-actions {
        display: flex;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .listing-detail {
        padding-bottom: 80px;
    }
}

@media (min-width: 1025px) {
    .mobile-listing-header,
    .mobile-listing-actions {
        display: none !important;
    }
}

/* ============================================ */
/* Pricing Page - Mobile Responsive */
/* ============================================ */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.pricing-card {
    text-align: center;
    position: relative;
}

.pricing-card.pricing-featured {
    border-width: 2px;
}

.pricing-icon {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
}

.pricing-card .card-body {
    padding: 32px 20px;
}

.pricing-title {
    margin: 8px 0;
    font-size: 16px;
    font-weight: 700;
}

.pricing-features {
    text-align: left;
    list-style: none;
    margin: 20px 0;
    padding: 0;
    font-size: 13px;
}

.pricing-features li {
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-features .check {
    color: var(--primary);
    flex-shrink: 0;
}

.pricing-price {
    font-size: 32px;
    font-weight: 700;
    margin: 20px 0;
}

@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .pricing-card .card-body {
        padding: 24px 16px;
    }
    
    .pricing-price {
        font-size: 28px;
    }
}
