:root {
    --wcdc-primary: #8b5cf6;
    --wcdc-primary-hover: #7c3aed;
    --wcdc-primary-light: #f5f3ff;
    --wcdc-blue: #8b5cf6;
    --wcdc-green: #8b5cf6;
    --wcdc-green-hover: #7c3aed;
    --wcdc-bg: #fff;
    --wcdc-bg-alt: #f9fafb;
    --wcdc-border: #d1d5db;
    --wcdc-text: #111;
    --wcdc-text-muted: #6b7280;
    --wcdc-radius: 12px;
    --wcdc-radius-sm: 8px;
    --wcdc-shadow: 0 4px 6px rgba(0,0,0,0.05);
    --wcdc-shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
    --wcdc-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wcdc-checkout-wrapper {
    margin: 30px 0;
    font-family: var(--wcdc-font);
    color: var(--wcdc-text);
    line-height: 1.5;
    box-sizing: border-box;
}

.wcdc-checkout-wrapper *,
.wcdc-checkout-wrapper *::before,
.wcdc-checkout-wrapper *::after {
    box-sizing: border-box;
}

.wcdc-checkout-inner {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 16px;
}

.wcdc-header {
    margin-bottom: 22px;
    text-align: center;
}

.wcdc-section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--wcdc-text);
}

.wcdc-header-desc {
    font-size: 13px;
    color: var(--wcdc-text-muted);
    margin: 0;
}

.wcdc-section-subtitle {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--wcdc-text);
}

/* ------ Main Layout (single column) ------ */

.wcdc-main-layout {
    display: block;
}

.wcdc-form-column {
    max-width: 560px;
    margin: 0 auto;
    background: var(--wcdc-bg);
    border: 1px solid var(--wcdc-border);
    border-radius: var(--wcdc-radius);
    padding: 28px 24px;
    box-shadow: var(--wcdc-shadow);
}

/* ------ Variations ------ */

.wcdc-variations-section {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--wcdc-border);
}

.wcdc-attribute-group {
    margin-bottom: 12px;
}

.wcdc-attribute-group:last-child {
    margin-bottom: 0;
}

.wcdc-attribute-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--wcdc-text-muted);
}

.wcdc-color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wcdc-color-radio {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.wcdc-color-radio input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wcdc-color-swatch {
    display: inline-block;
    padding: 6px 16px;
    border: 2px solid var(--wcdc-border);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: var(--wcdc-bg);
}

.wcdc-color-radio input:checked + .wcdc-color-swatch {
    border-color: var(--wcdc-primary);
    background: var(--wcdc-primary-light);
    box-shadow: 0 0 0 1px var(--wcdc-primary);
}

.wcdc-size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wcdc-size-btn {
    padding: 7px 16px;
    border: 2px solid var(--wcdc-border);
    border-radius: var(--wcdc-radius-sm);
    background: var(--wcdc-bg);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--wcdc-text);
    font-family: var(--wcdc-font);
}

.wcdc-size-btn:hover {
    border-color: var(--wcdc-blue);
    background: rgba(52, 152, 219, 0.05);
}

.wcdc-size-btn.active {
    border-color: var(--wcdc-blue);
    background: var(--wcdc-blue);
    color: #fff;
}

/* ------ Quantity ------ */

.wcdc-quantity-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--wcdc-border);
}

.wcdc-quantity-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--wcdc-border);
    border-radius: var(--wcdc-radius-sm);
    overflow: hidden;
}

.wcdc-qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: var(--wcdc-bg-alt);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    color: var(--wcdc-text);
    font-family: var(--wcdc-font);
    line-height: 1;
}

.wcdc-qty-btn:hover {
    background: #e9ecef;
}

.wcdc-qty-input {
    width: 50px;
    height: 38px;
    border: none;
    border-left: 1px solid var(--wcdc-border);
    border-right: 1px solid var(--wcdc-border);
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--wcdc-font);
    color: var(--wcdc-text);
    background: var(--wcdc-bg);
    -moz-appearance: textfield;
}

