/**
 * LOTUS Purechoice Plugin Styles
 */

.lotus-purechoice-wizard {
    max-width: 1180px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.wizard-header {
    margin-bottom: 20px;
    text-align: center;
}

.wizard-progress {
    height: 4px;
    background: #0073aa;
    width: 0%;
    transition: width 0.3s ease;
    margin-top: 10px;
    border-radius: 5px;
}

.wizard-step-container {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.step-question {
    font-size: 1.5em;
    margin-bottom: 25px;
    color: #333;
}

.step-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.answer-option {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 200px;
    white-space: normal !important; /* Force override global nowrap */
    height: auto !important;
}

.answer-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 5px;
    background: #fff;
}

.answer-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.answer-image[src*=".svg"] {
    padding: 20px;
    box-sizing: border-box;
}

.answer-label {
    text-align: center;
    font-weight: 500;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.answer-option:hover {
    border-color: #0073aa;
    background: #f0f7fb;
}

#lotus-purechoice-wizard .answer-option.selected {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
    border-radius: 5px !important;
}

.answer-option.has-image {
    background: transparent;
    border: none;
    padding: 10px;
}

.answer-option.has-image:hover {
    background: transparent;
    border: none;
}

.answer-option.has-image .answer-image-wrapper {
    transition: transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.answer-option.has-image:hover .answer-image-wrapper {
    transform: scale(1.1);
}

.answer-option.has-image.selected .answer-image-wrapper {
    box-shadow: 0 0 0 1px #0073aa;
}

.wizard-controls {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.wizard-controls button {
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1em;
    border: none;
}

.wizard-controls button.primary {
    background: #0073aa;
    color: #fff;
}

.wizard-controls button.secondary {
    background: #f1f1f1;
    color: #333;
}

.wizard-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#wizard-next {
    margin-left: auto;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-card {
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.2s;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-info h4 {
    margin: 0 0 10px;
    font-size: 1.2em;
}

.product-excerpt {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    flex-grow: 1;
}

.product-price {
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 15px;
}

.product-info .button {
    text-align: center;
    text-decoration: none;
    display: block;
    background: #0073aa;
    color: white;
    padding: 10px;
    border-radius: 5px;
}

/* Slider Styles */
.lotus-slider-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    text-align: center;
}

.lotus-slider-value {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #0073aa;
}

.lotus-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 10px;
    border-radius: 5px;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}

.lotus-slider:hover {
    opacity: 1;
}

.lotus-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #0073aa;
    cursor: pointer;
}

.lotus-slider::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #0073aa;
    cursor: pointer;
}

.lotus-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

/* Multi-select styling tweak */
.wizard-step.type-multi .answer-option.selected {
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

/* Loader */
.lotus-loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: lotus-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes lotus-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2em;
    color: #666;
    margin-top: 10px;
}

/* Results Layout Update */
.lotus-results-container {
    display: block; /* Remove grid from main container */
}

.lotus-perfect-match {
    margin-bottom: 40px;
    text-align: center;
}

.lotus-result-heading {
    margin-bottom: 20px;
    font-size: 1.8em;
    color: #333;
    text-align: center;
}

.lotus-perfect-match .product-card.featured-card {
    display: flex;
    flex-direction: row; /* Horizontal layout */
    max-width: 900px;
    margin: 0 auto;
    align-items: center;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border: 2px solid #0073aa; /* Highlight */
}

.featured-card .product-image {
    flex: 0 0 300px; /* Fixed width image */
    margin-right: 30px;
}

.featured-card .product-image img {
    height: auto;
    max-height: 300px;
    width: 100%;
}

.featured-card .product-info {
    text-align: left;
}

.featured-card h4 {
    font-size: 1.6em;
    margin-bottom: 15px;
}

.featured-card .product-excerpt {
    font-size: 1.1em;
    margin-bottom: 20px;
}

.featured-card .button {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1.1em;
}

.lotus-more-matches {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

/* Ensure inner grid works */
.lotus-more-matches .results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lotus-perfect-match .product-card.featured-card {
        flex-direction: column;
    }
    
    .featured-card .product-image {
        margin-right: 0;
        margin-bottom: 20px;
        flex: auto;
        width: 100%;
    }
}

/* Criteria Summary */
.lotus-criteria-summary {
    margin: 30px auto;
    max-width: 800px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #eee;
    text-align: center;
}

.lotus-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    display: inline-block; /* Center the list block */
    width: 100%;
    max-width: 600px;
}

.lotus-summary-list li {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
}

.lotus-summary-list li:last-child {
    border-bottom: none;
}

.summary-question {
    font-weight: 600;
    color: #333;
    margin-right: 15px;
}

.summary-answer {
    color: #0073aa;
    font-weight: 500;
    text-align: right;
}
