/* ==========================================================================
   CUSTOM CHECKOUT & SHIPPING CARDS STYLES
   ========================================================================== */

/* Fix Table Layout and Product Title Width in Order Summary */
.woocommerce table.shop_table.woocommerce-checkout-review-order-table {
    table-layout: fixed !important;
    width: 100% !important;
}

.woocommerce table.shop_table.woocommerce-checkout-review-order-table tbody tr {
    display: table-row !important;
}

.woocommerce table.shop_table.woocommerce-checkout-review-order-table tbody tr th.product-info {
    display: flex !important;
    align-items: flex-start !important;
    gap: 1.2rem !important;
    width: 120% !important;
    padding: 1.5rem 0 !important;
    box-sizing: border-box !important;
}

.woocommerce table.shop_table.woocommerce-checkout-review-order-table tbody tr th .product-thumb {
    width: 6rem !important;
    min-width: 6rem !important;
    flex-shrink: 0 !important;
}

.woocommerce table.shop_table.woocommerce-checkout-review-order-table tbody tr th .product-name {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    word-break: normal !important;
}

.woocommerce table.shop_table.woocommerce-checkout-review-order-table tbody tr td.product-total {
    display: table-cell !important;
    width: 25% !important;
    text-align: right !important;
    vertical-align: top !important;
    padding: 1.5rem 0 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

/* Custom Shipping Cards Layout (Image 2 style) */
.woocommerce table.shop_table tr.woocommerce-shipping-totals {
    display: table-row !important;
}

.woocommerce table.shop_table tr.woocommerce-shipping-totals th {
    vertical-align: top !important;
    padding-top: 1.4rem !important;
    width: 25% !important;
    min-width: 75px !important;
    text-align: left !important;
    font-size: 1.6rem !important;
    font-weight: 500 !important;
    color: #1A1A1A !important;
}

.woocommerce table.shop_table tr.woocommerce-shipping-totals td {
    padding: 1.2rem 0 !important;
    text-align: left !important;
    width: 75% !important;
}

/* Clear list styles & reset pseudo elements */
ul.shipping-cards-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
}

ul.shipping-cards-list li.shipping-card-item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
    position: relative !important;
}

/* Hide native radio input completely without breaking accessibility */
input[type="radio"].shipping-hidden-input,
.shipping-card-item input[type="radio"] {
    display: none !important;
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

/* Strictly reset ::before and ::after on custom-radio-mark and labels */
.custom-radio-mark::before,
.shipping-card-label::before,
.shipping-card-label::after,
.shipping-card-item::before,
.shipping-card-item::after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    border: none !important;
    background: transparent !important;
}

.woocommerce [type=radio]:checked+span.custom-radio-mark:before,
.woocommerce [type=radio]:not(:checked)+span.custom-radio-mark:before {
    border: none !important;
    background: transparent !important;
}

/* Card Label */
.shipping-card-label {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 16px !important;
    border: 1px solid #E5E7EB !important;
    background-color: #FFFFFF !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease-in-out !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* Card Hover State */
.shipping-card-label:hover {
    border-color: #CBD5E1 !important;
}

/* Card Selected State */
.shipping-hidden-input:checked+.shipping-card-label,
.shipping-card-item.is-selected .shipping-card-label {
    border: 1.5px solid #D4A017 !important;
    background-color: #FFFDF5 !important;
    box-shadow: 0 1px 3px rgba(212, 160, 23, 0.08) !important;
}

/* Custom Radio Circle (Matching design in image) */
.shipping-card-label .custom-radio-mark {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    border: 1.5px solid #D1D5DB !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 14px !important;
    flex-shrink: 0 !important;
    transition: all 0.2s ease-in-out !important;
    background-color: #FFFFFF !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* Reset default ::after state */
.custom-radio-mark::after {
    content: '' !important;
    display: none !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background-color: #D4A017 !important;
    margin: auto !important;
}

/* Checked Radio Circle & Inner Dot */
.shipping-hidden-input:checked+.shipping-card-label .custom-radio-mark,
.shipping-card-item.is-selected .custom-radio-mark {
    border: 2px solid #D4A017 !important;
    background-color: #FFFFFF !important;
}

.shipping-hidden-input:checked+.shipping-card-label .custom-radio-mark::after,
.shipping-card-item.is-selected .custom-radio-mark::after {
    display: block !important;
}

/* Info container (Title + Subtitle) */
.shipping-card-info {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    text-align: left !important;
    margin-right: 8px !important;
}

.shipping-card-title {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.3 !important;
    font-family: inherit !important;
    white-space: nowrap !important;
}

.shipping-card-subtitle {
    font-size: 1.1rem !important;
    font-weight: 400 !important;
    color: #6B7280 !important;
    margin-top: 2px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
}

/* Price column */
.shipping-card-price {
    font-size: 1.35rem !important;
    font-weight: 600 !important;
    color: #111827 !important;
    text-align: right !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
}

.shipping-card-price .amount,
.shipping-card-price bdi {
    font-size: 1.35rem !important;
    font-weight: 600 !important;
    color: #111827 !important;
    font-family: inherit !important;
}

.woocommerce [type=radio]:not(:checked)+span.custom-radio-mark,
.woocommerce [type=radio]:checked+span.custom-radio-mark {
    padding-left: 15px;
}

.woocommerce [type=radio]:checked+span.custom-radio-mark::after {
    top: 3px;
    left: 3px;
}
/* Red Dot Payments Logos Row */
.payment_box.payment_method_reddot img:not(.payment-logo-item img),
.payment_box.payment_method_quick img:not(.payment-logo-item img),
.payment_box[class*="reddot"] > img,
.payment_box[class*="rdp"] > img,
.payment_box[class*="quick"] > img {
    display: none !important;
}

.rdp-payment-logos-row,
.custom-payment-logos-row {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 8px 0 12px 0 !important;
}

.rdp-payment-logos-row .payment-logo-item,
.custom-payment-logos-row .payment-logo-item {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 6px !important;
    padding: 3px 8px !important;
    background-color: #FFFFFF !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    transition: all 0.2s ease !important;
    height: 32px !important;
}

.rdp-payment-logos-row .payment-logo-item:hover,
.custom-payment-logos-row .payment-logo-item:hover {
    border-color: #D4A017 !important;
    transform: translateY(-1px) !important;
}

.rdp-payment-logos-row .payment-logo-item img,
.custom-payment-logos-row .payment-logo-item img {
    display: block !important;
    height: 24px !important;
    width: auto !important;
    max-width: 65px !important;
    object-fit: contain !important;
}

.rdp-desc-text {
    font-size: 1.3rem !important;
    color: #4B5563 !important;
    margin-top: 8px !important;
    line-height: 1.4 !important;
}