/**
 * Elite Mattress Showroom Styles
 */

/* 1. Sidebar Filter - Seamless Design */
.elite-sidebar-filter {
    background: #fff;
    padding: 20px 0 20px 20px;
    /* Left padding only */
    border: none;
    border-left: 1px solid #f0f0f0;
    /* Divider line instead of box border */
    border-radius: 0;
    box-shadow: none;
    transition: all 0.3s ease;
    height: 100%;
    /* Fill height */

    /* Negative margin to pull to edge if parent has padding */
    margin-right: -10px;
}

/* Ensure no double borders if RTL */
body.rtl .elite-sidebar-filter {
    padding: 20px 0 20px 25px;
    border-left: 1px solid #f0f0f0;
    border-right: none;
    margin-right: 0;
    margin-left: -10px;
}

/* ... (vertical layout) ... */
.elite-filter-layout-vertical .elite-sidebar-filter {
    position: sticky;
    top: 100px;
}

/* ... (Horizontal Layout Section Omitted for Brevity) ... */

.filter-main-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    color: #0b0b0b;
}

.filter-group {
    margin-bottom: 30px;
}

.group-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
}

/* CHECKBOX FIXES */
.filter-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    transition: color 0.2s;
    user-select: none;
    flex-direction: row-reverse;
    justify-content: flex-end;
    position: relative;
    /* Ensure clicking works */
}

.filter-checkbox:hover {
    color: #577D89;
}

/* Hide default checkbox but keep it accessible for form submission */
.filter-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom Checkmark */
.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-left: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    position: relative;
    flex-shrink: 0;
    background-color: #fff;
    /* Ensure visibility */
}

.filter-checkbox input:checked+.checkmark {
    background: #577D89;
    border-color: #577D89;
}

.filter-checkbox input:checked+.checkmark::after {
    content: "";
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
    display: block;
    /* Ensure it renders */
}

.price-inputs {
    display: flex;
    gap: 10px;
}

.price-inputs input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.apply-filter-btn {
    background: #0b0b0b;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.apply-filter-btn:hover {
    background: #577D89;
}

.reset-filter-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    color: #777;
    cursor: pointer;
}

/* 2. Results Header */
.elite-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.results-count {
    font-size: 15px;
    color: #555;
}

.elite-sort {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

/* 3. Results Grid */
.elite-results-container {
    display: grid;
    gap: 25px;
    position: relative;
    min-height: 400px;
}

/* 4. Product Card */
.elite-product-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.elite-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.card-image-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f7f7f7;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.elite-product-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
    display: flex;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.elite-product-card:hover .card-overlay {
    opacity: 1;
}

.view-details-btn {
    background: #fff;
    color: #0b0b0b;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.card-content {
    padding: 20px;
}

.product-brand {
    display: none;
    /* Hidden from content, moved to overlay */
}

.brand-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 900;
    color: #577D89;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 15px;
    color: #0b0b0b;
    line-height: 1.3;
}

.product-meta-specs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.spec-item {
    font-size: 13px;
    color: #666;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
}

.spec-label {
    font-weight: 500;
}

.spec-value {
    color: #0b0b0b;
    font-weight: 700;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f5f5f5;
}

.price-tag .currency {
    font-size: 12px;
    color: #888;
    margin-left: 2px;
}

.price-tag .amount {
    font-size: 20px;
    font-weight: 800;
    color: #577D89;
    transition: all 0.3s;
}

.price-info {
    display: flex;
    flex-direction: column;
    margin-right: 8px;
    text-align: right;
}

.starts-from,
.selected-size-label {
    font-size: 10px;
    color: #888;
    font-weight: 600;
    line-height: 1;
}

.selected-size-label .size-val {
    color: #0b0b0b;
    font-weight: 800;
}

.add-to-cart-simple {
    background: #f0f0f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.add-to-cart-simple:hover {
    background: #577D89;
    color: #fff;
}

/* 5. Loading State */
.elite-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #577D89;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
    .elite-sidebar-filter {
        position: fixed !important;
        top: 0;
        right: -100%;
        /* Hidden by default */
        width: 85% !important;
        max-width: 320px !important;
        height: 100vh !important;
        z-index: 1000001 !important;
        background: #fff !important;
        padding: 30px 20px !important;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1) !important;
        transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
        overflow-y: auto !important;
        border-right: 1px solid #eee !important;
    }

    .elite-sidebar-filter.is-open {
        right: 0 !important;
    }

    .elite-filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1000000;
        display: none;
        
    }

    .elite-filter-overlay.is-visible {
        display: block;
    }

    /* Sticky Mobile Trigger */
    .mobile-filter-trigger {
        display: flex !important;
        position: fixed;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        background: #0b0b0b;
        color: #fff;
        padding: 12px 25px;
        border-radius: 50px;
        font-weight: 700;
        font-size: 14px;
        z-index: 99999;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
        align-items: center;
        gap: 10px;
        border: none;
        cursor: pointer;
        white-space: nowrap;
    }

    .elite-results-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 10px !important;
    }

    .elite-product-card {
        border-radius: 8px !important;
    }

    .product-title {
        font-size: 14px !important;
        height: 36px;
        overflow: hidden;
    }

    .price-tag .amount {
        font-size: 16px !important;
    }

    .card-content {
        padding: 12px !important;
    }

    .spec-item {
        font-size: 11px !important;
    }

    .elite-results-header {
        justify-content: center !important;
        padding: 10px !important;
    }

    .results-count-wrap {
        width: 100%;
        text-align: center;
    }

    .sort-wrapper {
        display: none !important;
    }

    /* Hide sort on mobile, put inside filter */
}

.mobile-filter-trigger {
    display: none;
}

.elite-filter-close {
    display: none;
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #0b0b0b;
}

