/**
 * spc-styles.css — Shop Price Calculator
 * Version: 2.0.0
 */

/* =========================================================================
   1. Total Bar
   ========================================================================= */

#spc-total-bar {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #1a1a2e;
    color: #fff;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.92rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    flex-wrap: wrap;
    gap: 8px;
}

#spc-total-bar-left {
    font-size: 0.88rem;
    opacity: 0.8;
    font-style: italic;
}

#spc-total-bar-right {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

#spc-total-display {
    font-weight: 900;
    font-size: 1.3rem;
    color: #f0c040;
    margin-left: 6px;
}

/* =========================================================================
   2. Box Input
   ========================================================================= */

.spc-box-wrapper {
    text-align: center;
    padding: 8px 0 6px;
}

.spc-box-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.spc-box-input {
    display: block;
    width: 110px;
    margin: 0 auto;
    padding: 8px 10px;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -moz-appearance: textfield;
}

.spc-box-input::-webkit-outer-spin-button,
.spc-box-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.spc-box-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
    background: #f0f7ff;
}

.spc-box-input.spc-has-value {
    border-color: #28a745;
    background: #f0fff4;
    color: #155724;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.12);
}

/* =========================================================================
   3. Inquiry Form wrapper
   ========================================================================= */

#spc-inquiry-form {
    max-width: 700px;
    margin: 36px auto;
    padding: 32px 36px;
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    font-size: 0.95rem;
    color: #2d2d2d;
    font-family: inherit;
}

/* Step indicator */
#spc-step-indicator {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #999;
    margin-bottom: 24px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.spc-step {
    display: block;
}

.spc-step[hidden] {
    display: none !important;
}

.spc-step h3 {
    margin: 0 0 20px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

/* =========================================================================
   4. Field groups
   ========================================================================= */

.spc-field-group {
    margin-bottom: 16px;
}

.spc-field-group>label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #444;
    margin-bottom: 5px;
}

.spc-field-group input[type="text"],
.spc-field-group input[type="email"],
.spc-field-group input[type="tel"],
.spc-field-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d0d0d0;
    border-radius: 7px;
    font-size: 0.9rem;
    color: #333;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.spc-field-group input[type="text"]:focus,
.spc-field-group input[type="email"]:focus,
.spc-field-group input[type="tel"]:focus,
.spc-field-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.12);
}

/* =========================================================================
   5. Fieldsets (radio groups inside steps)
   ========================================================================= */

.spc-step fieldset {
    border: 1.5px solid #e4e4e4;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 18px;
    background: #fafafa;
}

.spc-step fieldset legend {
    font-weight: 700;
    font-size: 0.875rem;
    color: #333;
    padding: 0 8px;
}

/* Radio / checkbox rows */
.spc-step fieldset label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    font-weight: 400;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    line-height: 1.55;
    padding: 10px 14px;
    border-radius: 7px;
    border: 1.5px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.spc-step fieldset label:last-child {
    margin-bottom: 0;
}

.spc-step fieldset label:hover {
    background: #f0f7ff;
    border-color: #b3d4e8;
}

.spc-step fieldset label:has(input:checked) {
    background: #e8f4fd;
    border-color: #0073aa;
    font-weight: 600;
    color: #004f7a;
}

/* Radio / checkbox inputs */
.spc-step fieldset label input[type="radio"],
.spc-step fieldset label input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 3px;
    cursor: pointer;
    accent-color: #0073aa;
}

/* =========================================================================
   6. Standalone checkbox rows (T&C, marketing consent)
   ========================================================================= */

#spc-inquiry-form label.spc-checkbox-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 0 !important;
    padding: 16px 20px !important;
    margin-bottom: 12px !important;
    border: 1.5px solid #e4e4e4 !important;
    border-radius: 10px !important;
    background: #fafafa !important;
    cursor: pointer !important;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    color: #444 !important;
    line-height: 1.6 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    text-align: left !important;
}

#spc-inquiry-form label.spc-checkbox-row:hover {
    background: #f0f7ff !important;
    border-color: #90c4e0 !important;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.08) !important;
}

/* Checkbox input inside the row */
#spc-inquiry-form label.spc-checkbox-row input[type="checkbox"] {
    flex-shrink: 0 !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    margin: 2px 16px 0 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    accent-color: #0073aa !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    display: inline-block !important;
    vertical-align: top !important;
}

/* Text span inside the row */
#spc-inquiry-form label.spc-checkbox-row span {
    display: block !important;
    flex: 1 !important;
    line-height: 1.65 !important;
}

/* T&C row — highlighted */
#spc-inquiry-form label.spc-checkbox-row.spc-tc-row {
    border-color: #0073aa !important;
    background: #f0f7ff !important;
    font-weight: 600 !important;
    color: #004f7a !important;
}

#spc-inquiry-form label.spc-checkbox-row.spc-tc-row a {
    color: #0073aa !important;
    text-decoration: underline !important;
}

/* Marketing rows — lighter */
#spc-inquiry-form label.spc-checkbox-row.spc-marketing-row {
    font-size: 0.82rem !important;
    color: #555 !important;
    border-color: #e8e8e8 !important;
    background: #fdfdfd !important;
}

#spc-inquiry-form label.spc-checkbox-row.spc-marketing-row:hover {
    background: #f5f9ff !important;
    border-color: #b3d4e8 !important;
}

