/**
 * Shajbela Bangladesh 1-Page Checkout Stylesheet
 *
 * Designed with Shajgoj Aesthetic (#E80071):
 * - 2-Column desktop grid / 1-column mobile layout
 * - Radio card delivery zone selectors (Inside Dhaka ৳70 / Outside Dhaka ৳130)
 * - Quantity adjusters (+ / -) in order summary
 * - Prominent Cash on Delivery card
 * - Large sticky submit button
 * - Empty cart state
 *
 * @package Shajbela
 */

/* ==========================================================================
   1. Checkout Container & Header
   ========================================================================== */
.shajbela-checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.shajbela-checkout-header {
    text-align: center;
    margin-bottom: 32px;
}

.shajbela-checkout-page-title {
    font-size: 26px;
    font-weight: 800;
    color: #1A1A1A;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.shajbela-checkout-page-subtitle {
    font-size: 15px;
    color: #666666;
    margin: 0;
}

/* ==========================================================================
   2. 2-Column Grid Layout
   ========================================================================== */
.shajbela-checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 32px;
    align-items: start;
}

.shajbela-checkout-col-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.shajbela-checkout-col-aside {
    position: sticky;
    top: 90px;
    z-index: 20;
}

/* ==========================================================================
   3. Checkout Cards & Headings
   ========================================================================== */
.shajbela-checkout-card,
.shajbela-order-summary-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.shajbela-checkout-card:hover {
    border-color: #D1D5DB;
}

.shajbela-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid #F3F4F6;
}

.shajbela-step-badge {
    width: 32px;
    height: 32px;
    background: #E80071;
    color: #FFFFFF;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(232, 0, 113, 0.3);
}

.shajbela-card-heading-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shajbela-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1F2937;
    margin: 0;
    line-height: 1.3;
}

.shajbela-card-subtitle {
    font-size: 13px;
    color: #6B7280;
}

/* ==========================================================================
   4. Step 1: Form Fields & Inputs
   ========================================================================== */
.shajbela-billing-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shajbela-billing-fields .form-row,
.shajbela-order-notes-wrap .form-row {
    margin: 0 0 16px;
    padding: 0;
    width: 100%;
}

.shajbela-billing-fields label,
.shajbela-order-notes-wrap label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.shajbela-billing-fields label .required {
    color: #E80071;
    font-weight: 700;
    text-decoration: none;
    margin-left: 2px;
}

.shajbela-billing-fields input[type="text"],
.shajbela-billing-fields input[type="tel"],
.shajbela-billing-fields input[type="email"],
.shajbela-order-notes-wrap textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    color: #1F2937;
    background: #FFFFFF;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    box-sizing: border-box;
    transition: all 0.2s ease;
    font-family: inherit;
}

.shajbela-billing-fields input[type="text"]:focus,
.shajbela-billing-fields input[type="tel"]:focus,
.shajbela-billing-fields input[type="email"]:focus,
.shajbela-order-notes-wrap textarea:focus {
    border-color: #E80071;
    background: #FFFFFF;
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 0, 113, 0.15);
}

.shajbela-billing-fields input.shajbela-input-error {
    border-color: #DC2626 !important;
    background: #FEF2F2 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

.shajbela-phone-error-msg {
    display: none;
    color: #DC2626;
    font-size: 13px;
    font-weight: 500;
    margin-top: 6px;
}

.shajbela-phone-error-msg.visible {
    display: block;
}

.shajbela-order-notes-wrap textarea {
    min-height: 70px;
    resize: vertical;
}

/* ==========================================================================
   5. Step 2: Delivery Zone Radio Cards (Inside Dhaka ৳70 / Outside ৳130)
   ========================================================================== */
.shajbela-shipping-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 12px;
}

.shajbela-shipping-card {
    position: relative;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px 14px;
    cursor: pointer;
    background: #FFFFFF;
    transition: all 0.2s ease;
    display: block;
}

.shajbela-shipping-card:hover {
    border-color: #F472B6;
    background: #FFFDFE;
}

.shajbela-shipping-card.active {
    border-color: #E80071;
    background: rgba(232, 0, 113, 0.04);
    box-shadow: 0 0 0 1px #E80071, 0 4px 12px rgba(232, 0, 113, 0.1);
}

.shajbela-shipping-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    margin: 0;
}