.wcdc-qty-input::-webkit-outer-spin-button,
.wcdc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wcdc-qty-input:focus {
    outline: none;
}

/* ------ Fields ------ */

.wcdc-fields-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--wcdc-border);
}

.wcdc-field-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.wcdc-field-row:last-child {
    margin-bottom: 0;
}

.wcdc-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wcdc-field-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--wcdc-text);
}

.wcdc-required {
    color: var(--wcdc-error, #e74c3c);
}

.wcdc-field-input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--wcdc-border);
    border-radius: var(--wcdc-radius-sm);
    font-size: 14px;
    font-family: var(--wcdc-font);
    background: var(--wcdc-bg);
    color: var(--wcdc-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.wcdc-field-input:focus {
    outline: none;
    border-color: var(--wcdc-blue);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.wcdc-field-input::placeholder {
    color: #adb5bd;
}

.wcdc-field-input.error {
    border-color: var(--wcdc-error, #e74c3c);
}

/* ------ Shipping ------ */

.wcdc-shipping-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--wcdc-border);
}

.wcdc-shipping-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wcdc-shipping-option {
    position: relative;
    cursor: pointer;
    display: block;
}

.wcdc-shipping-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wcdc-shipping-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border: 1px solid var(--wcdc-border);
    border-radius: var(--wcdc-radius-sm);
    transition: all 0.2s ease;
}

.wcdc-shipping-option input:checked + .wcdc-shipping-content {
    border-color: var(--wcdc-primary);
    background: var(--wcdc-primary-light);
    box-shadow: 0 0 0 1px var(--wcdc-primary);
}

.wcdc-shipping-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--wcdc-text);
    flex: 1;
}

.wcdc-shipping-desc {
    font-size: 12px;
    color: var(--wcdc-text-muted);
}

.wcdc-shipping-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--wcdc-text);
    white-space: nowrap;
}

/* ------ Order Summary ------ */

.wcdc-order-summary {
    margin-bottom: 16px;
    padding: 0;
}

.wcdc-summary-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--wcdc-border);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wcdc-summary-product {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--wcdc-border);
}

.wcdc-summary-product-img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.wcdc-summary-product-info {
    flex: 1;
    min-width: 0;
}

.wcdc-summary-product-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--wcdc-text);
    line-height: 1.3;
    margin-bottom: 2px;
}

.wcdc-summary-product-qty {
    font-size: 12px;
    color: var(--wcdc-text-muted);
}

.wcdc-summary-product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--wcdc-text);
    white-space: nowrap;
    flex-shrink: 0;
}

.wcdc-summary-attributes {
    font-size: 12px;
    color: var(--wcdc-text-muted);
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--wcdc-border);
    line-height: 1.6;
}

.wcdc-summary-totals {
    width: 100%;
    border-collapse: collapse;
}

.wcdc-summary-totals tr:not(:last-child) td {
    padding: 4px 0;
    font-size: 13px;
    color: var(--wcdc-text-muted);
}

.wcdc-summary-totals td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--wcdc-text);
}

.wcdc-summary-total-row td {
    padding-top: 8px;
    border-top: 1px solid var(--wcdc-border);
    font-size: 14px;
}

.wcdc-summary-total-row td:last-child {
    font-size: 18px;
    font-weight: 800;
    color: var(--wcdc-primary);
}

/* ------ Action Buttons ------ */

.wcdc-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wcdc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: var(--wcdc-radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: var(--wcdc-font);
}

.wcdc-btn-icon {
    font-size: 17px;
    line-height: 1;
}

.wcdc-btn-buy {
    background: var(--wcdc-primary);
    color: #fff;
}

.wcdc-btn-buy:hover {
    background: var(--wcdc-primary-hover);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

.wcdc-btn-buy:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    box-shadow: none;
}

.wcdc-btn-whatsapp {
    background: var(--wcdc-green);
    color: #fff;
}

.wcdc-btn-whatsapp:hover {
    background: var(--wcdc-green-hover);
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.3);
}

/* ------ Response Message ------ */

