/* ==========================================================================
   DS Checkout – Styles
   ========================================================================== */

/* --- Layout --- */
.ds-checkout-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 460px;
    gap: 30px;
    align-items: start;
    margin-top: 20px;
}

.ds-checkout-billing,
.ds-checkout-order {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Mobile Layout Helpers (Desktop default) */
.ds-mobile-step-header,
.ds-mobile-step-footer {
    display: none;
}

@media screen and (max-width: 991px) {
    .ds-checkout-wrapper {
        grid-template-columns: 1fr;
    }

    /* Mobile Two-Step Logic */
    .ds-checkout-mobile-step {
        display: none;
    }

    .ds-checkout-wrapper.ds-step-1-active .ds-checkout-mobile-step-1 {
        display: flex;
    }

    .ds-checkout-wrapper.ds-step-2-active .ds-checkout-mobile-step-2 {
        display: flex;
    }

    /* Mobile Nav Buttons */
    .ds-mobile-step-header {
        display: flex;
        margin-bottom: -10px;
        padding-top: 10px;
    }

    .ds-mobile-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: none;
        border: none;
        padding: 0;
        font-size: 14px;
        font-weight: 600;
        color: #64748b;
        cursor: pointer;
    }

    .ds-mobile-back-btn:hover {
        color: #0f172a;
    }

    .ds-mobile-step-footer {
        display: flex;
        margin-top: -10px;
    }

    .ds-mobile-continue-btn {
        width: 100%;
        background: var(--ds-primary-gradient) !important;
        color: #fff !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        padding: 16px !important;
        border: none !important;
        border-radius: 8px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px !important;
    }
}

/* --- Checkout Header (Title & SSL) --- */
.ds-checkout-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
}

.ds-checkout-header-titles h1 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.ds-checkout-header-titles p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.ds-checkout-ssl {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media screen and (max-width: 600px) {
    .ds-checkout-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* --- Cards --- */
.ds-checkout-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    padding: 24px;
    position: relative;
}

@media screen and (max-width: 767px) {
    .ds-checkout-card {
        padding: 16px;
    }

    #place_order {
        margin-top: 0 !important;
    }

    .woocommerce form .form-row {
        float: none !important;
        width: 100% !important;
    }
}

.ds-checkout-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}


.ds-checkout-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ds-checkout-step-number.active {
    background: var(--ds-primary);
    color: #fff;
}

.ds-checkout-card-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    color: var(--ds-text);
    display: flex;
    align-items: center;
}

.ds-checkout-card-header h2 svg {
    margin-right: 8px;
}

/* Edit action for completed steps */
.ds-checkout-card-action {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    cursor: pointer;
}

/* --- Form Fields (Shipping) --- */
.col2-set {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.col2-set .col-1,
.col2-set .col-2 {
    width: 100%;
    max-width: 100%;
    float: none;
    margin: 0;
    padding: 0;
}

.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3,
.woocommerce-additional-fields h3 {
    display: none;
    /* Hide default WC titles */
}

/* Fields Grid Layout */
.woocommerce form .form-row {
    padding: 0;
    margin-bottom: 12px !important;
}

.woocommerce form .form-row.notes,
.woocommerce form .form-row.ds-place-order-container {
    margin-bottom: 0 !important;
}

.woocommerce form .form-row-first {
    width: 48%;
    float: left;
}

.woocommerce form .form-row-last {
    width: 48%;
    float: right;
}

.woocommerce form .form-row-wide {
    width: 100%;
    clear: both;
}

.woocommerce form .form-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
    line-height: 1.2;
}