.shajbela-shipping-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.shajbela-shipping-radio-circle {
    width: 20px;
    height: 20px;
    border: 2px solid #D1D5DB;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
    background: #FFFFFF;
}

.shajbela-radio-dot {
    width: 10px;
    height: 10px;
    background: #E80071;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.shajbela-shipping-card.active .shajbela-shipping-radio-circle {
    border-color: #E80071;
}

.shajbela-shipping-card.active .shajbela-radio-dot {
    opacity: 1;
    transform: scale(1);
}

.shajbela-shipping-info {
    flex: 1;
    min-width: 0;
}

.shajbela-shipping-title-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.shajbela-shipping-title {
    font-size: 15px;
    font-weight: 700;
    color: #1F2937;
    line-height: 1.3;
}

.shajbela-shipping-badge {
    font-size: 11px;
    font-weight: 600;
    color: #008A45;
    background: #E6F5ED;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
}

.shajbela-shipping-cost {
    font-size: 18px;
    font-weight: 800;
    color: #E80071;
    line-height: 1;
}

.shajbela-shipping-help-text {
    font-size: 12px;
    color: #6B7280;
    margin: 8px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   6. Step 3: Cash on Delivery (COD) Card
   ========================================================================== */
.shajbela-cod-card {
    border: 2px solid #008A45;
    border-radius: 12px;
    padding: 18px;
    background: rgba(0, 138, 69, 0.03);
}

.shajbela-cod-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.shajbela-cod-icon-wrap {
    width: 44px;
    height: 44px;
    background: #E6F5ED;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.shajbela-cod-title-wrap {
    flex: 1;
}

.shajbela-cod-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.shajbela-cod-title {
    font-size: 16px;
    font-weight: 700;
    color: #065F46;
    margin: 0;
}

.shajbela-cod-badge {
    background: #008A45;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

.shajbela-cod-desc {
    font-size: 13px;
    color: #374151;
    margin: 0;
    line-height: 1.5;
}

.shajbela-cod-features {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px dashed rgba(0, 138, 69, 0.2);
}

.shajbela-cod-feature-item {
    font-size: 12.5px;
    color: #065F46;
    display: flex;
    align-items: center;
    gap: 6px;
}

.shajbela-feature-check {
    color: #008A45;
    font-weight: 800;
}

/* ==========================================================================
   7. Step 4: Order Summary Table & Quantity Adjusters (+ / -)
   ========================================================================== */
.shajbela-checkout-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 20px;
}

.shajbela-checkout-table thead th {
    font-size: 13px;
    font-weight: 700;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 0 10px;
    border-bottom: 1.5px solid #E5E7EB;
}

.shajbela-checkout-table thead th.product-total {
    text-align: right;
}

.shajbela-review-item td {
    padding: 14px 0;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: top;
}

.shajbela-product-name-col {
    padding-right: 12px;
}

.shajbela-product-total-col {
    text-align: right;
    font-size: 15px;
    font-weight: 700;
    color: #1F2937;
    white-space: nowrap;
}

.shajbela-item-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.shajbela-item-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.shajbela-checkout-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shajbela-item-details {
    flex: 1;
    min-width: 0;
}

.shajbela-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1F2937;
    line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shajbela-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Quantity Adjuster: Minus / Count / Plus */
.shajbela-checkout-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #E5E7EB;
    border-radius: 6px;
    background: #FFFFFF;
    overflow: hidden;
}

.shajbela-checkout-qty-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: #F9FAFB;
    color: #374151;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
}

.shajbela-checkout-qty-btn:hover:not(:disabled) {
    background: #E80071;
    color: #FFFFFF;
}

.shajbela-checkout-qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.shajbela-checkout-qty-val {
    width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #1F2937;
}

.shajbela-checkout-remove-btn {
    border: none;
    background: none;
    color: #9CA3AF;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
}

.shajbela-checkout-remove-btn:hover {
    color: #DC2626;
    background: #FEE2E2;
}

/* Totals rows */
.shajbela-totals-row th,
.shajbela-totals-row td {
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid #F3F4F6;
}

.shajbela-totals-row th {
    font-weight: 600;
    color: #4B5563;
    text-align: left;
}

.shajbela-totals-row td {
    font-weight: 700;
    color: #1F2937;
    text-align: right;
}

