:root {
    --primary-color: #02163e;
    --secondary-color: #f7f7f7;
    --accent-color: #007bff;
    --text-primary: #222;
    --text-secondary: #666;
    --text-muted: #999;
    --border-radius: 12px;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.16);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --container-max-width: 1200px;
}

* {
    box-sizing: border-box;
}

#led-configurator-wrapper {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Step Container */
.led-step {
    background: #ffffff;
    padding: 40px;
    margin: 20px auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    border: 1px solid #e0e0e0;
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
}

.step-title {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    padding-bottom: 16px;
}

.step-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    border-radius: 2px;
}

.step-answers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    justify-items: center;
}

.step-answer-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 240px;
    min-height: 160px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    background: white;
    border: 2px solid transparent;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.step-answer-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    transform: scaleX(0);
    transition: var(--transition);
}

.step-answer-container:hover:not(.disabled):not(.dimmed) {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-heavy);
    border-color: var(--accent-color);
}

.step-answer-container:hover:not(.disabled):not(.dimmed)::before {
    transform: scaleX(1);
}

.step-answer-container.selected {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-heavy);
    border-color: var(--accent-color);
    background-color: #f0f7ff;
}

.step-answer-container.selected::before {
    transform: scaleX(1);
}

.step-answer-container.dimmed {
    opacity: 0.5;
    filter: grayscale(80%);
    transform: scale(0.95);
    box-shadow: none;
}

.step-answer-container.dimmed:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1);
    box-shadow: var(--shadow-medium);
}

.step-answer-container.disabled {
    filter: grayscale(100%);
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

.step-answer-container img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    transition: var(--transition);
}

.step-answer-container p {
    padding: 16px;
    margin: 0;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.led-select-all-btn {
    padding: 10px 20px;
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-top: 24px;
    font-weight: 600;
    transition: var(--transition);
    font-family: inherit;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.led-select-all-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* Buttons */
.led-reset-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-top: 32px;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.led-reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Results Grid */
.led-results-header {
    text-align: center;
    margin: 40px 0 20px;
}

.led-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 20px;
    margin-bottom: 40px;
}

.led-product-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    padding: 15px;
    /* Reduced padding */
    transition: var(--transition);
    border: 1px solid #e0e0e0;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.led-product-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-5px);
}

.led-product-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    /* Reduced margin */
}

.led-product-card h4 {
    font-size: 16px;
    /* Slightly smaller to fit better */
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 8px 0;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 8px;

    /* Force 2 lines height */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 46px;
    /* approx 2 lines */
    line-height: 1.4;
}

.led-product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-color);
    text-align: right;
    margin-top: auto;
    /* Push to bottom */
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.led-no-results {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

/* Loader */
.led-loader {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .led-step {
        padding: 24px 20px;
    }

    .step-answers-container {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 16px;
    }

    .step-answer-container {
        max-width: none;
        min-height: 140px;
    }

    .step-answer-container img {
        height: 90px;
    }

    .led-products-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .led-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .led-related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Attributes styling */
.led-product-attributes {
    font-size: 0.75em;
    /* Smaller font */
    color: var(--text-secondary);
    margin: 8px 0;
    border-top: 1px solid #eee;
    padding-top: 8px;
    line-height: 1.3;
}

.led-attr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    /* Row gap 4px, Col gap 12px */
}

.led-attr-item {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Related products section */
.led-related-products-section {
    margin-top: 40px;
    /* Reduced margin */
    border-top: 2px solid #eee;
    padding-top: 30px;
}

.led-related-grid {
    grid-template-columns: repeat(5, 1fr);
}

.led-view-product-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    /* Smaller padding */
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
    width: 100%;
    cursor: pointer;
    font-size: 14px;
}

.led-view-product-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}