/**
 * Standalone Stripe-Style Checkout CSS
 * This file contains ONLY checkout styling, no theme dependencies
 */

/* Reset and base styles */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
        'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #495057;
    background-color: #ffffff;
    overflow-x: hidden;
}

/* Hide any potential WordPress/theme elements */
.site-header,
.site-footer,
.site-main,
.site-content,
.content-area,
#primary,
#secondary,
.widget-area,
.site-branding,
.main-navigation,
.site-info,
.header-top,
.header-bottom,
.breadcrumb,
.page-header,
.entry-header,
.entry-footer,
.post-navigation,
.sidebar,
aside,
.widget,
.footer-widgets,
.copyright,
.footer-info {
    display: none !important;
}

/* Checkout wrapper */
.stripe-checkout-wrapper {
    min-height: 100vh;
    background-color: #ffffff;
    width: 100%;
    position: relative;
}

/* Top bar styling */
.checkout-top-bar {
    background: #ffffff;
    border-bottom: 1px solid #d8d8d8;
    padding: 0px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

@media (max-width: 767px) {
    .checkout-top-bar {
        position: static;
    }
}

.checkout-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.checkout-logo {
    flex: 1;
    display: flex;
    justify-content: center;
}

.checkout-logo .custom-logo {
    max-height: 72px;
    width: auto;
}

.checkout-logo .site-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #495057;
}

.checkout-cart-link {
    position: absolute;
    right: 20px;
}

.cart-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    text-decoration: none;
    color: #525f7f;
}

.cart-toggle svg {
    width: 24px;
    height: 24px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main checkout content */
.checkout-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.checkout-row {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 0;
    align-items: start;
    margin-left: -20px;
    margin-right: -20px;
}

/* Left column styling */
.checkout-left-column {
    background: transparent;
    padding-left: 20px;
    padding-right: 40px;
    padding-top: 20px;
}

.checkout-form-section {
    margin-bottom: 32px;
}

.checkout-form-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 16px 0;
}

/* Form field styling */
.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #266a1e;
    box-shadow: 0 0 0 3px rgba(103, 114, 229, 0.1);
}

/* Two column form fields */
.col2-set {
    display: flex;
    gap: 16px;
}

/* Phone fields layout */

.woocommerce-billing-fields__field-wrapper .form-row-first,
.woocommerce-billing-fields__field-wrapper .form-row-last {
    min-width: 0;
    width: auto;
}

.woocommerce-billing-fields__field-wrapper .form-row-first select,
.woocommerce-billing-fields__field-wrapper .form-row-last input[type='tel'] {
    height: 44px;
}

.woocommerce-billing-fields__field-wrapper .form-row-first {
    clear: both;
}

/* Inline area code + number (only these two fields) */
#billing_phone_area_field,
#billing_phone_local_field {
    display: inline-block;
    vertical-align: top;
    margin-right: 12px;
}

#billing_phone_area_field {
    width: 140px;
}
#billing_phone_local_field {
    width: calc(100% - 152px);
    margin-right: 0;
}

@media (max-width: 480px) {
    #billing_phone_area_field,
    #billing_phone_local_field {
        display: block;
        width: 100%;
        margin-right: 0;
    }
}

/* Hide original phone label if needed; keep field visible for WC scripts */
label[for='billing_phone'] {
    display: none;
}

.col2-set .form-row-first,
.col2-set .form-row-last {
    flex: 1;
}

/* AIS address picker */
.sm-hidden-field {
    display: none !important;
}

.sm-ais-field-wrapper {
    position: relative;
}

.sm-ais-container {
    position: relative;
}

.sm-ais-close {
    display: none;
    background: none;
    border: none;
    color: #2d3748;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.sm-ais-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1500;
    display: none;
}

.sm-ais-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
    font-size: 15px;
    line-height: 1.4;
}

.sm-ais-suggestion-item:last-child {
    border-bottom: none;
}

.sm-ais-suggestion-item:hover,
.sm-ais-suggestion-item.is-active {
    background: #e3f2fd;
}

