/* ==========================================================================
   Shipping Calculator - Frontend Styles
   Aligned with iShop Theme Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   Product Page - Shipping Info Box
   -------------------------------------------------------------------------- */

.product-main-content__shipping-info {
    background: #f8f9fb;
    border: 1px solid #e6e9ee;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
}

.product-main-content__shipping-info-header {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #e6e9ee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-main-content__shipping-info-header-icon {
    color: #0650a3;
    display: flex;
    align-items: center;
}

.product-main-content__shipping-info-header-title {
    font-weight: 700;
    color: #021959;
    font-size: 16px;
}

.product-main-content__shipping-info-content {
    padding: 20px;
}

.product-main-content__shipping-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e6e9ee;
}

.product-main-content__shipping-info-item:last-child {
    border-bottom: none;
}

.product-main-content__shipping-info-label {
    font-weight: 500;
    color: rgba(2, 25, 89, 0.6);
    font-size: 14px;
}

.product-main-content__shipping-info-value {
    font-weight: 700;
    color: #021959;
    font-size: 14px;
}

.product-main-content__shipping-info-value small {
    color: rgba(2, 25, 89, 0.5);
    font-weight: normal;
    margin-right: 8px;
}

.product-main-content__shipping-info-total {
    background: rgba(6, 80, 163, 0.06);
    padding: 12px 15px !important;
    margin: 10px -20px -10px -20px;
    border-top: 1px solid rgba(6, 80, 163, 0.12);
    border-bottom: none !important;
}

.product-main-content__shipping-info-total .product-main-content__shipping-info-label,
.product-main-content__shipping-info-total .product-main-content__shipping-info-value {
    font-size: 16px;
    font-weight: 700;
    color: #0650a3;
}

.product-main-content__shipping-info-category {
    background: rgba(239, 167, 29, 0.08);
    padding: 10px 15px;
    margin: -20px -20px 15px -20px;
    border-bottom: 1px solid rgba(239, 167, 29, 0.2);
}

.product-main-content__shipping-info-category-label {
    font-weight: 700;
    color: #856404;
}

.product-main-content__shipping-info-description {
    background: #f3f5f8;
    color: #021959;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    line-height: 1.8;
    text-align: justify;
    border: 1px solid #e6e9ee;
    font-size: 13px;
}

.product-main-content__shipping-info-note {
    font-size: 12px;
    color: rgba(2, 25, 89, 0.5);
    margin-top: 10px;
    text-align: justify;
    line-height: 1.8;
}

/* --------------------------------------------------------------------------
   My Account - Shipping Payment Page
   -------------------------------------------------------------------------- */

.shipping-payment-page {
    max-width: 800px;
    margin: 0 auto;
}

.shipping-payment-page h2 {
    margin-bottom: 30px;
    color: #021959;
    font-weight: 700;
}

.shipping-payment-page > p {
    color: rgba(2, 25, 89, 0.6);
    font-size: 14px;
}

.shipping-payment-order {
    background: #f8f9fb;
    border: 1px solid #e6e9ee;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.2s ease;
}

.shipping-payment-order:hover {
    box-shadow: -3px 3px 6px rgba(2, 25, 89, 0.08);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e6e9ee;
}

.order-header h3 {
    margin: 0;
    color: #021959;
    font-weight: 700;
    font-size: 16px;
}

.order-date {
    color: rgba(2, 25, 89, 0.5);
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   Order Items
   -------------------------------------------------------------------------- */

.shipping-order-items {
    margin-bottom: 20px;
}

.shipping-order-items h4 {
    margin: 0 0 12px 0;
    color: #021959;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
}

.shipping-order-items .woocommerce-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    border: 1px solid #e6e9ee;
    overflow: hidden;
    margin-bottom: 0;
}

.shipping-order-items tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #e6e9ee;
}

.shipping-order-items tr:last-child {
    border-bottom: none;
}

.shipping-order-items td {
    color: #021959;
    font-size: 13px;
    font-weight: 500;
    padding: 0;
    border: none;
}

.shipping-order-items .item-qty {
    color: rgba(2, 25, 89, 0.6);
    font-size: 12px;
    margin-right: 5px;
}

.shipping-order-items .item-price {
    font-weight: 700;
    text-align: left;
}

/* --------------------------------------------------------------------------
   Shipping Cost Details
   -------------------------------------------------------------------------- */

.shipping-cost-details {
    margin-bottom: 20px;
}

.shipping-cost-details table {
    width: 100%;
    background: white;
    border-radius: 8px;
    border: 1px solid #e6e9ee;
    overflow: hidden;
    margin: 0;
}

.shipping-cost-details tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
}

.shipping-cost-details th,
.shipping-cost-details td {
    color: #021959;
    font-size: 13px;
    border: none;
    padding: 0;
    text-align: left;
}

.shipping-cost-details th {
    font-weight: 700;
    width: 50%;
}

.shipping-cost-details td {
    font-weight: 700;
    text-align: right;
}

.shipping-cost-details .total-row {
    border-bottom: 1px solid #e6e9ee;
    background: #f3f5f8;
}

.shipping-cost-details .highlight-row {
    background: rgba(240, 64, 85, 0.08);
    border-bottom: 2px solid #f04055;
    padding: 15px;
    font-size: 14px;
}

