/**
 * Search by Size Filter Styles
 */

.sm-size-filter {
    background: var(--sm-green-4);
    border: 1px solid var(--sm-green);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sm-size-filter__header {
    display: flex;
    align-items: center;
    flex-direction: column;
}

.sm-size-filter__title {
    font-size: 16px;
    font-weight: 600;
    color: var(-sm-black);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Toggle button removed - sliders are always enabled */

.sm-size-filter__sliders-row {
    display: flex;
    gap: 20px;
    flex: 1;
    align-items: center;
}

.sm-size-filter__slider-group {
    flex: 1;
    margin-bottom: 0;
    min-width: 0;
    transition: opacity 0.3s ease;
    padding-top: 40px;
}

/* Disabled state removed - sliders are always enabled */

.sm-size-filter__label-row {
    display: none;
}

.sm-size-filter__label {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--sm-green-2);
    margin-top: 6px;
}

.sm-size-filter__range-value {
    display: none;
}

.sm-size-filter__slider {
    height: 8px;
    flex: 1;
    min-width: 0;
}

.sm-size-filter--default .sm-size-filter__slider {
    margin: 0 30px;
}
    
.sm-size-filter__slider .noUi-connect {
    background: var(--sm-blue);
    transition: background 0.3s ease;
}

.sm-size-filter__slider .noUi-horizontal {
    height: 8px;
}

.sm-size-filter__slider .noUi-horizontal .noUi-handle {
    width: 20px;
    height: 20px;
    right: -10px;
    top: -6px;
}

.sm-size-filter__slider .noUi-target {
    background: #e5e7eb;
    border: none;
    box-shadow: none;
    border-radius: 4px;
}

/* Disabled slider styling removed - sliders are always enabled */

/* Animation for expand/collapse */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 300px;
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        max-height: 300px;
    }
    to {
        opacity: 0;
        max-height: 0;
    }
}

/* ========================================
   RULER STYLE
   ======================================== */

.sm-size-filter--ruler {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
}

.sm-size-filter--ruler .sm-size-filter__header {
    flex: 0 0 auto;
    padding: 0;
}

.sm-size-filter__ruler-sliders {
    flex: 1 1 auto;
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
}

.sm-size-filter__ruler-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sm-size-filter__ruler-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--sm-black);
    margin-bottom: 12px;
    text-align: center;
}

.sm-size-filter__ruler-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 16px;
}

.sm-size-filter__ruler-inputs-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    grid-column: 2;
}

.sm-size-filter__input {
    width: 90px;
    padding: 8px 12px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    transition: border-color 0.2s;
}

.sm-size-filter__input:focus {
    outline: none;
    border-color: var(--sm-blue);
    box-shadow: 0 0 0 3px rgba(41, 135, 194, 0.1);
}

.sm-size-filter__input-separator {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

.sm-size-filter__input-unit {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    margin-left: 10px;
}

.sm-size-filter__ruler-container {
    position: relative;
    padding-top: 10px;
    padding-bottom: 40px;
    min-width: 200px;
}

/* Ruler slider - no tooltips */
.sm-size-filter__slider--ruler {
    position: relative;
    height: 12px;
}

/* Selected range stays gray */
.sm-size-filter__slider--ruler .noUi-connect {
    background: #d1e2ed;
}

.sm-size-filter__slider--ruler .noUi-target {
    background: #d1d5db;
    border: none;
    box-shadow: none;
    border-radius: 6px;
    height: 12px;
}

/* Ruler tick marks extending downward - will be generated by JavaScript */
.sm-size-filter__ruler-ticks {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 30px;
    pointer-events: none;
    opacity: .6;
    z-index: 1;
}

.sm-size-filter__ruler-tick {
    position: absolute;
    top: 0;
    width: 2px;
    background: var(--sm-black);
    transform: translateX(-50%);
    z-index: 1;
}

.sm-size-filter__ruler-tick--inch {
    height: 25px;
    width: 2px;
    background: var(--sm-black);
}

.sm-size-filter__ruler-tick--half {
    height: 18px;
    background: #4b5563;
}

.sm-size-filter__ruler-tick--quarter {
    height: 14px;
    background: #6b7280;
}

.sm-size-filter__ruler-tick--eighth {
    height: 10px;
    background: #9ca3af;
}

.sm-size-filter__ruler-tick--sixteenth {
    height: 6px;
    background: #d1d5db;
}

.sm-size-filter__ruler-label {
    position: absolute;
    top: 28px;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--sm-black);
    font-weight: 500;
}

/* Trapezoid handles pointing inward - left handle points right, right handle points left */
.sm-size-filter__slider--ruler .noUi-handle {
    width: 10px;
    height: 47px;
    background: var(--sm-blue);
    cursor: grab;
    top: -17px;
    z-index: 100;
    box-shadow: none;
    border: none;
}

/* Left handle (lower value) - trapezoid pointing right */
.sm-size-filter__slider--ruler .noUi-handle[data-handle="0"] {
    right: 0px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 60%);
    border-radius: 4px 0 0 0;
}

/* Right handle (upper value) - trapezoid pointing left */
.sm-size-filter__slider--ruler .noUi-handle[data-handle="1"] {
    right: -10px;
    clip-path: polygon(0 0, 100% 0, 100% 60%, 0 100%);
    border-radius: 0 4px 0 0;
    /* border: 2px solid var(--sm-blue); */
}

.sm-size-filter__slider--ruler .noUi-handle:active {
    cursor: grabbing;
}

.sm-size-filter__slider--ruler .noUi-handle:before,
.sm-size-filter__slider--ruler .noUi-handle:after {
    display: none;
}

.sm-size-filter__slider--ruler .noUi-horizontal .noUi-handle {
    width: 20px;
    height: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .sm-size-filter__header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .sm-size-filter__title {
        text-align: center;
    }
    
    .sm-size-filter__sliders-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .sm-size-filter__ruler-sliders {
        flex-direction: column;
        gap: 30px;
    }
    
    .sm-size-filter__input {
        width: 90px;
        font-size: 18px;
    }
}