/* =========================================================================
   7. Step action buttons
   ========================================================================= */

.spc-step-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.spc-back-btn {
    padding: 11px 28px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 2px solid #d0d0d0;
    border-radius: 7px;
    background: #fff;
    color: #555;
    cursor: pointer;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.spc-back-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
    color: #333;
}

.spc-next-btn,
#spc-submit-btn {
    padding: 11px 32px;
    font-size: 0.875rem;
    font-weight: 700;
    border: none;
    border-radius: 7px;
    background: #0073aa;
    color: #fff;
    cursor: pointer;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    box-shadow: 0 3px 10px rgba(0, 115, 170, 0.25);
}

.spc-next-btn:hover,
#spc-submit-btn:hover {
    background: #005f8d;
    box-shadow: 0 5px 16px rgba(0, 115, 170, 0.35);
    transform: translateY(-1px);
}

.spc-next-btn:active,
#spc-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 115, 170, 0.2);
}

#spc-submit-btn {
    background: #28a745;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.25);
    padding: 11px 40px;
}

#spc-submit-btn:hover {
    background: #1e7e34;
    box-shadow: 0 5px 16px rgba(40, 167, 69, 0.35);
}

#spc-submit-btn:disabled {
    background: #aaa;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* =========================================================================
   8. Product Summary
   ========================================================================= */

#spc-product-summary {
    margin-bottom: 22px;
    padding: 14px 18px;
    background: #f8f9fa;
    border: 1.5px solid #e4e4e4;
    border-radius: 8px;
    font-size: 0.875rem;
    min-height: 48px;
}

#spc-product-summary p {
    margin: 0;
    color: #999;
    font-style: italic;
    font-size: 0.875rem;
}

.spc-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.spc-summary-table thead th {
    text-align: left;
    font-weight: 700;
    padding: 7px 10px;
    border-bottom: 2px solid #e0e0e0;
    color: #666;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.spc-summary-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    color: #333;
}

.spc-summary-table tbody tr:last-child td {
    border-bottom: none;
}

.spc-summary-table tfoot td {
    padding: 10px 10px;
    font-weight: 700;
    border-top: 2px solid #e0e0e0;
    font-size: 0.9rem;
    color: #1a1a2e;
}

/* =========================================================================
   9. Payment Fields
   ========================================================================= */

.spc-payment-fields {
    display: none;
    margin-top: 16px;
    padding: 18px 20px;
    background: #f5f8fc;
    border: 1.5px solid #c8daea;
    border-radius: 8px;
}

.spc-payment-fields:not([hidden]) {
    display: block;
}

/* =========================================================================
   10. Inline errors
   ========================================================================= */

.spc-field-error {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #c62828;
}

.spc-field-error::before {
    content: '⚠';
    font-size: 0.85rem;
}

#spc-no-product-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 14px;
    padding: 12px 16px;
    background: #fff8e1;
    border: 1.5px solid #ffc107;
    border-radius: 8px;
    color: #7a5c00;
    font-size: 0.875rem;
    font-weight: 600;
}

#spc-no-product-error::before {
    content: '⚠';
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

#spc-promo-msg {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* =========================================================================
   11. Form message (success / error)
   ========================================================================= */

#spc-form-message {
    display: none;
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
}

#spc-form-message:not(:empty) {
    display: block;
}

#spc-form-message.success {
    background: #e8f5e9;
    border: 1.5px solid #81c784;
    color: #2e7d32;
}

#spc-form-message.error {
    background: #ffebee;
    border: 1.5px solid #e57373;
    color: #c62828;
}

/* =========================================================================
   12. Shipping popup modal
   ========================================================================= */

#spc-shipping-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: spcFadeIn 0.2s ease;
}

@keyframes spcFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#spc-shipping-popup {
    background: #fff;
    border-top: 5px solid #28a745;
    border-radius: 10px;
    max-width: 540px;
    width: 100%;
    padding: 32px 36px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: spcSlideUp 0.25s ease;
}

@keyframes spcSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#spc-shipping-popup p {
    margin: 0 0 24px;
    font-size: 0.92rem;
    color: #333;
    line-height: 1.7;
}

#spc-popup-understood {
    display: block;
    margin: 0 auto;
    padding: 12px 40px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

#spc-popup-understood:hover {
    background: #1e7e34;
    transform: translateY(-1px);
}

/* =========================================================================
   13. Hide WooCommerce cart on single product pages
   ========================================================================= */

.spc-hide-cart .single_add_to_cart_button,
.spc-hide-cart .woocommerce-variation-add-to-cart,
.spc-hide-cart form.cart {
    display: none !important;
}

/* =========================================================================
   14. Back to Product List button
   ========================================================================= */

.spc-back-to-shop {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 24px;
    background: #1a1a2e;
    color: #fff !important;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 7px;
    text-decoration: none !important;
    letter-spacing: 0.04em;
    transition: background 0.2s;
}

.spc-back-to-shop:hover {
    background: #0073aa;
    color: #fff !important;
}

/* =========================================================================
   15. Responsive
   ========================================================================= */

@media (max-width: 600px) {
    #spc-inquiry-form {
        padding: 20px 16px;
        margin: 20px 12px;
    }

    .spc-step-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .spc-back-btn,
    .spc-next-btn,
    #spc-submit-btn {
        width: 100%;
        text-align: center;
    }

    #spc-total-bar {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }
}