.woocommerce form .form-row .required {
    color: #ef4444;
    text-decoration: none;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.select2-container .select2-selection--single {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #0f172a;
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: none;
}

.woocommerce form .form-row textarea {
    height: 100px;
    padding: 12px 14px;
    resize: vertical;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.select2-container.select2-container--open .select2-selection--single {
    background-color: #fff;
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.select2-container .select2-selection--single .select2-selection__rendered {
    padding-left: 0;
    color: var(--ds-text);
    display: flex;
    height: 100% !important;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

/* Hide checkbox labels slightly */
.woocommerce form .form-row.create-account,
.woocommerce form .form-row#ship-to-different-address {
    margin-top: 10px;
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: 6px;
}

.woocommerce form .form-row#ship-to-different-address label {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.woocommerce form .form-row#ship-to-different-address input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* --- Shipping Methods Mockup Style --- */
.ds-checkout-shipping-methods-container.shipping {
    display: block;
    width: 100%;
}

.shipping th {
    display: none;
}

.shipping td {
    display: block;
    width: 100%;
}

#shipping_method {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

#shipping_method li {
    margin: 0 !important;
    padding: 0;
}

/* Wrapper for radio inputs */
.ds-shipping-method-wrapper {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    margin-bottom: 0 !important;
    cursor: pointer !important;
    position: relative !important;
    background: #fff !important;
    transition: all 0.2s;
}

.ds-shipping-method-wrapper:hover {
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
}

/* Need JS to add this class or use CSS :has() */
.ds-shipping-method-wrapper:has(input:checked) {
    border-color: #2563eb !important;
    background: #eff6ff !important;
}

.ds-shipping-method-wrapper input[type="radio"] {
    margin: 4px 0 0 0 !important;
    width: 20px !important;
    height: 20px !important;
    accent-color: #2563eb !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

.ds-shipping-method-info {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

.ds-shipping-method-details {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.ds-shipping-method-name {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
}

.ds-shipping-method-desc {
    font-size: 12px !important;
    color: #64748b !important;
}

.ds-shipping-method-price {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
}

/* --- Payment Methods --- */
#payment {
    background: transparent;
    border-radius: 0;
}

#payment ul.payment_methods {
    padding: 0;
    border-bottom: 0 !important;
    margin: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#payment ul.payment_methods::after {
    content: none !important;
}

#payment ul.payment_methods li.wc_payment_method {
    list-style: none;
    margin: 0;
}

#payment ul.payment_methods li.wc_payment_method>div:not(.ds-payment-method-wrapper) {
    display: none !important;
}

.ds-payment-method-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    margin-bottom: 0 !important;
    background: #fff !important;
    transition: all 0.2s !important;
    width: 100%;
}

.ds-payment-method-wrapper:has(input:checked) {
    border-color: #2563eb !important;
    background: #eff6ff !important;
}

#payment ul.payment_methods li.wc_payment_method input[type="radio"] {
    margin: 0 !important;
    width: 20px !important;
    height: 20px !important;
    accent-color: #2563eb !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}

.ds-payment-method-label {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    cursor: pointer !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ds-payment-method-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.ds-payment-method-name {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.ds-payment-method-wrapper:has(input:checked) .ds-payment-method-name {
    color: #2563eb;
}

.ds-payment-method-wrapper:has(input:checked) .ds-payment-icon {
    color: #2563eb;
}

#payment ul.payment_methods li.wc_payment_method .ds-payment-method-label img {
    max-height: 32px !important;
    width: auto !important;
    display: none !important;
}

.ds-payment-method-icon {
    display: flex;
}

/* Icon placeholder */
.ds-payment-icon {
    color: #94a3b8;
    margin-bottom: 0;
}

#payment div.payment_box {
    background-color: #edf2fa !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 20px !important;
    color: var(--ds-text) !important;
    font-size: 14px !important;
    margin: 12px 0 0 0 !important;
    box-shadow: none !important;
    width: 100% !important;
}

.woocommerce-checkout #payment div.payment_box::before {
    border-bottom-color: #edf2fa !important;
}

#payment div.payment_box::before {
    display: none;
}

#payment div.payment_box p:first-child {
    margin-top: 0;
}