.sm-ais-suggestion-empty {
    padding: 12px 16px;
    font-size: 14px;
    color: #6c757d;
}

.sm-ais-status-message {
    margin-top: 6px;
    font-size: 12px;
    color: #6c757d;
    min-height: 18px;
}

.sm-coordinate-debug {
    display: none;
}

.sm-ais-populated {
    background: #e8ffe8 !important;
}

.sm-ais-final-address-preview {
    display: none;
}

.sm-ais-final-address-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.sm-ais-final-address-text {
    font-size: 14px;
    color: #1f2933;
    word-break: break-word;
}

.sm-ais-final-address-preview {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    background-color: #f8f9fa;
    border: 1px solid #e3e8ee;
}

.sm-english-reference {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
    margin-bottom: 8px;
    font-style: italic;
    opacity: 0.8;
    line-height: 1.3;
    word-break: break-word;
    position: absolute;
}

.woocommerce-billing-fields__field-wrapper .sm-ais-field-community,
/* Address field row wrappers for 50/50 layout */
.sm-address-field-row {
    display: block;
    overflow: hidden;
    margin-bottom: 16px;
}

.sm-address-field-row .sm-address-field-wrapper {
    width: 50%;
    float: left;
    box-sizing: border-box;
}

.sm-address-field-row .sm-address-field-wrapper:first-child {
    padding-right: 8px;
}

.sm-address-field-row .sm-address-field-wrapper:last-child {
    padding-left: 8px;
}

.sm-address-field-row::after {
    content: '';
    display: table;
    clear: both;
}

@media (max-width: 767px) {
    .woocommerce-billing-fields__field-wrapper .sm-ais-field-community,
    .woocommerce-billing-fields__field-wrapper .sm-ais-field-building,
    .woocommerce-billing-fields__field-wrapper .sm-ais-field-street,
    .woocommerce-billing-fields__field-wrapper .sm-ais-field-street-no,
    .woocommerce-billing-fields__field-wrapper .sm-ais-field-district,
    .woocommerce-billing-fields__field-wrapper .sm-ais-field-region,
    .woocommerce-billing-fields__field-wrapper .sm-ais-field-flat,
    .woocommerce-billing-fields__field-wrapper .sm-ais-field-floor,
    .woocommerce-shipping-fields__field-wrapper .sm-ais-field-community,
    .woocommerce-shipping-fields__field-wrapper .sm-ais-field-building,
    .woocommerce-shipping-fields__field-wrapper .sm-ais-field-street,
    .woocommerce-shipping-fields__field-wrapper .sm-ais-field-street-no,
    .woocommerce-shipping-fields__field-wrapper .sm-ais-field-district,
    .woocommerce-shipping-fields__field-wrapper .sm-ais-field-region,
    .woocommerce-shipping-fields__field-wrapper .sm-ais-field-flat,
    .woocommerce-shipping-fields__field-wrapper .sm-ais-field-floor {
        width: 100%;
        max-width: 100%;
        float: none;
        margin-left: 0;
    }
}

/* Right column styling */
.checkout-right-column {
    background: #ffffff;
    border: none;
    border-radius: 0;
    padding: 0;
    position: relative;
    margin-right: -100vw;
    padding-right: 100vw;
    min-height: 100%;
    padding-top: 20px;
}

.checkout-summary-sticky {
    position: sticky;
    top: 100px;
    padding: 0px 20px 32px 32px;
}

.checkout-summary-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 24px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #e3e8ee;
}

/* Product items in summary */
.checkout-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #f6f9fc;
}

.checkout-product-item:last-child {
    border-bottom: none;
}

.product-image {
    position: relative;
    flex-shrink: 0;
}

.product-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e3e8ee;
}

