/**
 * Diamond Search Plugin Styles
 * Minimal layout-focused CSS that works with WordPress themes
 * 
 * DESIGN PRINCIPLE: Sharp, angular look - NO ROUNDED CORNERS anywhere
 * This matches the diamond aesthetic and maintains consistency across all elements
 */

/* Main Container */
.diamond-search-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Search Header */
.diamond-search-header {
    text-align: center;
    margin-bottom: 20px;
}

/* SunDiamond palette (match rings search) */
.diamond-search-wrapper {
    --diamond-primary: var(--sd-primary-color, #ff6b6b);
    --diamond-primary-hover: var(--sd-primary-hover, #ff5252);
    --diamond-primary-light: var(--sd-primary-light, #ffe5e5);
    --diamond-text-color: var(--sd-text-color, #333);
    --diamond-border-color: var(--sd-border-color, #e0e0e0);
}

.search-title {
    margin-bottom: 10px;
}

.search-subtitle {
    opacity: 0.7;
    font-size: 16px;
}

/* Diamond Type Toggle */
.diamond-type-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

.diamond-type-toggle {
    display: flex;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    max-width: 450px;
    width: 100%;
}

.toggle-option {
    flex: 1;
    padding: 8px 12px;
    background: white;
    border: none;
    color: #666;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    margin: 0;
    border-radius: 0; /* FLAT UI: No rounded corners */
    position: relative;
    overflow: hidden;
    line-height: 1.2;
}

.toggle-option:hover {
    background: #f0f0f0;
    color: #333;
}

.toggle-option.active {
    background: var(--diamond-primary);
    color: white;
    font-weight: 600;
}

.toggle-option:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

/* Responsive toggle styles */
@media (max-width: 768px) {
    .diamond-type-toggle-container {
        margin-bottom: 4px;
    }
    
    .diamond-type-toggle {
        max-width: 100%;
    }
    
    .toggle-option {
        padding: 3px 10px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .toggle-option {
        padding: 2px 8px;
        font-size: 9px;
    }
}

/* Search Controls */
.diamond-search-controls {
    margin-bottom: 30px;
}

/* Compact Single Row Layout */
.search-controls-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.results-info-row {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

/* Smart View Toggle */
.view-toggle-smart {
    display: flex;
}

.smart-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
    min-width: 80px;
    justify-content: center;
    margin: 0; /* Override theme button margins */
}

.smart-toggle-btn:hover {
    background: #f8f9fa;
    color: #333;
    border-color: #0073aa;
}

.smart-toggle-btn .toggle-icon {
    width: 16px;
    height: 16px;
    transition: all 0.2s ease;
}

.smart-toggle-btn .toggle-text {
    font-weight: 500;
}

/* Desktop Reset Control - FLAT UI DESIGN: No rounded corners, clean lines */
.desktop-reset-control {
    display: flex;
    align-items: center;
}

.desktop-reset-filters-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    cursor: pointer;
    font-size: 14px;
    color: var(--diamond-primary);
    font-weight: 500;
    border-radius: 0; /* FLAT UI: No rounded corners for buttons */
    transition: all 0.2s ease;
    margin: 0; /* Override theme button margins */
    min-width: 80px;
    justify-content: center;
}

.desktop-reset-filters-btn:hover {
    background: var(--diamond-primary);
    color: white;
    border-color: var(--diamond-primary);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.desktop-reset-filters-btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(255, 107, 107, 0.3);
}

.desktop-reset-filters-btn .reset-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.desktop-reset-filters-btn:hover .reset-icon {
    transform: rotate(-360deg);
}

.desktop-reset-filters-btn .reset-text {
    font-weight: 500;
}

/* Shape responsive breakpoints */
@media (max-width: 1200px) {
    .shape-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 6px;
    }
    
    .shape-option {
        padding: 10px 6px;
        min-height: 65px;
    }
    
    .shape-label {
        font-size: 10px;
    }
}

@media (max-width: 900px) {
    .shape-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
        gap: 4px;
    }
    
    .shape-option {
        padding: 8px 4px;
        min-height: 60px;
    }
    
    .shape-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .shape-label {
        font-size: 9px;
    }
}

@media (max-width: 600px) {
    .shape-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 6px;
    }
    
    .shape-option {
        padding: 8px 4px;
        min-height: 58px;
    }
    
    .shape-label {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .shape-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
        gap: 4px;
    }
    
    .shape-option {
        padding: 6px 2px;
        min-height: 55px;
    }
    
    .shape-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .shape-label {
        font-size: 8px;
    }
}

@media (max-width: 360px) {
    .shape-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 3px;
    }
    
    .shape-option {
        padding: 4px 1px;
        min-height: 50px;
    }
    
    .shape-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .shape-label {
        font-size: 7px;
    }
}

/* Hide desktop reset on mobile */
@media (max-width: 768px) {
    .desktop-reset-control {
        display: none;
    }
}

/* Sort Control */
.sort-control {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}



.sort-dropdown {
    min-width: 200px;
    padding: 8px 32px 8px 12px;
    border: 1px solid #e0e0e0;
    background: white;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666'%3E%3Cpath d='M8 10L4 6h8l-4 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    margin: 0; /* Override theme button margins */
}

.sort-dropdown:hover {
    border-color: #0073aa;
    background-color: #f8f9fa;
}

.sort-dropdown:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.sort-dropdown option {
    padding: 8px 12px;
    font-weight: 500;
}

/* Results Container */
.diamond-results {
    min-height: 400px;
    position: relative;
}

/* Grid View */
.results-grid {
    display: none;
}

.results-grid.active {
    display: block;
}

.diamonds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

/* Diamond Cards */
.diamond-card {
    border: 1px solid #e0e0e0;
    padding: 0;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 340px;
}

.diamond-card:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.diamond-image {
    width: 100%;
    height: 240px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.diamond-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.03);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.diamond-card:hover .diamond-image::after {
    opacity: 1;
}

.diamond-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.diamond-card:hover .diamond-image img {
    transform: scale(1.05);
}

.diamond-image .image-placeholder {
    font-size: 14px;
    opacity: 0.4;
    color: #666;
    font-weight: 500;
}

/* 360° Video Icon */
.video-360-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 3;
}