.shipping-cost-details .highlight-row th,
.shipping-cost-details .highlight-row td {
    color: #f04055;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Payment Actions & Results
   -------------------------------------------------------------------------- */

.shipping-payment-actions {
    text-align: center;
    margin-bottom: 15px;
}

.pay-shipping-cost {
    background: #f04055 !important;
    color: #fff !important;
    border: none !important;
    padding: 0 24px !important;
    height: 42px;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px 0 rgba(255, 168, 178, 0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pay-shipping-cost:hover {
    background: #e5334a !important;
    box-shadow: 0 3px 7px 0 rgba(255, 111, 128, 0.6);
    color: #fff !important;
}

.pay-shipping-cost:disabled {
    background: #d1d6ee !important;
    box-shadow: none;
    cursor: not-allowed;
    color: rgba(2, 25, 89, 0.4) !important;
}

.payment-result {
    margin-top: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.payment-result.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.payment-result.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* --------------------------------------------------------------------------
   Cart & Checkout - Shipping Cost Row
   -------------------------------------------------------------------------- */

tr.shipping-cost th,
tr.shipping-cost td {
    padding: 10px 15px;
    text-align: right;
    font-size: 14px;
}

tr.shipping-cost th {
    font-weight: 700;
    color: rgba(2, 25, 89, 0.6);
}

tr.shipping-cost td {
    font-weight: 700;
    color: #021959;
}

/* --------------------------------------------------------------------------
   Order Details - Shipping Cost Section
   -------------------------------------------------------------------------- */

.woocommerce-order-details .woocommerce-table--order-details tr th,
.woocommerce-order-details .woocommerce-table--order-details tr td {
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   Shipping Payment Status Labels
   -------------------------------------------------------------------------- */

.shipping-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.shipping-status--paid {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.shipping-status--pending {
    background: rgba(239, 167, 29, 0.1);
    color: #efa71d;
}

/* --------------------------------------------------------------------------
   Order Pay Page - Shipping Payment Notice
   -------------------------------------------------------------------------- */

.shipping-payment-notice {
    background: rgba(6, 80, 163, 0.08) !important;
    border-color: #0650a3 !important;
    color: #021959 !important;
    margin-bottom: 20px !important;
    padding: 15px 20px !important;
    border-radius: 10px !important;
    font-weight: 500 !important;
    border-left-width: 4px !important;
}

.shipping-payment-notice strong {
    display: block;
    font-weight: 700 !important;
    margin-bottom: 8px;
    font-size: 15px;
}

/* Ensure order-pay page tables have proper styling */
#order_review table.shop_table {
    background: white !important;
    border: 1px solid #e6e9ee !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

#order_review table.shop_table th,
#order_review table.shop_table td {
    padding: 12px 18px !important;
    border-color: #e6e9ee !important;
    color: #021959 !important;
}

#order_review table.shop_table tfoot tr:last-child th,
#order_review table.shop_table tfoot tr:last-child td {
    background: rgba(6, 80, 163, 0.06) !important;
    font-weight: 700 !important;
    color: #0650a3 !important;
    font-size: 16px !important;
}

/* --------------------------------------------------------------------------
   Order Details - Shipping Cost Section (Checkout & Order Pages)
   -------------------------------------------------------------------------- */

.woocommerce-order-details .woocommerce-table--order-details tr th,
.woocommerce-order-details .woocommerce-table--order-details tr td,
table.woocommerce-table tr th,
table.woocommerce-table tr td {
    font-size: 14px !important;
    color: #021959 !important;
}

/* Ensure proper table styling on payment pages */
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    padding: 12px 15px !important;
    border-color: #e6e9ee !important;
}

.woocommerce table.shop_table tbody tr {
    border-bottom: 1px solid #e6e9ee !important;
}

/* Fix inline form styling on checkout page */
.woocommerce form .form-row {
    padding: 0 !important;
}

.woocommerce form .form-row label {
    color: #021959 !important;
    font-weight: 500 !important;
}

/* Cart & Checkout - Shipping Cost Row */
tr.shipping-cost th,
tr.shipping-cost td {
    padding: 10px 15px !important;
    text-align: right;
    font-size: 14px;
}

tr.shipping-cost th {
    font-weight: 700;
    color: rgba(2, 25, 89, 0.6);
}

tr.shipping-cost td {
    font-weight: 700;
    color: #021959;
}

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

.rtl .order-header {
    direction: rtl;
}

.rtl .shipping-cost-details th,
.rtl .shipping-cost-details td,
.rtl tr.shipping-cost th,
.rtl tr.shipping-cost td {
    text-align: right;
}

.rtl .product-main-content__shipping-info-value small {
    margin-right: 0;
    margin-left: 8px;
}

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

@media (max-width: 768px) {
    .shipping-payment-order {
        padding: 15px;
    }

    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .shipping-cost-details table {
        font-size: 13px;
    }

    .pay-shipping-cost {
        width: 100%;
        height: 48px;
    }

    .product-main-content__shipping-info-item {
        flex-wrap: wrap;
        gap: 4px;
    }

    .product-main-content__shipping-info-total {
        padding: 12px 10px !important;
        margin: 10px -15px -10px -15px;
    }
}