.product-quantity {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--main-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-details {
    flex: 1;
    min-width: 0; /* Prevents overflow with long product names */
}

.product-attributes {
    list-style: none;
    margin: 6px 0 0 0;
    padding: 0;
    font-size: 13px;
    color: #495057;
}

.product-attributes li {
    margin: 2px 0;
}

.product-attributes .attr-label {
    font-weight: 500;
}

.product-name {
    min-width: 0 !important; /* Prevents overflow with long product names */
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 4px;
    word-break: break-word; /* Ensure long names wrap */
}

.product-price {
    font-size: 14px;
    font-weight: 600;
    color: #495057 !important;
    flex-shrink: 0; /* Prevent price from shrinking */
    margin-left: auto; /* Push price to the right */
}

/* Order totals styling */
.checkout-totals {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e3e8ee;
}

.checkout-totals table {
    width: 100%;
    border: none;
    border-collapse: collapse;
}

.checkout-totals table tr {
    border: none;
}

.checkout-totals table th,
.checkout-totals table td {
    padding: 8px 0;
    border: none;
    font-size: 14px;
}

.checkout-totals table th {
    font-weight: 500;
    color: #495057;
    text-align: left;
}

.checkout-totals table td {
    font-weight: 600;
    color: #495057;
    text-align: right;
}

.checkout-totals .order-total th,
.checkout-totals .order-total td {
    font-size: 18px;
    font-weight: 700;
    color: #495057;
    padding: 16px 0 8px 0;
    border-top: 1px solid #e3e8ee;
}

/* Payment section styling - Modern card-based design */
.payment-section {
    background: #ffffff;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top: 32px;
    width: 100%;
    margin: 0 auto !important;
}

.payment-section h3 {
    margin-bottom: 24px;
    font-size: 20px;
    color: #1a1a1a;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-section h3::before {
    font-size: 18px;
}

.woocommerce-NoticeGroup.woocommerce-NoticeGroup-checkout {
    text-align: center;
}

.woocommerce-NoticeGroup .woocommerce-error {
    margin: 0;
}
/* WooCommerce payment methods - Modern card styling */
.wc_payment_methods {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wc_payment_method {
    margin: 0;
    padding: 0;
    border-radius: 12px;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.wc_payment_method.selected {
    border-color: #4b9842;
    background: linear-gradient(135deg, #f8fffe 0%, #f0f9f0 100%);
    box-shadow: 0 4px 16px rgba(75, 152, 66, 0.2);
}

.wc_payment_method.payment_method_cod.selected {
    border-color: #4b9842;
    box-shadow: 0 4px 16px rgba(75, 152, 66, 0.2);
}

.wc_payment_method.payment_method_sm_express_yedpay,
.wc_payment_method.payment_method_sm_express_stripe {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.wc_payment_method label {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 20px 24px;
    margin: 0;
    width: 100%;
    position: relative;
}

.wc_payment_method input[type='radio'] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom radio button styling */
.wc_payment_method label::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background: #ffffff;
    position: relative;
}

.wc_payment_method input[type='radio']:checked + label::before {
    border-color: #4b9842;
    background: #4b9842;
    box-shadow: inset 0 0 0 3px #ffffff;
}

.wc_payment_method input[type='radio']:checked + label {
    color: #4b9842;
}

.payment_box {
    margin: 0;
    padding: 24px;
    border-radius: 0 0 12px 12px;
    border: none;
    border-top: 1px solid #e8f5e8;
    font-size: 14px;
    color: #495057;
    position: relative;
}

.payment_box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 1px;
}

.checkout-order-summary {
    overflow-y: auto;
    max-height: 500px;
}
.payment_box p {
    margin: 0 0 16px 0;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
}

/* Buttons - Modern styling with enhanced visual appeal */
.button,
#place_order,
input[type='submit'] {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #4b9842 0%, #5cb85c 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(75, 152, 66, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.button::before,
#place_order::before,
input[type='submit']::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.button:hover,
#place_order:hover,
input[type='submit']:hover {
    background: linear-gradient(135deg, #5cb85c 0%, #4b9842 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(75, 152, 66, 0.4);
}

.button:hover::before,
#place_order:hover::before,
input[type='submit']:hover::before {
    left: 100%;
}

.button:active,
#place_order:active,
input[type='submit']:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(75, 152, 66, 0.3);
}

.button:disabled,
#place_order:disabled,
input[type='submit']:disabled {
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button:disabled::before,
#place_order:disabled::before,
input[type='submit']:disabled::before {
    display: none;
}

/* Create account section */
.create-account-wrapper {
    margin: 16px 0;
    padding: 16px;
    background: #f6f9fc;
    border-radius: 8px;
}

.create-account label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.create-account input[type='checkbox'] {
    margin-right: 8px;
    width: auto;
}

/* Shipping address toggle */
#ship-to-different-address {
    margin: 16px 0;
    padding: 16px;
    background: #f6f9fc;
    border-radius: 8px;
}

#ship-to-different-address label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

#ship-to-different-address-checkbox {
    margin-right: 8px;
    width: auto;
}

.shipping_address {
    margin-top: 16px;
    display: none;
}

/* WooCommerce notices */
.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    background: #ffffff;
    border: 1px solid #e3e8ee;
    border-left: 4px solid #266a1e;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
    font-size: 14px;
    color: #495057;
}

.woocommerce-error {
    border-left-color: #e25950;
}

.woocommerce-message {
    border-left-color: #00d924;
}

/* Form validation states */
.stripe-field-valid input {
    border-color: #00d924 !important;
    box-shadow: 0 0 0 3px rgba(0, 217, 36, 0.1) !important;
}

.stripe-field-invalid input {
    border-color: #e25950 !important;
    box-shadow: 0 0 0 3px rgba(226, 89, 80, 0.1) !important;
}

/* Loading state for place order button */
#place_order.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Responsive design */
@media (max-width: 1024px) {
    .checkout-row {
        grid-template-columns: 1fr;
        gap: 0;
        margin-left: 0;
        margin-right: 0;
        display: flex;
        flex-direction: column;
    }

    .checkout-left-column {
        padding-left: 20px;
        padding-right: 20px;
        order: 1;
    }

    .payment-section-mobile {
        order: 3;
        padding-left: 20px;
        padding-right: 20px;
    }

    .checkout-right-column {
        position: static;
        order: 2;
        width: 100%;
        margin-right: 0;
        padding-right: 0;
        background: #ffffff;
        border-radius: 0;
        border: none;
        border-top: 1px solid #e3e8ee;
        min-height: auto;
    }

    .checkout-summary-sticky {
        position: static;
        padding: 24px 20px;
    }
}

@media (max-width: 768px) {
    .checkout-order-summary {
        overflow-y: visible;
        max-height: 100%;
    }

    .checkout-content {
        padding: 0;
    }

    .checkout-top-content {
        padding: 20px 15px;
    }

    .checkout-left-column {
        padding-left: 20px;
        padding-right: 20px;
        width: 100%;
    }

    .checkout-summary-sticky {
        padding: 20px;
    }

    .payment-section {
        padding: 20px;
        margin-left: -20px;
        margin-right: -20px;
        border-radius: 0;
    }

    .col2-set {
        flex-direction: column;
        gap: 0;
    }

    .col2-set .form-row-first,
    .col2-set .form-row-last {
        width: 100%;
    }

    .checkout-form-section h3 {
        font-size: 16px;
    }

    .form-row input,
    .form-row select,
    .form-row textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Stripe payment form elements - Enhanced styling */
.wc-stripe-upe-element,
.wc-upe-form {
    background: transparent !important;
}

.wc-upe-form {
    background: transparent;
    border-radius: 0;
    padding: 16px 0;
    border: none;
    margin-top: 16px;
    position: relative;
}

/* Hide shipping method selectors when free shipping is auto-applied */
.free-shipping-applied .woocommerce-shipping-methods,
.free-shipping-applied .wc-block-components-shipping-rates-control,
.free-shipping-applied .wc-block-components-radio-control,
.free-shipping-applied .wc-block-components-shipping-rates-control__package,
.free-shipping-applied .wc-block-components-radio-control__option {
    display: none !important;
}

.woocommerce-shipping-methods ul {
    list-style: none;
}

/* Ensure the Stripe UPE mount has height when first rendered */
.wc-stripe-upe-element {
    min-height: 60px;
    border-radius: 8px;
    border: 1px solid #e8ecf0;
    transition: all 0.3s ease;
    background: #fafafa !important;
    padding: 12px;
}

.wc-stripe-upe-element:hover {
    box-shadow: 0 2px 8px rgba(75, 152, 66, 0.1);
    background: #f5f7f5;
}

.wc-stripe-upe-element:focus-within {
    box-shadow: 0 0 0 3px rgba(75, 152, 66, 0.1);
    background: #ffffff;
}

.p-Tabs-panel .p-Input-input {
    background: #f7f7f7 !important;
}

#wc-stripe-upe-errors[role='alert'] {
    margin-top: 12px;
    color: #e25950;
    font-size: 14px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    border-left: 4px solid #e25950;
    display: none; /* Hide when empty */
}

#wc-stripe-upe-errors[role='alert']:not(:empty) {
    display: block; /* Show only when there are errors */
}

/* Hide saved payment methods when empty */
.woocommerce-SavedPaymentMethods {
    display: none !important;
}

.woocommerce-SavedPaymentMethods li {
    margin: 12px 0;
    padding: 12px 0;
    border-bottom: 1px solid #e8f5e8;
}

.woocommerce-SavedPaymentMethods li:last-child {
    border-bottom: none;
}

.woocommerce-SavedPaymentMethods label {
    font-weight: 500;
    color: #495057;
    margin-left: 12px;
    display: flex;
    align-items: center;
}

.woocommerce-SavedPaymentMethods input[type='radio'] {
    width: auto;
    margin-right: 12px;
    accent-color: #4b9842;
}

/* Hide the save payment method checkbox and its fieldset */
.woocommerce-SavedPaymentMethods-saveNew,
fieldset:has(.woocommerce-SavedPaymentMethods-saveNew),
fieldset .woocommerce-SavedPaymentMethods-saveNew {
    display: none !important;
}

/* Hide debug message after testing */
.debug-message {
    display: none;
}

/* Secured Checkout Banner */
.secured-checkout-banner {
    background: linear-gradient(135deg, #4b9842 0%, #8fc782 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

.security-content {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.secured-checkout-banner i.bx {
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.security-text {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 400;
    margin-left: 8px;
}

/* Payment Method Icons */
.payment-icon {
    color: #4b9842;
    font-size: 20px;
    margin-right: 12px;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.wc_payment_method:hover .payment-icon {
    transform: scale(1.1);
    color: #5cb85c;
}

/* Hide WooCommerce Stripe cards image */
.stripe-cards-icon,
.stripe-icon {
    display: none !important;
}

/* Terms and conditions styling */
.woocommerce-terms-and-conditions-wrapper {
    margin: 24px 0;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e8f5e8;
    position: relative;
}

.woocommerce-terms-and-conditions-wrapper::before {
    content: '🔒';
    position: absolute;
    top: 16px;
    left: 20px;
    font-size: 16px;
}

.woocommerce-privacy-policy-text {
    margin-left: 32px;
}

.woocommerce-privacy-policy-text p {
    margin: 0;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
}

/* Place order section styling */
.form-row.place-order {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e8f5e8;
    position: relative;
}

.form-row.place-order::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #4b9842 0%, #5cb85c 100%);
    border-radius: 2px;
}

/* Loading state enhancement */
#place_order.loading {
    opacity: 0.8;
    cursor: not-allowed;
    position: relative;
}

#place_order.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Add subtle animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc_payment_method {
    animation: fadeInUp 0.3s ease forwards;
}

.wc_payment_method:nth-child(1) {
    animation-delay: 0.1s;
}
.wc_payment_method:nth-child(2) {
    animation-delay: 0.2s;
}
.wc_payment_method:nth-child(3) {
    animation-delay: 0.3s;
}

.woocommerce-account-fields .sm-create-account-note {
    display: inline-block;
    margin-left: 4px;
    font-size: 13px;
}

.sm-create-account-warning,
.sm-contact-warning {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 4px;
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    font-size: 13px;
    line-height: 1.4;
}

.sm-create-account-success {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 4px;
    background-color: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #22543d;
    font-size: 13px;
    line-height: 1.4;
}

/* Order Received Page Styling */
.order-received-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.order-received-container .checkout-header {
    text-align: center;
    margin-bottom: 30px;
}

.order-received-container .checkout-header h1 {
    color: #2d3748;
    font-size: 2rem;
    margin-bottom: 10px;
}

.order-received-container .checkout-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.order-received-container .order_details {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.order-received-container .order_details li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.order-received-container .order_details li:last-child {
    border-bottom: none;
}

body.sm-ais-no-scroll {
    overflow: hidden;
}

@media (max-width: 768px) {
    .sm-ais-container.sm-ais-fullscreen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: #ffffff;
        padding: 18px;
        display: flex;
        flex-direction: column;
    }

    .sm-ais-container.sm-ais-fullscreen .sm-ais-close {
        display: block;
        align-self: flex-end;
        margin-bottom: 12px;
    }

    .sm-ais-container.sm-ais-fullscreen input {
        font-size: 18px;
        padding: 12px;
    }

    .sm-ais-container.sm-ais-fullscreen .sm-ais-suggestions {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        flex: 1;
        max-height: none;
        margin-top: 16px;
    }

    .sm-ais-container.sm-ais-fullscreen .sm-ais-status-message,
    .sm-ais-container.sm-ais-fullscreen .sm-coordinate-debug {
        margin-top: 12px;
    }
}

.shipping-progress-container {
    padding: 15px 0;
}

.shipping-progress-wrapper {
    max-width: 100%;
}

.shipping-progress-info {
    text-align: center;
    margin-bottom: 10px;
}

.shipping-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    display: block;
}

.shipping-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.shipping-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.shipping-progress-amounts {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #718096;
}

.current-amount {
    font-weight: 600;
    color: #2d3748;
}

.target-amount {
    font-weight: 500;
    color: #48bb78;
}

/* Success state when threshold reached */
.shipping-progress-success {
    text-align: center;
    padding: 10px 0;
}

.success-icon {
    font-size: 18px;
    margin-right: 8px;
}

.success-text {
    font-size: 14px;
    font-weight: 600;
    color: #38a169;
}

/* Stripe Security Notice */
.stripe-security-notice {
    margin-top: 10px !important;
    padding: 8px !important;
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    color: #6c757d !important;
    text-align: center !important;
    line-height: 1.4 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .shipping-progress-text {
        font-size: 13px;
    }

    .shipping-progress-amounts {
        font-size: 11px;
    }

    .success-text {
        font-size: 13px;
    }

    .stripe-security-notice {
        font-size: 11px !important;
        padding: 6px !important;
    }
}

/* Address Mode Tabs */
.sm-address-mode-selector {
    width: 100%;
}

.sm-address-mode-selector .woocommerce-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #f2f4f7; /* Subtle grey container */
    padding: 4px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.sm-address-mode-selector label.radio {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    margin: 0 !important;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
    color: #000;
    font-size: 15px;
    line-height: 1.2;
    border: 1px solid transparent;
    background: transparent;
}

/* Selected Tab State - Subtle background only */
.sm-address-mode-selector label.radio.selected-tab {
    background: #86c17a !important;
    font-weight: 500 !important;
    color: #f0f0f0 !important;
    opacity: 1 !important;
}

.sm-address-mode-selector input[type='radio'] {
    margin-right: 5px;
    display: none;
}

.sm-manual-address-field .optional {
    display: none !important;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .sm-address-mode-selector label.radio {
        font-size: 14px;
        padding: 12px 6px;
    }
    .sm-address-mode-selector .woocommerce-input-wrapper {
        margin-bottom: 15px;
    }
}

/* Field Visibility */
.sm-manual-address-field.hidden {
    display: none !important;
}

/* When Manual is selected, we hide these via JS */
.sm-ais-field-group-hidden {
    display: none !important;
}

/* -------------------------------------------------------------------------
 * Custom Express-style payment buttons (checkout)
 * ------------------------------------------------------------------------- */

.checkout-standalone ul.payment_methods > li.payment_method_cod,
.checkout-standalone ul.payment_methods > li.payment_method_sm_fps,
.checkout-standalone ul.payment_methods > li.payment_method_sm_yedpay_wallet,
.checkout-standalone ul.payment_methods > li.payment_method_sm_express_yedpay {
    display: none !important;
}

.checkout-standalone ul.payment_methods > li.payment_method_sm_express_stripe > input,
.checkout-standalone ul.payment_methods > li.payment_method_sm_express_stripe > label {
    display: none !important;
}

.checkout-standalone .payment_box.payment_method_sm_express_stripe {
    display: block !important;
    padding: 0 !important;
    background: transparent !important;
    margin: 0 !important;
}

/* Card field labels should NOT inherit Woo payment-method label styling */
.checkout-standalone
    #payment
    .payment_box.payment_method_sm_express_stripe
    .sm-express-card-fields
    label {
    display: block !important;
    padding: 0 !important;
    margin: 6px 0 6px 0 !important;
    width: auto !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    cursor: default !important;
    align-items: initial !important;
}
.checkout-standalone
    #payment
    .payment_box.payment_method_sm_express_stripe
    .sm-express-card-fields
    label::before {
    content: none !important;
    display: none !important;
}

/* Hide any 3rd-party Stripe gateway UI if it slips in during AJAX */
.checkout-standalone #payment ul.payment_methods > li.payment_method_stripe,
.checkout-standalone #payment .payment_box.payment_method_stripe {
    display: none !important;
}

/* Apple Pay / Google Pay: show only on mobile */
@media (min-width: 768px) {
    .checkout-standalone .sm-method-button.wallet {
        display: none !important;
    }
}

.checkout-standalone .sm-express-payment {
    max-width: 565px;
    width: 100%;
}

.checkout-standalone .sm-express-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkout-standalone .sm-express-method-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.checkout-standalone .sm-express-method-row.single .sm-method-button {
    width: 100%;
    height: 65px;
}

.checkout-standalone .sm-method-button {
    width: 100%;
    padding: 14px;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    text-align: left;
}

.checkout-standalone .sm-method-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(1);
}