.video-360-icon img {
    width: 150%;
    height: 150%;
    object-fit: contain;
}

/* Discount Badge - Top Left Corner - Very subtle styling */
.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(100, 100, 100, 0.6);
    color: rgba(255, 255, 255, 0.9);
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 500;
    border-radius: 0;
    z-index: 3;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.diamond-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    background: white;
    padding: 12px;
    transition: all 0.3s ease;
}

.diamond-card:hover .diamond-content {
    bottom: 0;
}

.diamond-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.diamond-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: #333;
}

.diamond-price {
    font-size: 16px;
    font-weight: 700;
    color: #0073aa;
}

/* Discount pricing styles */
.diamond-price .original-price {
    text-decoration: line-through;
    color: #999;
    font-weight: 400;
    margin-right: 8px;
    font-size: 14px;
}

.diamond-price .discounted-price {
    color: #0073aa;
    font-weight: 700;
}

/* List view discount pricing styles */
.diamonds-table .original-price {
    text-decoration: line-through;
    color: #999;
    font-weight: 400;
    margin-right: 8px;
    font-size: 14px;
}

.diamonds-table .discounted-price {
    color: #0073aa;
    font-weight: 700;
}

.diamond-specs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    justify-content: space-between;
}

.spec-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.spec-badge {
    background: transparent;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    margin-bottom: 2px;
    min-width: 40px;
}

.spec-label {
    font-size: 10px;
    color: #666;
    font-weight: 500;
    text-transform: capitalize;
}

.diamond-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    opacity: 0;
    visibility: hidden;
    height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.diamond-card:hover .diamond-actions {
    opacity: 1;
    visibility: visible;
    height: auto;
}

.btn-view-details {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    background: white;
    color: #333;
}

.btn-add-cart {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #e0e0e0;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    background: transparent;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-view-details:hover {
    background: #f8f9fa;
    border-color: #333;
    color: #333;
}

.btn-add-cart:hover {
    background: #f8f9fa;
    border-color: #333;
    transform: scale(1.05);
}

/* List View */
.results-list {
    display: none;
}

.results-list.active {
    display: block;
}

.list-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    background: white;
}