.shajbela-shipping-tag {
    font-size: 11px;
    font-weight: 600;
    color: #E80071;
    background: #FDE8F1;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.shajbela-discount-row th,
.shajbela-discount-row td {
    color: #008A45 !important;
}

.shajbela-grand-total-row th,
.shajbela-grand-total-row td {
    border-top: 2px solid #E5E7EB;
    border-bottom: none;
    padding-top: 14px;
    padding-bottom: 6px;
}

.shajbela-grand-total-row th {
    font-size: 17px;
    font-weight: 800;
    color: #111827;
}

.shajbela-grand-total-row td {
    font-size: 22px;
    font-weight: 900;
    color: #E80071;
}

/* ==========================================================================
   8. Submit Button & WooCommerce Place Order Integration
   ========================================================================== */
.woocommerce-checkout-payment {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Hide redundant payment method list in review-order since COD is highlighted in left column */
.woocommerce-checkout-payment ul.wc_payment_methods {
    display: none !important;
}

.woocommerce-checkout-payment .place-order {
    padding: 0 !important;
    margin: 16px 0 0 !important;
}

/* Large Sticky / Prominent Confirm Button */
#place_order,
.shajbela-checkout-submit-btn {
    width: 100% !important;
    background: #E80071 !important;
    color: #FFFFFF !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    padding: 16px 20px !important;
    border: none !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    text-align: center !important;
    box-shadow: 0 4px 14px rgba(232, 0, 113, 0.35) !important;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease !important;
    display: block !important;
    box-sizing: border-box !important;
    line-height: 1.3 !important;
}

#place_order:hover,
.shajbela-checkout-submit-btn:hover {
    background: #C4005E !important;
    box-shadow: 0 6px 18px rgba(232, 0, 113, 0.45) !important;
}

#place_order:active,
.shajbela-checkout-submit-btn:active {
    transform: scale(0.99);
}

#place_order.loading,
#place_order.disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}

/* Trust Guarantees Box */
.shajbela-checkout-trust-box {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed #E5E7EB;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shajbela-trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shajbela-trust-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.shajbela-trust-text {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    line-height: 1.35;
}

.shajbela-trust-text strong {
    color: #1F2937;
    font-weight: 700;
}

.shajbela-trust-text span {
    color: #6B7280;
}

.shajbela-trust-phone {
    color: #E80071;
    font-weight: 700;
    text-decoration: none;
}

.shajbela-trust-phone:hover {
    text-decoration: underline;
}

/* ==========================================================================
   9. Clean Empty Cart State
   ========================================================================== */
.shajbela-checkout-empty {
    max-width: 480px;
    margin: 60px auto;
    padding: 48px 24px;
    text-align: center;
    background: #FFFFFF;
    border-radius: 16px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.shajbela-checkout-empty-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    background: #FDE8F1;
    color: #E80071;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shajbela-checkout-empty-title {
    font-size: 22px;
    font-weight: 800;
    color: #1F2937;
    margin: 0 0 8px;
}

.shajbela-checkout-empty-text {
    font-size: 15px;
    color: #6B7280;
    margin: 0 0 24px;
}

.shajbela-checkout-empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #E80071;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    padding: 13px 28px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(232, 0, 113, 0.3);
}

.shajbela-checkout-empty-btn:hover {
    background: #C4005E;
    color: #FFFFFF;
    box-shadow: 0 6px 16px rgba(232, 0, 113, 0.4);
}

/* ==========================================================================
   10. Loading Overlay during AJAX updates
   ========================================================================== */
.shajbela-review-item.is-loading,
.shajbela-order-summary-card.is-updating {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* ==========================================================================
   11. Responsive Media Queries
   ========================================================================== */
@media (max-width: 991px) {
    .shajbela-checkout-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .shajbela-checkout-col-aside {
        position: static;
    }
}

@media (max-width: 640px) {
    .shajbela-checkout-container {
        padding: 20px 12px 80px;
    }

    .shajbela-checkout-page-title {
        font-size: 22px;
    }

    .shajbela-checkout-card,
    .shajbela-order-summary-card {
        padding: 18px 14px;
        border-radius: 12px;
    }

    .shajbela-shipping-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #place_order {
        font-size: 16px !important;
        padding: 14px 16px !important;
    }
}
