/* ===== CHECKOUT PAGE STYLES ===== */

.custom-checkout-page {
    padding: 40px 0 60px;
    min-height: 60vh;
    background: #F5F2EC;
}

.checkout-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #6B4C3B;
    margin-bottom: 32px;
    text-align: right;
}

/* Checkout Layout */
.checkout-layout {
    display: grid;
    gap: 24px;
}

@media (min-width: 1024px) {
    .checkout-layout {
        grid-template-columns: 1fr 420px;
        gap: 32px;
        align-items: start;
    }
}

/* Checkout Sections */
.checkout-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.edit-link,
.edit-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #B08B5B;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-link:hover,
.edit-btn:hover {
    color: #8B6914;
}

/* Products Section */
.products-preview {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.products-thumbnails {
    display: flex;
    gap: 8px;
}

.product-thumb {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quantity-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #B08B5B;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.more-products {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.products-count {
    font-size: 14px;
    color: #666;
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Address Section */
.billing-fields-wrapper {
    padding: 20px;
}

.billing-fields-wrapper .woocommerce-billing-fields__field-wrapper {
    display: grid;
    gap: 16px;
}

.billing-fields-wrapper .form-row {
    margin: 0;
}

.billing-fields-wrapper label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.billing-fields-wrapper .woocommerce-input-wrapper {
    width: 100%;
}

.billing-fields-wrapper input[type="text"],
.billing-fields-wrapper input[type="email"],
.billing-fields-wrapper input[type="tel"],
.billing-fields-wrapper select,
.billing-fields-wrapper textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.billing-fields-wrapper input:focus,
.billing-fields-wrapper select:focus,
.billing-fields-wrapper textarea:focus {
    outline: none;
    border-color: #B08B5B;
    box-shadow: 0 0 0 3px rgba(176, 139, 91, 0.1);
}

.billing-fields-wrapper .select2-container .select2-selection--single {
    height: 44px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.billing-fields-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    padding-right: 14px;
}

/* Two columns for some fields */
@media (min-width: 768px) {
    .billing-fields-wrapper .woocommerce-billing-fields__field-wrapper {
        grid-template-columns: 1fr 1fr;
    }

    .billing-fields-wrapper .form-row-wide {
        grid-column: 1 / -1;
    }
}

/* Shipping Section */
.shipping-methods-wrapper {
    padding: 16px 20px;
}

.shipping-methods-wrapper .woocommerce-shipping-methods {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shipping-methods-wrapper .woocommerce-shipping-methods li {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shipping-methods-wrapper .woocommerce-shipping-methods li:hover {
    border-color: #B08B5B;
}

.shipping-methods-wrapper .woocommerce-shipping-methods li input[type="radio"] {
    margin-left: 12px;
}

.shipping-methods-wrapper .woocommerce-shipping-methods label {
    display: flex;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
}

/* Policy Section */
.policy-section {
    background: #FFF8F0;
    border: 1px solid #F0E6D8;
}

.policy-content {
    padding: 16px 20px;
}

.policy-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: #6B4C3B;
    margin: 0 0 8px 0;
}

.policy-content p {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* Payment Methods Section */
.payment-methods-wrapper {
    padding: 0;
}

.payment-methods-wrapper ul.payment_methods {
    list-style: none;
    padding: 0;
    margin: 0;
}

.payment-methods-wrapper .wc_payment_method {
    border-bottom: 1px solid #f0f0f0;
}

.payment-methods-wrapper .wc_payment_method:last-child {
    border-bottom: none;
}

.payment-methods-wrapper .wc_payment_method input[type="radio"] {
    display: none;
}

.payment-method-label {
    display: flex !important;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-method-label:hover {
    background: #f9f9f9;
}

.wc_payment_method input[type="radio"]:checked+.payment-method-label {
    background: #FFF8F0;
    border-right: 3px solid #B08B5B;
}

.payment-method-icon {
    width: 50px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
}

.payment-method-icon img {
    max-width: 100%;
    max-height: 100%;
}

.payment-method-icon svg {
    color: #666;
}

.payment-method-info {
    flex: 1;
}

.payment-method-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.payment-method-desc {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.payment-method-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.wc_payment_method input[type="radio"]:checked+.payment-method-label .payment-method-radio {
    border-color: #B08B5B;
}

.wc_payment_method input[type="radio"]:checked+.payment-method-label .payment-method-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #B08B5B;
    border-radius: 50%;
}

.payment_box {
    padding: 16px 20px;
    background: #f9f9f9;
    border-top: 1px solid #f0f0f0;
}

/* Coupon Section */
.coupon-form-wrapper {
    padding: 16px 20px;
}

.coupon-input-group {
    display: flex;
    gap: 8px;
}

.coupon-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.coupon-input:focus {
    outline: none;
    border-color: #B08B5B;
    box-shadow: 0 0 0 3px rgba(176, 139, 91, 0.1);
}

.apply-coupon-btn {
    padding: 12px 20px;
    background: #B08B5B;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.apply-coupon-btn:hover {
    background: #D9B382;
}

.applied-coupon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #e8f5e9;
    border-top: 1px solid #c8e6c9;
}

.coupon-code {
    font-weight: 600;
    color: #2e7d32;
}

.remove-coupon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
    color: #999;
    font-size: 18px;
    transition: all 0.3s ease;
}

.remove-coupon:hover {
    background: #ef5350;
    color: #fff;
}

/* Order Summary Section */
.order-summary {
    padding: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-of-type {
    border-bottom: none;
}

.summary-row .label {
    font-size: 14px;
    color: #666;
}

.summary-row .value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.summary-row.discount-row .value {
    color: #2e7d32;
}

.summary-row.total-row {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid #f0f0f0;
}

.summary-row.total-row .label {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.summary-row.total-row .value {
    font-size: 20px;
    font-weight: 700;
    color: #B08B5B;
}

.tax-note {
    font-size: 12px;
    color: #888;
    text-align: left;
    margin-top: 8px;
    margin-bottom: 0;
}

/* Place Order Section */
.place-order-section {
    padding: 20px;
}

.place-order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: #B08B5B !important;
    color: #fff !important;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.place-order-btn:hover {
    background: #D9B382 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(176, 139, 91, 0.3);
}

.place-order-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.place-order-section .security-badges {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.place-order-section .badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
}

.place-order-section .badge svg {
    color: #B08B5B;
}

/* Responsive */
@media (max-width: 768px) {
    .custom-checkout-page {
        padding: 24px 0 40px;
    }

    .checkout-page-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .checkout-section {
        margin-bottom: 12px;
    }

    .section-header {
        padding: 14px 16px;
    }

    .products-preview,
    .billing-fields-wrapper,
    .shipping-methods-wrapper,
    .policy-content,
    .coupon-form-wrapper,
    .order-summary,
    .place-order-section {
        padding: 14px 16px;
    }

    .payment-method-label {
        padding: 14px 16px;
    }

    .coupon-input-group {
        flex-direction: column;
    }

    .apply-coupon-btn {
        width: 100%;
    }

    .place-order-section .security-badges {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}

/* WooCommerce Overrides */
.woocommerce-checkout .woocommerce-NoticeGroup,
.woocommerce-checkout .woocommerce-error,
.woocommerce-checkout .woocommerce-info,
.woocommerce-checkout .woocommerce-message {
    margin-bottom: 20px;
    border-radius: 10px;
}

.woocommerce-checkout .blockUI.blockOverlay {
    background: rgba(255, 255, 255, 0.8) !important;
}

.woocommerce-checkout .blockUI.blockOverlay::before {
    border-color: #B08B5B transparent transparent;
}

/* Hide default WooCommerce elements we've replaced */
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout .woocommerce-checkout-review-order-table {
    display: none;
}

/* Required field asterisk styling */
.billing-fields-wrapper .required {
    color: #ef5350;
}

/* Thawani Payment Icon Specifics */
.payment-method-icon.thawani-icon-wrapper {
    width: auto;
    min-width: 50px;
    height: auto;
    padding: 2px 0;
}

.thawani-checkout-logo {
    height: 36px;
    width: auto;
    max-width: 120px;
}

.thawani-sub-icons {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.thawani-sub-icons img {
    height: 20px;
    width: auto;
    opacity: 0.8;
}