.wcdc-form-response {
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: var(--wcdc-radius-sm);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.wcdc-form-response.success {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.wcdc-form-response.error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--wcdc-primary);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* ------ Spinner ------ */

.wcdc-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wcdc-spin 0.6s linear infinite;
}

@keyframes wcdc-spin {
    to { transform: rotate(360deg); }
}

/* ------ RTL ------ */

body.rtl .wcdc-main-layout {
    direction: rtl;
}

body.rtl .wcdc-summary-totals td:last-child {
    text-align: left;
}

/* ------ Responsive ------ */

@media (max-width: 600px) {
    .wcdc-checkout-inner {
        padding: 0 10px;
    }

    .wcdc-form-column {
        padding: 20px 16px;
        border-radius: var(--wcdc-radius-sm);
    }

    .wcdc-field-row {
        flex-direction: column;
        gap: 12px;
    }

    .wcdc-section-title {
        font-size: 17px;
    }

    .wcdc-btn {
        font-size: 14px;
        padding: 14px 16px;
    }

    .wcdc-summary-product-img {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 380px) {
    .wcdc-form-column {
        padding: 16px 12px;
    }

    .wcdc-shipping-content {
        flex-wrap: wrap;
        gap: 4px;
    }

    .wcdc-shipping-price {
        width: 100%;
        text-align: left;
    }
}

/* ------ Custom Design Overhaul (Purple Theme) ------ */

.wcdc-form-column {
    border: 3px solid var(--wcdc-primary);
    box-shadow: none;
}

/* Shipping Options Side-by-Side */
.wcdc-shipping-options {
    flex-direction: row;
    gap: 15px;
}

.wcdc-shipping-option {
    flex: 1;
}

.wcdc-shipping-content {
    flex-direction: column;
    justify-content: center;
    padding: 15px;
    text-align: center;
    gap: 8px;
}

.wcdc-shipping-name {
    flex: unset;
}

/* Fields Grid (2 columns) */
#wcdc-dynamic-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.wcdc-field-row {
    margin: 0;
}

/* Make full-width if needed (optional) */
/* .wcdc-field-row:nth-child(3) { grid-column: 1 / -1; } */

/* Upsells */
.wcdc-upsell-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--wcdc-border);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.wcdc-upsell-option.wcdc-selected {
    border-color: var(--wcdc-primary);
    background-color: var(--wcdc-primary-light);
}

.wcdc-upsell-option input[type="radio"] {
    margin: 0 0 0 10px;
    width: 20px;
    height: 20px;
    accent-color: var(--wcdc-primary);
}

.wcdc-upsell-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wcdc-upsell-title {
    font-weight: 600;
    font-size: 15px;
}

.wcdc-upsell-badge {
    background: #fef08a;
    color: #854d0e;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
    font-weight: bold;
}

.wcdc-upsell-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.wcdc-price-current {
    font-weight: bold;
    color: var(--wcdc-primary);
    font-size: 16px;
}

.wcdc-price-old {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 12px;
}

.wcdc-icon-lightning {
    color: #f59e0b;
}

@media (max-width: 480px) {
    #wcdc-dynamic-fields {
        grid-template-columns: 1fr;
    }
}

/* Force input text color to black */
.wcdc-field-input, 
.wcdc-field-input:focus, 
.wcdc-field-input:active {
    color: #000000 !important;
}

/* Force input text color to black with ultra specificity to override Elementor themes */
body .wcdc-checkout-wrapper input.wcdc-field-input,
body .wcdc-checkout-wrapper select.wcdc-field-input,
body .wcdc-checkout-wrapper textarea.wcdc-field-input,
body .wcdc-checkout-wrapper input.wcdc-field-input:focus,
body .wcdc-checkout-wrapper select.wcdc-field-input:focus,
body .wcdc-checkout-wrapper textarea.wcdc-field-input:focus {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}

body .wcdc-checkout-wrapper input.wcdc-field-input::placeholder,
body .wcdc-checkout-wrapper select.wcdc-field-input::placeholder,
body .wcdc-checkout-wrapper textarea.wcdc-field-input::placeholder {
    color: #6b7280 !important;
    -webkit-text-fill-color: #6b7280 !important;
}
