/* =========================================
   Store Configurator - Front-end Styles
   Adapts to theme primary color via CSS variables
   ========================================= */

/* Mobile: move the boxInfo CTA block to the bottom */
@media (max-width: 767px) {
    .card_container {
        order: 99;
    }
    .col-md-6:first-child {
        display: flex;
        flex-direction: column;
    }
    #stickyelmen {
        display: flex;
        flex-direction: column;
    }
    #stickyelmen .card_container {
        order: 99;
    }
}

:root {
    --sc-primary: var(--color-primary, var(--primary, var(--brand-primary, #007BFF)));
    --sc-primary-hover: var(--color-primary, var(--primary-hover, #0056b3));
    --sc-success: var(--success, #27ae60);
    --sc-text: var(--text-color, #333);
}

.store-configurator {
    max-width: 800px;
    margin: 20px auto;
    font-family: inherit;
}

/* Add top margin to the product column when configurator is active */
#sc-product-info,
#sc-confection-cta {
    margin-top: 10px;
}

.colproduct h2:first-child {
    margin-top: 15px;
}

/* Top margin above the product image / canvas area */
.images-container,
#sc-preview-wrapper {
    margin-top: 15px;
}

.sc-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.4em;
    color: #333;
}

/* Steps / Accordion */
.sc-step {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.sc-step-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.sc-step-header:hover {
    background: #e9ecef;
}

.sc-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--sc-primary);
    color: #fff;
    font-weight: bold;
    font-size: 0.85em;
    margin-right: 12px;
    flex-shrink: 0;
}

.sc-step-title {
    font-weight: 600;
    flex: 1;
    color: #333;
}

.sc-step-summary {
    font-size: 0.85em;
    color: #666;
    margin-right: 12px;
    font-style: italic;
}

.sc-step-chevron {
    font-size: 0.7em;
    color: #999;
    transition: transform 0.2s;
}

.sc-step-body {
    padding: 16px;
    border-top: 1px solid #eee;
}

.sc-step-body.sc-collapsed {
    display: none;
}

/* Form elements */
.sc-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sc-col {
    flex: 1;
    min-width: 200px;
}

.sc-col label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9em;
    color: #444;
}

.sc-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    box-sizing: border-box;
}

.sc-input:focus {
    border-color: var(--sc-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.sc-help {
    display: block;
    font-size: 0.8em;
    color: #888;
    margin-top: 4px;
}

.sc-error {
    color: #dc3545;
    font-size: 0.9em;
    margin-bottom: 8px;
}

/* Buttons */
.sc-btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 0.95em;
    cursor: pointer;
    margin-top: 8px;
    margin-right: 8px;
    transition: background 0.2s;
}

.sc-btn-next, .sc-btn-primary {
    background: var(--sc-primary);
    color: #fff;
}

.sc-btn-next:hover, .sc-btn-primary:hover {
    background: var(--sc-primary-hover);
    filter: brightness(0.9);
}

.sc-btn-prev, .sc-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.sc-btn-prev:hover, .sc-btn-secondary:hover {
    background: #5a6268;
}

.sc-btn-sm {
    padding: 5px 12px;
    font-size: 0.85em;
}

.sc-btn-delete {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-weight: bold;
    padding: 2px 8px;
    margin-left: 8px;
}

.sc-btn-delete:hover {
    color: #a71d2a;
}

.sc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Popups */
.sc-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sc-popup-content {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 320px;
    max-width: 500px;
}

.sc-popup-content h4 {
    margin-top: 0;
    margin-bottom: 16px;
}

.sc-popup-content label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9em;
}

.sc-popup-content .sc-input {
    margin-bottom: 12px;
}

/* Lyres */
.sc-lyre-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-top: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    font-size: 0.9em;
}

/* Radio images (lambrequin finitions) */
.sc-radio-images {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.sc-radio-image {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: normal !important;
}

.sc-radio-image:has(input:checked) {
    border-color: var(--sc-primary);
    background: #f0f7ff;
}

.sc-radio-image {
    flex-direction: column;
    min-width: 100px;
    text-align: center;
}

.sc-radio-image img {
    max-width: 120px;
    max-height: 90px;
    display: block;
    margin: 4px auto;
    cursor: pointer;
    transition: transform 0.2s;
}

.sc-radio-image img:hover {
    transform: scale(2.5);
    z-index: 100;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-radius: 4px;
}

.sc-radio-image span {
    display: block;
    text-align: center;
    font-size: 0.8em;
}

/* Results */
.sc-results {
    margin-top: 20px;
    padding: 20px;
    border: 2px solid #28a745;
    border-radius: 8px;
    background: #f8fff8;
}

.sc-results h3 {
    margin-top: 0;
    color: #28a745;
}

.sc-results-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.sc-result-item {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.sc-result-label {
    font-weight: 600;
    color: #555;
}

.sc-result-value {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

.sc-result-total .sc-result-value {
    font-size: 1.4em;
    color: #28a745;
}

/* Summary table */
.sc-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.sc-summary-table th,
.sc-summary-table td {
    padding: 6px 10px;
    border: 1px solid #ddd;
    text-align: left;
    font-size: 0.9em;
}

.sc-summary-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.sc-results-actions {
    margin-top: 16px;
}

/* Switch toggle (same as idxrcustomproduct) */
.sc-switch-container {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    background: white;
    border-radius: 7px;
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 4px 8px;
}

.sc-switch-label {
    margin: 0 5px;
    padding: 0;
    font-size: 13px;
    color: #555;
}

.sc-switch-wrapper {
    position: relative;
    width: 50px;
    height: 26px;
    cursor: pointer;
}

.sc-switch-bg {
    position: absolute;
    cursor: pointer;
    background-color: #ccc;
    border-radius: 26px;
    width: 100%;
    height: 100%;
    transition: background-color 0.2s;
}

.sc-switch-circle {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    top: 2px;
    left: 2px;
    transition: left 0.2s;
}

.sc-switch-wrapper.active .sc-switch-bg {
    background-color: #4caf50;
}

.sc-switch-wrapper.active .sc-switch-circle {
    left: 26px;
}

/* Responsive */
@media (max-width: 600px) {
    .sc-row {
        flex-direction: column;
        gap: 8px;
    }

    .sc-col {
        min-width: 100%;
    }

    .sc-results-grid {
        flex-direction: column;
    }

    .sc-radio-images {
        flex-direction: column;
    }
}