#payment div.payment_box p:last-child {
    margin-bottom: 0;
}



/* --- Order Review Details --- */
.ds-checkout-order h3#order_review_heading {
    display: none;
    /* Replaced by card header */
}

.woocommerce-checkout-review-order-table {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Products List */
.ds-review-order-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ds-review-item {
    display: flex;
    gap: 16px;
}

.ds-review-item-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ds-review-item-img {
    width: 74px;
    height: 74px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
}

.ds-review-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ds-review-item-name-wrap {
    display: flex;
    align-items: flex-start;
	justify-content: space-between;
}

.ds-review-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 4px 0;
    line-height: 1.3;
    padding-right: 16px;
}

.ds-review-item-meta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.ds-review-item-qty {
    display: inline-flex;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
}

.ds-review-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-left: auto;
    align-self: center;
    /* Center vertically with item */
}

/* Totals */
.ds-review-totals {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ds-review-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-text);
}

.ds-review-total-row .amount {
    font-weight: 600;
    color: var(--ds-text);
}

.ds-review-total-row--free .amount {
    color: #10b981;
}

.ds-review-total-row.order-total {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 12px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.ds-review-total-row.order-total .amount {
    font-size: 18px;
    color: #2563eb;
}

/* Submit Button & Policies */
#place_order {
    width: 100%;
    background: var(--ds-primary-gradient);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

#place_order:hover {
    background: var(--ds-primary);
}

.woocommerce-terms-and-conditions-wrapper {
    display: none;
}

.woocommerce-terms-and-conditions-wrapper p {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 0;
}

.woocommerce-terms-and-conditions-wrapper a {
    color: #64748b;
    text-decoration: underline;
}

/* Badges */
.ds-order-badges {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.ds-order-badge {
    flex: 1;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ds-order-badge svg {
    color: #2563eb;
    flex-shrink: 0;
}

.ds-order-badge-text {
    display: flex;
    flex-direction: column;
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.ds-order-badge-text strong {
    font-size: 12px;
    color: #0f172a;
    text-transform: none;
    letter-spacing: 0;
}

/* Overriding blockUI overlay */
.blockUI.blockOverlay {
    background: rgba(255, 255, 255, 0.6) !important;
    border-radius: 12px;
    backdrop-filter: blur(2px);
}

/* Coupon Form in Review Order */
.ds-review-coupon-form {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e2e8f0;
}

.ds-review-coupon-form .ds-coupon-input {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 13px;
    transition: border-color 0.2s;
}

.ds-review-coupon-form .ds-coupon-input:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
}

.ds-review-coupon-form .ds-apply-coupon {
    height: 40px;
    padding: 0 16px;
    background: var(--ds-primary-gradient) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--ds-radius) !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ds-review-coupon-form .ds-apply-coupon:hover {
    background: var(--ds-primary);
}

.ds-review-applied-coupons {
    margin-top: 12px;
}

/* --- Checkout Quantity Controls & Remove --- */
.ds-checkout-qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    height: 28px;
    margin-top: 6px;
    flex: none !important;
}

.ds-checkout-qty-control .ds-qty-btn {
    background: #f8fafc;
    border: none;
    width: 28px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 500;
    color: #475569;
    transition: background 0.2s;
    padding: 0;
}

.ds-checkout-qty-control .ds-qty-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Hide WooCommerce Privacy Policy Text */
.woocommerce-checkout .woocommerce-privacy-policy-text {
    display: none !important;
}

.ds-checkout-qty-control .ds-qty-input {
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    width: 36px;
    height: 100%;
    text-align: center;
    padding: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.ds-review-item-qty {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    padding: 0;
}

.ds-checkout-remove-item {
    font-size: 12px;
    font-weight: 500;
    color: var(--ds-primary);
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    margin-top: 2px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}

.ds-checkout-remove-item:hover {
    color: var(--ds-primary);
}

.ds-checkout-remove-item svg {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}