/* WooCheckout Forms — Frontend Styles */

.wcf-form-wrap *,
.wcf-form-wrap *::before,
.wcf-form-wrap *::after {
    box-sizing: border-box;
}

.wcf-form-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 960px;
    margin: 0 auto;
}

/* ── Two-column layout ── */
.wcf-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.wcf-col-heading {
    font-size: 18px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

/* ── Billing fields ── */
.wcf-billing-field {
    margin-bottom: 14px;
}
.wcf-billing-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}
.wcf-required { color: #ef4444; margin-left: 2px; }

.wcf-billing-field input[type="text"],
.wcf-billing-field input[type="tel"],
.wcf-billing-field input[type="email"],
.wcf-billing-field textarea {
    width: 100%;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #1e1e1e;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.wcf-billing-field input:focus,
.wcf-billing-field textarea:focus {
    outline: none;
    border-color: #7F77DD;
    box-shadow: 0 0 0 3px rgba(127, 119, 221, 0.15);
}
.wcf-billing-field textarea { resize: vertical; min-height: 80px; }

/* ── WooCommerce native form-row fields (woocommerce_form_field output) ── */
/* Reset WC's float-based layout — stack fields full-width */
.wcf-col-billing p.form-row {
    float: none !important;
    clear: both;
    width: 100% !important;
    margin: 0 0 14px 0;
    padding: 0;
}
/* Label */
.wcf-col-billing p.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}
.wcf-col-billing p.form-row label .required {
    color: #ef4444;
    margin-left: 2px;
    text-decoration: none;
}
/* Remove WC's input-wrapper span from affecting layout */
.wcf-col-billing p.form-row .woocommerce-input-wrapper {
    display: block;
    width: 100%;
}
/* Inputs — match existing wcf-billing-field style exactly */
.wcf-col-billing p.form-row input.input-text,
.wcf-col-billing p.form-row select,
.wcf-col-billing p.form-row textarea {
    width: 100%;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #1e1e1e;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    box-sizing: border-box;
    box-shadow: none;
    -webkit-appearance: none;
}
.wcf-col-billing p.form-row input.input-text:focus,
.wcf-col-billing p.form-row select:focus,
.wcf-col-billing p.form-row textarea:focus {
    outline: none;
    border-color: #7F77DD;
    box-shadow: 0 0 0 3px rgba(127, 119, 221, 0.15);
}
.wcf-col-billing p.form-row textarea {
    resize: vertical;
    min-height: 80px;
}

/* ── Product list ── */
.wcf-product-list { margin-bottom: 16px; }

.wcf-product-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #fff;
}
.wcf-product-option:hover { border-color: #c4b5fd; background: #fafafa; }
.wcf-product-option.wcf-selected { border-color: #7F77DD; background: #faf9ff; }
.wcf-product-option input[type="radio"],
.wcf-product-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0c9e69;
    flex-shrink: 0;
    cursor: pointer;
}
.wcf-product-details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}
.wcf-product-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.wcf-product-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.wcf-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e1e1e;
}
.wcf-product-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}
.wcf-product-desc p { margin: 0; }
.wcf-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #0c9e69;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}
.wcf-product-price del { color: #9ca3af; font-weight: 400; font-size: 13px; }
.wcf-product-price ins { text-decoration: none; }

/* ── Order total ── */
.wcf-order-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 14px;
}
.wcf-total-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}
.wcf-total-value {
    font-size: 20px;
    font-weight: 700;
    color: #7F77DD;
}
.wcf-total-value .woocommerce-Price-amount { font-size: 20px; }