.checkout-standalone .sm-method-button.selected {
    border-color: #2563eb;
    border-width: 2px;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.checkout-standalone .sm-method-button .sm-icon img {
    display: block;
    width: 44px;
    height: 32px;
    object-fit: contain;
}

.checkout-standalone .sm-method-button .sm-icon.dual {
    display: inline-flex;
    gap: 6px;
}

.checkout-standalone .sm-stripe-element {
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    min-height: 44px;
}

.checkout-standalone .sm-stripe-element .__PrivateStripeElement {
    width: 100%;
}

.checkout-standalone .sm-express-card-fields label {
    margin: 6px 0 6px 0;
}

.checkout-standalone .sm-stripe-errors {
    background: #ffeaea;
    color: #a40000;
    border: 1px solid #f3c2c2;
    padding: 10px;
    border-radius: 8px;
}

.checkout-standalone .sm-fps-instructions {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fff7f0;
}

/* FPS modal (standalone checkout) */
.checkout-standalone .sm-fps-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.checkout-standalone .sm-fps-overlay.is-open {
    display: flex;
}
.checkout-standalone .sm-fps-modal {
    background: #fff;
    width: 100%;
    max-width: 565px;
    border-radius: 12px;
    padding: 18px 18px 16px 18px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    color: #111;
    max-height: min(90vh, 680px);
    overflow: auto;
}
.checkout-standalone .sm-fps-modal h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 800;
}
.checkout-standalone .sm-fps-modal p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.55;
}
.checkout-standalone .sm-fps-actions {
    margin-top: 14px;
}
.checkout-standalone .sm-fps-done.button.alt {
    width: 100%;
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    font-weight: 700 !important;
}
.checkout-standalone .sm-fps-done.button.alt:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
}

.woocommerce-error.message-wrapper{
    display: none !important;
}