@media (max-width: 1024px) {
    .elite-filter-close {
        display: block;
    }
}

/* 6. Product Comparison System (Elite Redesign) */
.compare-toggle-btn-small {
    background: #f5f5f7;
    border: 1px solid #e1e1e1;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    color: #1d1d1f;
}

.compare-toggle-btn-small:hover {
    background: #0b0b0b;
    color: #fff;
    transform: scale(1.1);
    border-color: #0b0b0b;
}

.compare-toggle-btn-small.is-active {
    background: #577D89;
    color: #fff;
    border-color: #577D89;
    box-shadow: 0 4px 15px rgba(230, 0, 0, 0.3);
}

/* Comparison Drawer (Frosted Glass) */
.comparison-drawer {
    position: fixed;
    bottom: -150px;
    left: 20px;
    right: 20px;
    height: 90px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    z-index: 999999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    padding: 0 35px;
}

.comparison-drawer.is-visible {
    bottom: 30px;
}

.drawer-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-brand-info {
    display: flex;
    flex-direction: column;
}

.brand-text {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

.brand-text strong {
    color: #0b0b0b;
}

.compare-label {
    font-size: 13px;
    font-weight: 700;
    margin-top: 2px;
}

/* Drawer Thumbnails */
.selected-items-list {
    display: flex;
    gap: 12px;
    flex-grow: 1;
    justify-content: center;
}

.selected-item-thumb {
    width: 65px;
    height: 50px;
    border-radius: 12px;
    overflow: visible;
    background: #fff;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.selected-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.remove-selected-item {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #577D89;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s;
}

.remove-selected-item:hover {
    transform: scale(1.2);
}

.compare-drawer-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.clear-compare-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: #777;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.compare-now-btn {
    background: #0b0b0b;
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

.compare-now-btn:hover {
    background: #577D89;
    transform: translateX(-5px);
    box-shadow: 0 5px 20px rgba(230, 0, 0, 0.4);
}

/* Comparison Modal (Modern Elite Aesthetic) */
.comparison-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    
    z-index: 1000000;
    display: none;
    overflow-y: auto;
}

.comparison-modal.is-open {
    display: block;
    animation: modalSpringUp 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes modalSpringUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comparison-modal-header {
    text-align: center;
    padding: 60px 20px 40px;
}

.modal-title {
    font-size: 32px;
    font-weight: 900;
    color: #1d1d1f;
    margin: 0 0 10px;
}

.modal-subtitle {
    color: #888;
    font-size: 15px;
}

.modal-close-btn {
    position: absolute;
    top: 30px;
    left: 40px;
    cursor: pointer;
    color: #0b0b0b;
    transition: transform 0.3s;
}

.modal-close-btn:hover {
    transform: rotate(90deg);
}

/* Battle Grid Layout */
.comparison-battle-grid {
    display: flex;
    max-width: 1400px;
    margin: 0 auto 100px;
    padding: 0 40px;
    gap: 20px;
}

.comparison-attr-column {
    width: 220px;
    padding-top: 180px;
}

.attr-row {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 30px;
    font-size: 15px;
    font-weight: 700;
    color: #888;
    border-bottom: 1px solid #f1f1f1;
}

.attr-row.price-label-cell {
    height: 100px;
    /* Aligned with price highlights */
}

.comparison-product-card {
    flex: 1;
    background: #fff;
    border-radius: 25px;
    border: 1px solid #eee;
    overflow: hidden;
    transition: transform 0.4s;
}

.comparison-product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.product-compare-header {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdfdfd;
    padding: 20px;
    border-bottom: 1px solid #f5f5f5;
}

.compare-img-wrap img {
    max-height: 160px;
    max-width: 100%;
    object-fit: contain;
}

.compare-content {
    padding: 30px 25px;
}

.compare-title {
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 25px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    line-height: 1.2;
}

.compare-row-val {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    border-bottom: 1px solid #f1f1f1;
    text-align: center;
}

.compare-row-val.price-highlight {
    height: 100px;
    /* Increased for multi-variations */
}

.features-grid {
    flex-direction: column;
    gap: 4px;
    padding: 5px;
}

.feat-tag {
    background: #f5f5f7;
    color: #1d1d1f;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.price-stack-multi {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 5px;
    gap: 4px;
}

.multi-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f8f8;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: all 0.2s;
}

.multi-price-row:hover {
    background: #fff;
    border-color: #577D89;
    transform: scale(1.02);
}

.m-price-val {
    font-size: 14px;
    color: #577D89;
    font-weight: 800;
}

.m-price-size {
    font-size: 9px;
    color: #888;
    background: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    border: 1px solid #eee;
}

.price-val {
    font-size: 22px;
    color: #577D89;
    font-weight: 950;
    line-height: 1.1;
}

.price-note {
    font-size: 11px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
}

/* Firmness Meter */
.firmness-meter {
    width: 100%;
    text-align: center;
}

.meter-bar {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    width: 100px;
    margin: 0 auto 8px;
    position: relative;
    overflow: hidden;
}

.meter-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #0b0b0b;
    width: inherit;
}

/* Final CTA */
.compare-footer {
    padding-top: 30px;
    text-align: center;
}

.buy-now-elite {
    background: #0b0b0b;
    color: #fff !important;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 800;
    display: inline-block;
    transition: all 0.3s;
}

.buy-now-elite:hover {
    background: #577D89;
    border-color: #577D89;
}

/* Variation Size Tag Styling */
.variation-size-tag {
    color: #577D89;
    font-weight: 800;
    background: rgba(230, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    margin-right: 4px;
    border: 1px solid rgba(230, 0, 0, 0.1);
    display: inline-block;
    vertical-align: middle;
}

body.rtl .variation-size-tag {
    margin-right: 0;
    margin-left: 4px;
}