/* ── Submit button ── */
.wcf-submit-btn {
    width: 100%;
    background: #0c9e69;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}
.wcf-submit-btn:hover  { background: #0fd089; color: #ffffff}
.wcf-submit-btn:active { transform: scale(0.98); }
.wcf-submit-btn:disabled { background: #0c9e69; cursor: not-allowed; }

/* ── Error / success messages ── */
.wcf-error-msg {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #991b1b;
    margin-bottom: 12px;
}
.wcf-success-msg {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 8px;
    padding: 14px;
    font-size: 14px;
    font-weight: 500;
    color: #065f46;
    text-align: center;
    margin-bottom: 12px;
}

/* ── Payment note ── */
.wcf-payment-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

/* ── Error page ── */
.wcf-error { color: #991b1b; font-size: 14px; }

/* ── Responsive ── */
@media (max-width: 700px) {
    .wcf-columns {
        grid-template-columns: 1fr;
    }
}

/* ── Product option wrapper ── */
.wcf-product-option-wrap { margin-bottom: 12px; border-radius: 10px; overflow: hidden; }
.wcf-product-option-wrap .wcf-product-option { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wcf-product-option-wrap.wcf-option-wrap-selected .wcf-product-option { border-color: #0c9e69; border-bottom: none; border-radius: 10px 10px 0 0; }

/* ── Sub-options ── */
.wcf-sub-options-wrap {
    border: 1.5px solid #0c9e69;
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    background: #faf9ff;
}

.wcf-sub-group { padding: 12px 14px; border-bottom: 1px solid #ede9fe; }
.wcf-sub-group:last-child { border-bottom: none; }

.wcf-sub-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.wcf-sub-group-label { font-size: 13px; font-weight: 600; color: #1e1e1e; flex: 1; }
.wcf-sub-limit-badge {
    font-size: 11px;
    background: #def4e7;
    color: #0c9e69;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.wcf-sub-limit-badge.wcf-badge-error {
    background: #fee2e2 !important;
    color: #991b1b !important;
}
.wcf-sub-counter { font-size: 11px; color: #6b7280; }

.wcf-shake {
    animation: wcf-shake 0.4s ease;
}
@keyframes wcf-shake {
    0%,100%{transform:translateX(0)} 20%{transform:translateX(-5px)} 60%{transform:translateX(5px)} 80%{transform:translateX(-3px)}
}

/* ── Sub-options grid ── */
.wcf-sub-opts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.wcf-sub-opt-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 6px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #fff;
    text-align: center;
}
.wcf-sub-opt-item:hover { border-color: #0c9e69; background: #faf5ff; }
.wcf-sub-opt-item.wcf-sub-selected { border-color: #0c9e69; background: #def4e7; }
.wcf-sub-opt-item.wcf-sub-selected .wcf-sub-opt-label { color: #0c9e69; }

.wcf-sub-opt-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.wcf-sub-opt-no-img {
    width: 100%;
    aspect-ratio: 1;
    background: var(--color-background-secondary, #f3f4f6);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}
.wcf-sub-opt-label { font-size: 11px; font-weight: 500; color: #374151; line-height: 1.3; }

.wcf-sub-error {
    margin-top: 8px;
    font-size: 12px;
    color: #dc2626;
    background: #fee2e2;
    border-radius: 6px;
    padding: 6px 10px;
}

@media (max-width: 480px) {
    .wcf-sub-opts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Shipping ── */
.wcf-shipping-wrap {
    margin: 10px 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.wcf-shipping-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    background: #f9fafb;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}
.wcf-shipping-rates {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wcf-shipping-rate-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    font-size: 13px;
}
.wcf-shipping-rate-item:hover { border-color: #c4b5fd; background: #faf5ff; }
.wcf-shipping-rate-item.wcf-shipping-selected { border-color: #0c9e69;
    background: #0c9e6914; }
.wcf-shipping-rate-label { flex: 1; color: #1e1e1e; }
.wcf-shipping-rate-cost { font-weight: 600; color: #058255; white-space: nowrap; }
.wcf-shipping-free { color: #059669; }
.wcf-grand-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 10px;
    margin-bottom: 10px;
}
.wcf-grand-total .wcf-total-label { font-size: 14px; font-weight: 700; color: #166534; }
.wcf-grand-total-value { font-size: 18px; font-weight: 800; color: #15803d; }

/* ── Payment Methods ── */
.wcf-payment-methods { margin-bottom: 12px; }
.wcf-payment-header {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: #374151;
    margin-bottom: 8px;
}
.wcf-payment-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    font-size: 13px;
}
.wcf-payment-item:hover { border-color: #c4b5fd; background: #faf5ff; }
.wcf-payment-item.wcf-payment-selected { border-color: #0c9e69;
    background: #def4e7;}
.wcf-payment-label { flex: 1; color: #1e1e1e; }
.wcf-payment-desc {
    font-size: 12px; color: #6b7280;
    padding: 4px 12px 8px 34px;
    margin: 0;
}
.wcf-payment-desc-hidden { display: none; }

/* ── Custom Text below button ── */
.wcf-custom-text {
    font-size: 12px; color: #6b7280;
    text-align: center;
    margin-top: 10px;
    line-height: 1.6;
}
.wcf-custom-text strong, .wcf-custom-text b { color: #374151; }

/* ── WCF OTP Block ─────────────────────────────────────────────── */
.wcf-otp-block {
    margin-top: 8px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color .2s, box-shadow .2s;
}
.wcf-otp-block.wcf-otp-required-highlight {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}
.wcf-otp-block.wcf-otp-verified {
    border-color: #16a34a;
    background: #f0fdf4;
}
.wcf-otp-send-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.wcf-otp-send-btn,
.wcf-otp-verify-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    white-space: nowrap;
}
.wcf-otp-send-btn {
    background: #7F77DD;
    color: #fff;
}
.wcf-otp-send-btn:hover:not(:disabled) { background: #6a62c4; }
.wcf-otp-send-btn:disabled,
.wcf-otp-verify-btn:disabled { opacity: .6; cursor: default; }
.wcf-otp-send-msg,
.wcf-otp-verify-msg {
    font-size: 12px;
    font-weight: 500;
}
.wcf-otp-verify-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.wcf-otp-input {
    width: 130px;
    padding: 6px 10px;
    font-size: 18px;
    letter-spacing: 4px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    text-align: center;
    font-weight: 700;
    outline: none;
    transition: border-color .15s;
}
.wcf-otp-input:focus { border-color: #7F77DD; }
.wcf-otp-verify-btn {
    background: #16a34a;
    color: #fff;
}
.wcf-otp-verify-btn:hover:not(:disabled) { background: #15803d; }
