/* ============================================
   SIZE FINDER WIDGET
   ============================================ */

/* Header Button */
.size-finder-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--color-primary);
    border: none;
    border-radius: 6px;
    color: #000;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.size-finder-header-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.size-finder-header-btn i {
    font-size: 1rem;
}

/* Transparent header state */
.site-header.header-transparent .size-finder-header-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.site-header.header-transparent .size-finder-header-btn:hover {
    background: var(--color-primary);
    color: #000;
    border-color: var(--color-primary);
}

/* Scrolled state */
.site-header.scrolled .size-finder-header-btn {
    background: var(--color-primary);
    color: #000;
}

/* Modal Overlay */
.size-finder-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.size-finder-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal */
.size-finder-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: #fff;
    border-radius: 20px;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.size-finder-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Header */
.size-finder-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
    position: relative;
}

.size-finder-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.size-finder-header h3 svg {
    width: 24px;
    height: 24px;
    fill: var(--color-primary);
}

.size-finder-header p {
    font-size: 0.875rem;
    opacity: 0.7;
    margin: 0;
}

.size-finder-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.size-finder-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal Body */
.size-finder-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Search Form */
.size-finder-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.size-finder-inputs {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.size-finder-field {
    flex: 1;
}

.size-finder-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    margin-bottom: 0.5rem;
}

.size-finder-field input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
}

.size-finder-field input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(201, 169, 98, 0.1);
}

.size-finder-field input::placeholder {
    color: #bbb;
    font-weight: 400;
}

.size-finder-x {
    font-size: 1.5rem;
    font-weight: 300;
    color: #999;
    padding-bottom: 0.875rem;
}

.size-finder-unit {
    display: flex;
    gap: 0.5rem;
    padding-bottom: 0.875rem;
}

.size-finder-unit button {
    padding: 0.5rem 1rem;
    border: 2px solid #e5e5e5;
    background: #fff;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.size-finder-unit button.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #000;
}

.size-finder-search-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s;
}

.size-finder-search-btn:hover {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.size-finder-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.size-finder-search-btn i {
    font-size: 1.25rem;
}

/* Results */
.size-finder-results {
    margin-top: 1.5rem;
}

.size-finder-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.size-finder-loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
    display: block;
    color: var(--color-primary);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Result Messages */
.size-finder-message {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.size-finder-message i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.size-finder-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.size-finder-message.success i {
    color: #28a745;
}

.size-finder-message.info {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.size-finder-message.info i {
    color: #ffc107;
}

.size-finder-message.empty {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e5e5e5;
}

/* Product Grid */
.size-finder-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.size-finder-product {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.size-finder-product:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.size-finder-product.exact-match {
    border: 2px solid #28a745;
    background: #f8fff9;
}

.size-finder-product-img {
    aspect-ratio: 1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

.size-finder-product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.size-finder-product-info {
    padding: 0.75rem;
}

.size-finder-product-category {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: #666;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.35rem;
}

.size-finder-product-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.size-finder-product-dims {
    font-size: 0.75rem;
    color: #666;
}

.size-finder-product-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #28a745;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 4px;
    margin-top: 0.5rem;
    text-transform: uppercase;
}

/* Section Title */
.size-finder-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* Responsive */
@media (max-width: 991.98px) {
    .size-finder-header-btn span {
        display: none;
    }

    .size-finder-header-btn {
        padding: 8px 10px;
    }
}

@media (max-width: 767.98px) {
    .size-finder-header-btn {
        display: none;
    }

    .size-finder-modal {
        width: 95%;
        max-height: 90vh;
        border-radius: 16px;
    }

    .size-finder-header {
        padding: 1.25rem 1.5rem;
    }

    .size-finder-body {
        padding: 1.5rem;
    }

    .size-finder-inputs {
        flex-wrap: wrap;
    }

    .size-finder-field {
        flex: 1 1 40%;
    }

    .size-finder-x {
        display: none;
    }

    .size-finder-unit {
        flex: 1 1 100%;
        justify-content: center;
        padding-bottom: 0;
    }

    .size-finder-products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 479.98px) {
    .size-finder-products {
        grid-template-columns: 1fr;
    }
}