.diamonds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.diamonds-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.diamonds-table td {
    padding: 8px 8px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.diamonds-table tr:hover {
    background: #f8f9fa;
}

.table-image {
    width: 50px;
    height: 50px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.table-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.table-image .image-placeholder {
    font-size: 10px;
    opacity: 0.4;
    color: #666;
}

.grade-badge {
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 40px;
}

.grade-badge.color-d { background: #e8f5e8; color: #2e7d2e; }
.grade-badge.color-e { background: #e8f5e8; color: #2e7d2e; }
.grade-badge.color-f { background: #fff3cd; color: #856404; }
.grade-badge.color-g { background: #fff3cd; color: #856404; }
.grade-badge.color-h { background: #ffeaa7; color: #6c5700; }
.grade-badge.color-i { background: #ffeaa7; color: #6c5700; }
.grade-badge.color-j { background: #ffe0b3; color: #8b4513; }

.grade-badge.clarity-fl { background: #e8f5e8; color: #2e7d2e; }
.grade-badge.clarity-if { background: #e8f5e8; color: #2e7d2e; }
.grade-badge.clarity-vvs1 { background: #fff3cd; color: #856404; }
.grade-badge.clarity-vvs2 { background: #fff3cd; color: #856404; }
.grade-badge.clarity-vs1 { background: #ffeaa7; color: #6c5700; }
.grade-badge.clarity-vs2 { background: #ffeaa7; color: #6c5700; }

.table-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.loading-indicator.show {
    display: block;
}

.loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #666;
    font-size: 16px;
}

/* End of Results */
.end-of-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 40px 20px;
}

.error-content h3 {
    color: #d63384;
    margin-bottom: 10px;
}

.error-message {
    color: #666;
    margin-bottom: 20px;
}

.retry-button {
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.retry-button:hover {
    background: #005a87;
}

/* Loading Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .diamond-search-wrapper {
        padding: 12px;
    }
    
    .shape-filter-section {
        padding: 14px;
        margin-bottom: 20px;
    }
    
    .shape-filter-grid {
        grid-template-columns: repeat(10, 1fr);
        gap: 8px;
    }
    
    .shape-option {
        padding: 10px 4px;
        min-height: 64px;
        border-radius: 0; /* FLAT UI: No rounded corners */
    }
    
    .shape-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .shape-label {
        font-size: 10px;
    }
    
    .search-controls-compact {
        flex-direction: row;
        gap: 8px;
        align-items: center;
    }
    
    .mobile-filter-controls {
        width: 28%;
    }
    
    .sort-control {
        width: 62%;
        display: flex;
        justify-content: center;
    }
    
    .sort-dropdown {
        width: 100%;
    }
    
    .view-toggle-smart {
        width: 10%;
    }
    
    .smart-toggle-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .smart-toggle-btn .toggle-text {
        display: none;
    }
    
    .diamonds-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .diamond-card {
        height: 320px;
    }
    
    .diamond-image {
        height: 200px;
    }
    
    .video-360-icon {
        width: 28px;
        height: 28px;
        top: 6px;
        right: 6px;
    }
    
    .discount-badge {
        font-size: 10px;
        padding: 2px 6px;
        top: 6px;
        left: 6px;
        letter-spacing: 0.2px;
    }
    
    .diamond-content {
        padding: 10px;
    }
    
    .diamond-title {
        font-size: 13px;
    }
    
    .diamond-price {
        font-size: 15px;
    }
    
    .diamond-specs {
        gap: 6px;
        margin-bottom: 0;
    }
    
    .spec-badge {
        font-size: 11px;
        padding: 3px 6px;
        min-width: 35px;
    }
    
    .spec-label {
        font-size: 9px;
    }
    
    .diamond-actions {
        margin-top: 10px;
        gap: 6px;
    }
    
    .btn-view-details {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .btn-add-cart {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .diamonds-table {
        font-size: 11px;
    }
    
    .diamonds-table th,
    .diamonds-table td {
        padding: 6px 4px;
    }
    
    .table-image {
        width: 40px;
        height: 40px;
    }
    
    .grade-badge {
        font-size: 10px;
        padding: 2px 6px;
        min-width: 30px;
    }
}

@media (max-width: 480px) {
    .diamond-search-wrapper {
        padding: 8px;
    }
    
    .shape-filter-section {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .filter-section-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .shape-filter-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    
    .shape-option {
        padding: 8px 3px;
        min-height: 56px;
        border-radius: 0; /* FLAT UI: No rounded corners */
    }
    
    .shape-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .shape-label {
        font-size: 9px;
    }
    
    .diamonds-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .diamond-card {
        height: 240px;
        max-width: 100%;
    }
    
    .diamond-image {
        height: 160px;
    }
    
    .video-360-icon {
        width: 24px;
        height: 24px;
        top: 6px;
        right: 6px;
        padding: 2px;
    }
    
    .discount-badge {
        font-size: 10px;
        padding: 2px 6px;
        top: 6px;
        left: 6px;
    }
    
    .diamond-content {
        padding: 6px;
    }
    
    .diamond-title {
        font-size: 12px;
        line-height: 1.3;
    }
    
    .diamond-price {
        font-size: 14px;
    }
    
    .diamond-price .original-price {
        font-size: 12px;
        margin-right: 6px;
    }
    
    .diamond-specs {
        gap: 2px;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    
    .spec-item {
        flex: 1;
        min-width: 35px;
        max-width: none;
    }
    
    .spec-badge {
        font-size: 9px;
        padding: 2px 2px;
        min-width: 25px;
        width: 100%;
    }
    
    .spec-label {
        font-size: 7px;
    }
    
    .diamond-actions {
        margin-top: 6px;
        gap: 6px;
    }
    
    .btn-view-details {
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .btn-add-cart {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .sort-control {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
    
    .sort-dropdown {
        min-width: 100%;
        max-width: 280px;
    }
    
    .view-toggle {
        gap: 0;
    }
    
    .view-btn {
        font-size: 0;
        padding: 12px;
        min-width: 44px;
        justify-content: center;
    }
    
    .view-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .diamonds-table th {
        font-size: 10px;
        padding: 8px 4px;
    }
    
    .diamonds-table td {
        font-size: 11px;
        padding: 8px 4px;
    }
    
    .table-image {
        width: 35px;
        height: 35px;
    }
}

/* Two Column Filter Layout */
.filters-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    padding: 12px 20px;
}

.filters-left-column,
.filters-right-column {
    display: flex;
    flex-direction: column;
}

.filters-left-column {
    border-right: 1px solid #f0f0f0;
    padding-right: 12px;
}

.filters-right-column {
    padding-left: 12px;
}

.slider-container-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Shape Filter Section */
.shape-filter-section {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    padding: 12px 20px;
    margin-bottom: 20px;
}

.filter-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
    text-align: center;
}

.shape-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    gap: 8px;
    max-width: 100%;
}

.shape-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 2px solid #e5e5e5;
    cursor: pointer;
    background: #ffffff;
    min-height: 70px;
    justify-content: center;
    border-radius: 0; /* FLAT UI: No rounded corners */
}

.shape-option:hover {
    border-color: var(--diamond-primary);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.1);
    transform: translateY(-1px);
}

.shape-option.selected {
    border-color: var(--diamond-primary);
    background: rgba(255, 107, 107, 0.05);
    box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.2);
}

.shape-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--diamond-primary);
    margin-bottom: 4px;
    line-height: 1;
}

.shape-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.shape-option:hover .shape-icon,
.shape-option.selected .shape-icon {
    color: var(--diamond-primary);
}

.shape-label {
    font-size: 11px;
    color: #666;
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
}

.shape-option:hover .shape-label,
.shape-option.selected .shape-label {
    color: var(--diamond-primary);
}

/* Filter Sliders Section */
.filter-sliders-section {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 0;
}

/* Legacy horizontal layout - not used in 2-column design */
.slider-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 100%;
}

.filter-slider-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-header {
    display: flex;
    align-items: center;
    gap: 4px;
}

.slider-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.slider-info-icon {
    color: #666;
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.slider-info-icon:hover {
    opacity: 1;
}

.slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* noUiSlider Custom Styling to Match Design */
.range-slider {
    margin: 12px 0 8px 0;
    height: 6px;
}

/* Base slider styling */
.range-slider .noUi-base {
    width: 100%;
    height: 6px;
    position: relative;
    max-width: 100%;
    margin: 0;
    box-shadow: none;
    border-radius: 0; /* FLAT UI: No rounded corners */
}

.range-slider .noUi-connects {
    overflow: hidden;
    z-index: 0;
    border-radius: 0; /* FLAT UI: No rounded corners */
}

.range-slider .noUi-connect,
.range-slider .noUi-origin {
    will-change: transform;
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    height: 6px;
    width: 100%;
    transform-origin: 0 0;
    transform-style: preserve-3d;
    background: none;
}

/* Track background */
.range-slider .noUi-target {
    position: relative;
    background: #e5e5e5;
    border-radius: 0; /* FLAT UI: No rounded corners */
    border: 0;
    box-shadow: none;
    touch-action: manipulation;
    cursor: pointer;
}

/* Active track */
.range-slider .noUi-connect {
    background: var(--diamond-primary);
}

/* Handles */
.range-slider .noUi-handle {
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    position: absolute;
    right: -12px;
    top: -9px;
    cursor: grab;
    background: var(--diamond-primary);
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    outline: none;
}

.range-slider .noUi-handle:before,
.range-slider .noUi-handle:after {
    content: none;
}

.range-slider .noUi-handle:hover {
    background: var(--diamond-primary-hover);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    transform: scale(1.1);
}

.range-slider .noUi-handle:active,
.range-slider .noUi-handle.noUi-active {
    cursor: grabbing;
    background: var(--diamond-primary-hover);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    transform: scale(1.15);
}

.range-slider .noUi-handle:focus {
    outline: none;
}

/* Handle z-index */
.range-slider .noUi-handle.noUi-handle-lower {
    z-index: 2;
}

.range-slider .noUi-handle.noUi-handle-upper {
    z-index: 2;
}

/* Touch styles */
.range-slider .noUi-touch-area {
    height: 100%;
    width: 100%;
}

/* Disable default tooltips */
.range-slider .noUi-tooltip {
    display: none;
}

/* Range Inputs */
.range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 0;
}

.input-group label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.range-input {
    padding: 10px 12px;
    border: 2px solid #e5e5e5;
    border-radius: 0; /* FLAT UI: No rounded corners */
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: #ffffff;
    transition: all 0.2s ease;
    touch-action: manipulation;
    margin-bottom: 0;
}

.range-input:focus {
    outline: none;
    border-color: var(--diamond-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.range-input:hover {
    border-color: var(--diamond-primary);
}

/* Input with Prefix (like $ sign) */
.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.input-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #666;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.input-with-prefix .range-input {
    padding-left: 24px;
    padding-right: 12px;
}

/* Price Quick Select Buttons */
.price-quick-select {
    margin-top: 8px;
    text-align: center;
}

.quick-select-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.quick-select-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    align-items: center;
}

/* Quick select buttons use theme classes: button primary is-outline box-shadow-2 box-shadow-2-hover is-xsmall */

/* Override global theme button margins for quick select buttons */
.quick-select-btn,
.carat-quick-select-btn,
.quick-select-buttons button,
.quick-select-buttons .button {
    margin-bottom: 0;
}

/* Override theme margin for quick select filter buttons only */
.quick-select-btn, .price-quick-select button {
    margin-right: 0;
}

/* Override right margin for popular carat size buttons */
.carat-quick-select-btn {
    margin-right: 0;
}

/* Override Flatsome theme colors for preset quick select buttons */
.quick-select-btn.button.secondary.is-outline,
.carat-quick-select-btn.button.secondary.is-outline {
    border-color: #fe5b68 !important;
    color: #fe5b68 !important;
}

.quick-select-btn.button.secondary.is-outline:hover,
.carat-quick-select-btn.button.secondary.is-outline:hover {
    background-color: #fe5b68 !important;
    border-color: #fe5b68 !important;
    color: white !important;
}

/* Carat Quick Select Buttons */
.carat-quick-select {
    margin-top: 8px;
    text-align: center;
}

/* Fancy Color Buttons */
.fancy-color-filter .fancy-color-buttons {
    display: grid;
    /* Fixed 5-column grid for even, organized layout */
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
}

.fancy-color-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	padding: 8px 10px;
	border: 1px solid #e0e0e0;
	background: #fff;
	cursor: pointer;
	border-radius: 0;
	transition: all 0.2s ease;
	min-height: 50px;
	justify-content: center;
}

.fancy-color-btn:hover {
	background: #f8f9fa;
	border-color: #0073aa;
}

.fancy-color-btn .swatch {
	width: 18px;
	height: 18px;
	background-color: var(--fancy-color);
	-webkit-mask-image: url('../images/round.svg');
	mask-image: url('../images/round.svg');
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
}

.fancy-color-btn.selected {
	border-color: var(--diamond-primary) !important;
	background: rgba(255, 107, 107, 0.05) !important;
	box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.2) !important;
}

.fancy-color-btn:focus {
	border-color: var(--diamond-primary);
	background: rgba(255, 107, 107, 0.05);
	box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.2);
}

.fancy-color-btn span {
	font-size: 9px;
	color: #333;
	text-align: center;
	line-height: 1.1;
}

/* Responsive adjustments for fancy color buttons - maintain 5 per row */
@media (max-width: 1024px) {
	.fancy-color-filter .fancy-color-buttons {
		/* Maintain 5-column grid */
		grid-template-columns: repeat(5, 1fr);
		gap: 6px;
	}
	.fancy-color-btn { 
		min-height: 46px;
		padding: 7px 8px;
	}
}

@media (max-width: 768px) {
	.fancy-color-filter .fancy-color-buttons {
		/* 5 per row on tablet */
		grid-template-columns: repeat(5, 1fr);
		gap: 6px;
	}
	.fancy-color-btn { 
		min-height: 44px;
		padding: 6px 4px;
	}
	.fancy-color-btn .swatch { width: 16px; height: 16px; }
	.fancy-color-btn span { font-size: 9px; }
}

@media (max-width: 600px) {
	.fancy-color-filter .fancy-color-buttons {
		/* 5 per row on mobile for larger, more organized buttons */
		grid-template-columns: repeat(5, 1fr);
		gap: 5px;
	}
	.fancy-color-btn {
		min-height: 42px;
		padding: 5px 3px;
	}
	.fancy-color-btn span { font-size: 8px; }
}

@media (max-width: 480px) {
	.fancy-color-filter .fancy-color-buttons {
		/* 5 per row even on very small screens */
		grid-template-columns: repeat(5, 1fr);
		gap: 4px;
	}
	.fancy-color-btn {
		min-height: 40px;
		padding: 4px 2px;
	}
	.fancy-color-btn .swatch { width: 14px; height: 14px; }
	.fancy-color-btn span { font-size: 7px; }
}

/* Grade Range Filters */
.grade-filters-section {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 0;
}

.grade-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.grade-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grade-header {
    display: flex;
    align-items: center;
    gap: 4px;
}

.grade-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.grade-range-wrapper {
    position: relative;
}

.grade-range {
    position: relative;
    height: 6px;
    background: #e5e5e5;
    margin: 16px 0 8px 0;
    cursor: pointer;
}

.grade-range .range-track {
    position: absolute;
    height: 100%;
    background: var(--diamond-primary);
    pointer-events: none;
}

.grade-range .range-handle {
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    background: var(--diamond-primary);
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: grab;
    transform: translate(-50%, -50%);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.grade-range .range-handle:hover {
    background: var(--diamond-primary-hover);
    box-shadow: 0 3px 8px rgba(255, 107, 107, 0.3);
    transform: translate(-50%, -50%) scale(1.1);
}

.grade-range .range-handle:active,
.grade-range .range-handle.dragging {
    cursor: grabbing;
    background: var(--diamond-primary-hover);
    box-shadow: 0 3px 8px rgba(255, 107, 107, 0.3);
    transform: translate(-50%, -50%) scale(1.15);
}

.grade-scale {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    position: relative;
}

.grade-item {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    padding: 4px 2px;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 24px;
}

.grade-item:hover {
    color: var(--diamond-primary);
    background: rgba(255, 107, 107, 0.1);
}

.grade-item.selected {
    color: var(--diamond-primary);
    background: rgba(255, 107, 107, 0.15);
    font-weight: 600;
}

.grade-item.in-range {
    color: var(--diamond-primary);
    background: rgba(255, 107, 107, 0.1);
}

/* Laboratory Filter */
.lab-filter-wrapper {
    position: relative;
    margin-bottom: 24px;
}

.lab-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
    align-items: center;
}

.lab-option {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    background: #f8f9fa;
    border: 2px solid #e5e5e5;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 50px;
    margin-bottom: 0;
    border-radius: 0; /* FLAT UI: No rounded corners */
}

.lab-option:hover {
    color: var(--diamond-primary);
    border-color: var(--diamond-primary);
    background: rgba(255, 107, 107, 0.1);
}

.lab-option.selected {
    color: white;
    background: var(--diamond-primary);
    border-color: var(--diamond-primary);
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Switch to single column on mobile */
    .filters-two-column {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 10px 16px;
    }
    
    .filters-left-column {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding-right: 0;
        padding-bottom: 12px;
    }
    
    .filters-right-column {
        padding-left: 0;
        padding-top: 12px;
    }
    
    .filter-sliders-section {
        padding: 0;
        margin-bottom: 0;
    }
    
    .slider-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .slider-title {
        font-size: 16px;
    }
    
    .range-slider {
        margin: 10px 0 6px 0;
        height: 8px;
    }
    
    /* Mobile noUiSlider styling */
    .range-slider .noUi-base {
        height: 8px;
    }

    .range-slider .noUi-connect,
    .range-slider .noUi-origin {
        height: 8px;
    }

    .range-slider .noUi-handle {
        width: 30px;
        height: 30px;
        right: -15px;
        top: -11px;
        border-width: 2px;
    }
    
    .range-inputs {
        gap: 4px;
    }
    
    .range-input {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Price quick select mobile styles */
    .price-quick-select {
        margin-top: 8px;
    }
    
    .quick-select-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .quick-select-buttons {
        gap: 2px;
    }
    
    /* Grade filter mobile styles */
    .grade-filters-section {
        padding: 0;
        margin-bottom: 0;
    }
    
    .grade-container {
        gap: 10px;
    }
    
    .grade-scale {
        flex-wrap: wrap;
        gap: 2px;
        justify-content: space-around;
    }
    
    .grade-item {
        font-size: 11px;
        min-width: 20px;
        padding: 3px 1px;
    }
    
    .grade-range .range-handle {
        width: 30px;
        height: 30px;
    }
    
    /* Lab filter mobile styles */
    .lab-options {
        gap: 2px;
    }
    
    .lab-option {
        font-size: 11px;
        padding: 4px 8px;
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    .filters-two-column {
        gap: 12px;
        padding: 8px 12px;
    }
    
    .filters-left-column {
        padding-bottom: 8px;
    }
    
    .filters-right-column {
        padding-top: 8px;
    }
    
    .filter-sliders-section {
        padding: 0;
        margin-bottom: 0;
    }
    
    .slider-container {
        gap: 20px;
    }
    
    .slider-title {
        font-size: 15px;
    }
    
    .range-slider {
        margin: 12px 0;
        height: 10px;
    }
    
    /* Small mobile noUiSlider styling */
    .range-slider .noUi-base {
        height: 10px;
    }

    .range-slider .noUi-connect,
    .range-slider .noUi-origin {
        height: 10px;
    }

    .range-slider .noUi-handle {
        width: 30px;
        height: 30px;
        right: -15px;
        top: -10px;
        border-width: 2px;
    }
    
    .range-input {
        padding: 14px 12px;
        font-size: 16px;
    }
}

/* Mobile Filter Overlay Styles */
.mobile-filter-btn {
    display: none;
    position: relative;
    background: var(--diamond-primary);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    margin: 0; /* Override theme button margins */
}

.mobile-filter-btn:hover {
    background: rgb(133, 100, 202);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.mobile-filter-btn:active {
    transform: translateY(0);
}

.mobile-filter-btn .filter-icon {
    width: 18px;
    height: 18px;
}

.mobile-filter-btn .filter-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    min-width: 20px;
}

.mobile-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    /* Improved iOS Safari handling */
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for modern browsers */
    /* Ensure flex container has proper dimensions */
    max-height: 100vh;
    max-height: 100dvh;
}

.mobile-filter-overlay.active {
    display: flex;
    flex-direction: column;
    transform: translateY(0);
}

.mobile-filter-header {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid #e5e5e5;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* Prevent content overflow */
    overflow: visible;
    min-height: 70px;
}

.mobile-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.mobile-filter-close {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0; /* FLAT UI: No rounded corners */
    width: 48px;
    height: 48px;
    transition: all 0.2s ease;
    margin: 0 !important;
}

.mobile-filter-close:hover {
    background: rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.2);
    transform: scale(1.05);
}

.mobile-filter-close:active {
    transform: scale(0.95);
}

.mobile-filter-close svg {
    width: 28px;
    height: 28px;
    color: #333;
    stroke-width: 2.5;
}

/* Mobile Reset Filters Button */
.mobile-reset-filters-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    cursor: pointer;
    font-size: 14px;
    color: var(--diamond-primary);
    font-weight: 500;
    border-radius: 0; /* FLAT UI: No rounded corners for buttons */
    transition: all 0.2s ease;
    margin: 0 !important;
}

.mobile-reset-filters-btn:hover {
    background: var(--diamond-primary);
    color: white;
    border-color: var(--diamond-primary);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.mobile-reset-filters-btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(255, 107, 107, 0.3);
}

.mobile-reset-filters-btn .reset-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.mobile-reset-filters-btn:hover .reset-icon {
    transform: rotate(-360deg);
}

.mobile-filter-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Remove problematic -webkit-overflow-scrolling: touch */
    padding: 24px 20px 40px 20px;
    /* Ensure content doesn't get stuck at bottom */
    min-height: 0;
    /* Force scrolling context */
    height: 0;
    /* Smooth scrolling on supported browsers */
    scroll-behavior: smooth;
    /* Webkit scrolling optimization for iOS */
    -webkit-transform: translateZ(0);
    /* Fallback height for browsers that struggle with flex + height: 0 */
    min-height: calc(100vh - 160px);
    min-height: calc(100dvh - 160px);
}

/* Static Apply Button Container */
.mobile-filter-actions {
    flex-shrink: 0;
    background: white;
    padding: 20px;
    border-top: 1px solid #e5e5e5;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    /* Handle safe area insets properly */
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

.mobile-apply-btn {
    width: 100%;
    background: var(--diamond-primary);
    color: white;
    border: none;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0; /* FLAT UI: No rounded corners */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px; /* Touch-friendly height */
    margin: 0;
}

.mobile-apply-btn:hover,
.mobile-apply-btn:active {
    background: rgb(133, 100, 202);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.mobile-apply-btn:disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mobile-apply-btn .apply-icon {
    width: 20px;
    height: 20px;
}

/* Ensure proper spacing for iOS Safari */
@media (max-width: 600px) {
    .mobile-filter-content {
        padding-bottom: 30px;
    }
    
    .mobile-filter-actions {
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
    
    .mobile-apply-btn {
        padding: 14px 18px;
        font-size: 15px;
        min-height: 52px;
    }
}

/* Mobile filter styling for shared elements */
.mobile-filter-overlay .shape-filter-section {
    margin-bottom: 32px;
}

.mobile-filter-overlay .shape-filter-section .filter-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
}

/* Remove margin-bottom for filter sliders section in mobile filter overlay */
/* .mobile-filter-overlay .filter-sliders-section {
    margin-bottom: 32px;
} */

.mobile-filter-overlay .filter-slider-item {
    margin-bottom: 32px;
}

.mobile-filter-overlay .slider-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-filter-overlay .grade-filters-section {
    margin-bottom: 0;
}

.mobile-filter-overlay .grade-filter-item {
    margin-bottom: 32px;
}

.mobile-filter-overlay .grade-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-filter-section {
    margin-bottom: 36px;
    padding: 0 4px; /* Add some side padding to sections */
}

.mobile-filter-section:last-child {
    margin-bottom: 80px; /* Extra space at bottom for comfortable scrolling */
}

.mobile-filter-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-filter-section-title .info-icon {
    width: 16px;
    height: 16px;
    color: #999;
    cursor: help;
}

/* Mobile filter content spacing */
.mobile-filter-overlay .range-inputs {
    padding: 0 8px;
    margin-top: 16px;
}

.mobile-filter-overlay .quick-select-buttons {
    padding: 0 8px;
    margin-top: 12px;
}

.mobile-filter-overlay .grade-scale {
    padding: 0 8px;
    margin-top: 12px;
}

.mobile-filter-overlay .lab-options {
    padding: 0 8px;
    margin-top: 8px;
}

.mobile-filter-overlay .shape-filter-grid {
    padding: 0 4px;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 10px;
}

/* Add proper padding for sliders in mobile overlay - easier touch interaction */
.mobile-filter-overlay .range-slider {
    margin: 12px 20px 8px 20px; /* Added left/right padding for touch */
}

.mobile-filter-overlay .slider-wrapper {
    padding: 0 20px; /* Consistent padding with sliders */
}

.mobile-filter-overlay .grade-range-wrapper {
    padding: 0 20px; /* Grade sliders also need touch padding */
}

.mobile-filter-overlay .grade-range {
    margin: 16px 0 8px 0; /* Remove side margins since wrapper has padding */
}

/* Hide desktop filters on mobile */
@media (max-width: 768px) {
    /* Show mobile filter button */
    .mobile-filter-btn {
        display: flex;
    }
    
    /* Hide desktop filter sections when not in mobile overlay */
    .shape-filter-section:not(.in-mobile-overlay),
    .filters-two-column:not(.in-mobile-overlay) {
        display: none;
    }
    
    /* Show filters when moved to mobile overlay */
    .mobile-filter-overlay .shape-filter-section,
    .mobile-filter-overlay .filters-two-column {
        display: block;
    }
    
    /* Adjust layout in mobile overlay */
    .mobile-filter-overlay .filters-two-column {
        display: block; /* Override grid layout */
    }
    
    .mobile-filter-overlay .filters-left-column,
    .mobile-filter-overlay .filters-right-column {
        border: none;
        padding: 0;
        margin-bottom: 0;
    }
    
    /* Adjust search controls layout */
    .search-controls-compact {
        position: relative;
    }
    
    /* Mobile filter controls inherit layout from parent */
    
    /* Mobile overlay responsive adjustments */
    .mobile-filter-header {
        padding: 12px 16px;
        /* Ensure buttons don't get cut off */
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .mobile-header-left {
        flex: 1;
        min-width: 0; /* Allow content to shrink */
        gap: 8px;
    }
    
    .mobile-filter-title {
        font-size: 16px;
        /* Prevent title from taking too much space */
        flex-shrink: 1;
    }
    
    .mobile-reset-filters-btn {
        /* Ensure reset button is visible */
        flex-shrink: 0;
        font-size: 12px;
        padding: 6px 10px;
        min-width: 60px;
    }
    
    .mobile-filter-close {
        width: 36px;
        height: 36px;
        flex-shrink: 0; /* Never shrink the close button */
    }
    
    .mobile-filter-close svg {
        width: 20px;
        height: 20px;
    }
    
    .mobile-filter-content {
        padding: 20px 16px 30px 16px;
        /* Maintain scrolling on mobile */
        overflow-y: auto;
    }
    
    .mobile-filter-section {
        margin-bottom: 28px;
        padding: 0 6px;
    }
    
    .mobile-filter-section-title {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    /* Mobile overlay shape grid responsiveness */
    .mobile-filter-overlay .shape-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
        gap: 8px;
    }
    
    .mobile-filter-overlay .shape-option {
        padding: 10px 4px;
        min-height: 66px;
        border-radius: 0; /* FLAT UI: No rounded corners */
    }
    
    .mobile-filter-overlay .shape-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .mobile-filter-overlay .shape-label {
        font-size: 10px;
    }
    
    /* Prevent body scroll when modal is open */
    body.mobile-filter-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .mobile-filter-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .mobile-filter-header {
        padding: 10px 12px;
        /* Tighter spacing on small screens */
        gap: 6px;
    }
    
    .mobile-header-left {
        gap: 6px;
    }
    
    .mobile-filter-title {
        font-size: 15px;
        /* Further limit title space on small screens */
    }
    
    .mobile-reset-filters-btn {
        /* Compact reset button for small screens */
        font-size: 11px;
        padding: 5px 8px;
        min-width: 50px;
    }
    
    .mobile-filter-content {
        padding: 16px 12px 24px 12px;
        /* Maintain scrolling on small mobile */
        overflow-y: auto;
        height: 0; /* Force flex scrolling context */
    }
    
    .mobile-filter-actions {
        padding: 14px 12px;
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }
    
    .mobile-apply-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 48px;
    }
    
    .mobile-filter-section {
        margin-bottom: 24px;
        padding: 0 8px;
    }
    
    /* Mobile overlay shape grid for small phones */
    .mobile-filter-overlay .shape-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 7px;
    }
    
    .mobile-filter-overlay .shape-option {
        padding: 8px 3px;
        min-height: 60px;
        border-radius: 0; /* FLAT UI: No rounded corners */
    }
    
    .mobile-filter-overlay .shape-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .mobile-filter-overlay .shape-label {
        font-size: 9px;
    }
    
    /* Adjust slider padding for smallest mobile screens - still need touch-friendly spacing */
    .mobile-filter-overlay .range-slider {
        margin: 12px 16px 8px 16px; /* Slightly less padding but still touchable */
    }
    
    .mobile-filter-overlay .slider-wrapper {
        padding: 0 16px;
    }
    
    .mobile-filter-overlay .grade-range-wrapper {
        padding: 0 16px;
    }
} 