/**
 * ACF WooCommerce Product Options - Frontend Steps Styles
 */

/* ═══════════════════════════════════════════════════════════════════════════
   STEPPED CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */

.acf-product-options-stepped {
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STEP HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.acf-step-header {
    padding: 12px 0 8px;
    margin: 16px 0 12px;
    border-bottom: 2px solid var(--bde-woo-base-primary-color, #2271b1);
}

.acf-step-header:first-child {
    margin-top: 0;
}

.acf-step-title {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--bde-woo-base-primary-color, #2271b1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STEP CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */

.acf-step-content {
    margin-bottom: 20px;
}

.acf-step-content:last-child {
    margin-bottom: 0;
}

.acf-step-content .acf-product-options {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HIDDEN STATES (for conditional logic)
   ═══════════════════════════════════════════════════════════════════════════ */

.acf-step-header.acf-step-hidden,
.acf-step-content.acf-step-hidden {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ALTERNATIVE STEP STYLES (optional classes)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Numbered steps style */
.acf-product-options-stepped.numbered-steps .acf-step-header {
    counter-increment: step-counter;
}

.acf-product-options-stepped.numbered-steps .acf-step-title::before {
    content: counter(step-counter) ". ";
}

.acf-product-options-stepped.numbered-steps {
    counter-reset: step-counter;
}

/* Boxed step style */
.acf-product-options-stepped.boxed-steps .acf-step-header {
    background: var(--bde-woo-base-primary-color, #2271b1);
    color: #fff;
    padding: 10px 16px;
    margin: 20px 0 0;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.acf-product-options-stepped.boxed-steps .acf-step-title {
    color: #fff;
}

.acf-product-options-stepped.boxed-steps .acf-step-content {
    background: #f9f9f9;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

/* Minimal step style */
.acf-product-options-stepped.minimal-steps .acf-step-header {
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 0 6px;
    margin: 12px 0 8px;
}

.acf-product-options-stepped.minimal-steps .acf-step-title {
    font-size: 0.95em;
    color: #555;
    text-transform: none;
    letter-spacing: normal;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STEP-BY-STEP NAVIGATION MODE
   ═══════════════════════════════════════════════════════════════════════════ */

/* When using stepped navigation, hide inactive steps */
.acf-stepped-navigation .acf-step-content {
    display: none;
}

.acf-stepped-navigation .acf-step-content.acf-step-active {
    display: block;
}

/* Hide old step headers completely - the step indicators replace them */
.acf-stepped-navigation .acf-step-header {
    display: none !important;
}

/* Progress Bar */
.acf-steps-progress {
    margin-bottom: 24px;
}

.acf-steps-progress-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-bottom: 16px;
    overflow: hidden;
}

.acf-steps-progress-fill {
    height: 100%;
    background: var(--bde-woo-base-primary-color, #2271b1);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Step Indicators */
.acf-steps-indicators {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.acf-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.acf-step-indicator.active,
.acf-step-indicator.completed {
    opacity: 1;
}

.acf-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.acf-step-indicator.active .acf-step-number {
    background: var(--bde-woo-base-primary-color, #2271b1);
    color: #fff;
}

.acf-step-indicator.completed .acf-step-number {
    background: #4caf50;
    color: #fff;
}

.acf-step-indicator.completed .acf-step-number::after {
    content: "✓";
}

.acf-step-indicator.completed .acf-step-number span {
    display: none;
}

.acf-step-indicator-name {
    font-size: 12px;
    color: #666;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acf-step-indicator.active .acf-step-indicator-name {
    color: var(--bde-woo-base-primary-color, #2271b1);
    font-weight: 600;
}

/* Navigation Buttons */
.acf-steps-navigation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.acf-step-prev,
.acf-step-next {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.acf-step-prev {
    background: #f0f0f0;
    border: 1px solid #ccc;
    color: #333;
}

.acf-step-prev:hover:not(:disabled) {
    background: #e0e0e0;
}

.acf-step-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.acf-step-next {
    background: var(--bde-woo-base-primary-color, #2271b1);
    border: 1px solid var(--bde-woo-base-primary-color, #2271b1);
    color: #fff;
    margin-left: auto;
}

.acf-step-next:hover:not(:disabled) {
    opacity: 0.9;
}

.acf-step-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hide next button on last step (add-to-cart button takes over) */
.acf-stepped-navigation.on-last-step .acf-step-next {
    display: none;
}

/* Invalid field highlighting */
.acf-field-row.acf-field-invalid {
    background: #fff5f5;
}

.acf-field-row.acf-field-invalid .label label {
    color: #dc3232;
}

.acf-field-row.acf-field-invalid input,
.acf-field-row.acf-field-invalid select,
.acf-field-row.acf-field-invalid textarea {
    border-color: #dc3232;
}

.acf-field-row.acf-field-invalid::after {
    content: "This field is required";
    display: block;
    color: #dc3232;
    font-size: 12px;
    padding: 4px 12px 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media screen and (max-width: 600px) {
    .acf-step-header {
        padding: 10px 0 6px;
        margin: 12px 0 10px;
    }

    .acf-step-title {
        font-size: 1em;
    }

    .acf-product-options-stepped.boxed-steps .acf-step-header {
        padding: 8px 12px;
    }

    .acf-product-options-stepped.boxed-steps .acf-step-content {
        padding: 12px;
    }

    /* Responsive step indicators */
    .acf-step-indicator-name {
        display: none;
    }

    .acf-step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .acf-step-prev,
    .acf-step-next {
        padding: 10px 16px;
        font-size: 13px;
    }
}
