/**
 * Aclas Custom Checkout Styles
 * Stripe-style checkout design
 */

/* ==========================================
   RESET & BASE - High specificity to override themes
   ========================================== */

body.ecc-checkout-page,
body.ecc-checkout-page *,
body.ecc-checkout-page *::before,
body.ecc-checkout-page *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.ecc-checkout-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #30313d;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    /* Scroll gutter stable */
    overflow-y: scroll;
    scrollbar-gutter: stable;
    /* Lavender gradient with GREY grid pattern */
    background:
        linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(180deg,
            #e8e0f0 0%,
            #ddd5eb 15%,
            #d5cce8 30%,
            #cfc8e5 50%,
            #cbc5e8 70%,
            #c8c3ec 85%,
            #c5c0f0 100%
        );
    background-size: 80px 80px, 80px 80px, 100% 100%;
}

/* Hide the old grid pattern div - using CSS background instead */
body.ecc-checkout-page .ecc-checkout-background,
body.ecc-checkout-page .ecc-grid-pattern {
    display: none;
}

/* Custom scrollbar */
body.ecc-checkout-page ::-webkit-scrollbar { width: 6px; }
body.ecc-checkout-page ::-webkit-scrollbar-track { background: transparent; }
body.ecc-checkout-page ::-webkit-scrollbar-thumb { background: #e6e6e6; border-radius: 3px; }

/* ==========================================
   CONTAINER
   ========================================== */

body.ecc-checkout-page .ecc-checkout-container {
    position: relative;
    z-index: 1;
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   LOGO
   ========================================== */

body.ecc-checkout-page .ecc-checkout-logo {
    text-align: center;
    margin-bottom: 24px;
}

body.ecc-checkout-page .ecc-checkout-logo a {
    display: inline-block;
    text-decoration: none;
}

body.ecc-checkout-page .ecc-logo-image {
    max-height: 50px;
    width: auto;
}

body.ecc-checkout-page .ecc-logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ==========================================
   MAIN CARD
   ========================================== */

body.ecc-checkout-page .ecc-checkout-card {
    width: 100%;
    max-width: 1080px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* WooCommerce Notices - Global styling for checkout page */
body.ecc-checkout-page .woocommerce-notices-wrapper,
body.ecc-checkout-page .woocommerce-NoticeGroup {
    max-width: 1080px;
    margin: 0 auto 16px;
    padding: 0 16px;
}

body.ecc-checkout-page .ecc-checkout-card .woocommerce-notices-wrapper {
    padding: 16px 24px 0;
    max-width: none;
    margin: 0;
}

body.ecc-checkout-page .woocommerce-error,
body.ecc-checkout-page .woocommerce-message,
body.ecc-checkout-page .woocommerce-info,
body.ecc-checkout-page .wc-block-components-notice-banner {
    margin: 0 0 16px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    list-style: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Error notices */
body.ecc-checkout-page .woocommerce-error,
body.ecc-checkout-page .wc-block-components-notice-banner.is-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

body.ecc-checkout-page .woocommerce-error::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23dc2626' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

body.ecc-checkout-page .woocommerce-error li {
    list-style: none;
}

/* Success notices */
body.ecc-checkout-page .woocommerce-message,
body.ecc-checkout-page .wc-block-components-notice-banner.is-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

body.ecc-checkout-page .woocommerce-message::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2316a34a' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Info notices */
body.ecc-checkout-page .woocommerce-info,
body.ecc-checkout-page .wc-block-components-notice-banner.is-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

body.ecc-checkout-page .woocommerce-info::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232563eb' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ==========================================
   CHECKOUT COLUMNS
   ========================================== */

body.ecc-checkout-page .ecc-checkout-columns {
    display: grid;
    grid-template-columns: 48% 52%;
    min-height: 650px;
}

@media (max-width: 768px) {
    body.ecc-checkout-page .ecc-checkout-columns {
        grid-template-columns: 1fr;
        min-height: auto;
    }
}

/* Left Column - Order Summary */
body.ecc-checkout-page .ecc-checkout-left {
    background: #F7F7F8;
    padding: 48px 48px 48px 64px;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    body.ecc-checkout-page .ecc-checkout-left {
        padding: 32px 24px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
}

/* Right Column - Billing & Payment */
body.ecc-checkout-page .ecc-checkout-right {
    background: #fff;
    padding: 48px 64px 48px 48px;
}

@media (max-width: 768px) {
    body.ecc-checkout-page .ecc-checkout-right {
        padding: 32px 24px;
    }
}

/* ==========================================
   BACK LINK
   ========================================== */

body.ecc-checkout-page .ecc-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 40px;
    transition: color 0.2s;
}

body.ecc-checkout-page .ecc-back-link:hover {
    color: #374151;
}

body.ecc-checkout-page .ecc-back-link svg {
    width: 12px;
    height: 12px;
}

/* ==========================================
   ORDER SUMMARY
   ========================================== */

body.ecc-checkout-page .ecc-order-summary-title {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    margin: 0 0 24px;
    text-transform: none;
    letter-spacing: 0;
}

/* Cart Items */
body.ecc-checkout-page .ecc-cart-items {
    margin-bottom: 24px;
}

body.ecc-checkout-page .ecc-cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

body.ecc-checkout-page .ecc-cart-item:last-child {
    border-bottom: none;
}

body.ecc-checkout-page .ecc-cart-item-image {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f3e8ff 0%, #e0e7ff 100%);
    border-radius: 8px;
    border: 1px solid #e9d5ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.ecc-checkout-page .ecc-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

body.ecc-checkout-page .ecc-cart-item-image .ecc-product-icon {
    font-size: 20px;
    color: #a855f7;
}

body.ecc-checkout-page .ecc-cart-item-details {
    flex: 1;
    min-width: 0;
}

body.ecc-checkout-page .ecc-cart-item-name {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 2px;
}

body.ecc-checkout-page .ecc-cart-item-description {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

body.ecc-checkout-page .ecc-cart-item-meta {
    font-size: 13px;
    color: #6b7280;
}

body.ecc-checkout-page .ecc-cart-item-price {
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
}

/* Coupon Section */
body.ecc-checkout-page .ecc-coupon-section {
    margin-bottom: 24px;
    padding-bottom: 0;
}

body.ecc-checkout-page .ecc-coupon-form {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

body.ecc-checkout-page .ecc-coupon-input {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #111827;
    transition: border-color 0.2s, box-shadow 0.2s;
}

body.ecc-checkout-page .ecc-coupon-input::placeholder {
    color: #9ca3af;
}

body.ecc-checkout-page .ecc-coupon-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: none;
}

body.ecc-checkout-page .ecc-coupon-button {
    height: 40px;
    padding: 0 20px;
    background: transparent;
    color: #6366f1;
    border: 1px solid #6366f1;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

body.ecc-checkout-page .ecc-coupon-button:hover {
    background: #6366f1;
    color: #fff;
}

/* Order Totals */
body.ecc-checkout-page .ecc-order-totals {
    border-top: 1px solid #e5e7eb;
    padding-top: 24px;
    margin-top: 8px;
}

body.ecc-checkout-page .ecc-order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 15px;
}

body.ecc-checkout-page .ecc-total-label {
    color: #6b7280;
}

body.ecc-checkout-page .ecc-total-value {
    font-weight: 500;
    color: #111827;
}

body.ecc-checkout-page .ecc-discount-value {
    color: #059669;
}

body.ecc-checkout-page .ecc-order-total-final {
    padding-top: 24px;
    margin-top: 16px;
    border-top: 1px solid #e5e7eb;
}

body.ecc-checkout-page .ecc-order-total-final .ecc-total-label {
    font-weight: 500;
    color: #111827;
}

body.ecc-checkout-page .ecc-order-total-final .ecc-total-value {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}


/* ==========================================
   BILLING FORM
   ========================================== */

body.ecc-checkout-page .ecc-billing-form {
    max-width: 420px;
}

body.ecc-checkout-page .ecc-billing-title {
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    margin: 0 0 16px;
}

body.ecc-checkout-page .ecc-form-row {
    margin-bottom: 16px;
}

body.ecc-checkout-page .ecc-form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

body.ecc-checkout-page .ecc-form-row-thirds {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    body.ecc-checkout-page .ecc-form-row-half,
    body.ecc-checkout-page .ecc-form-row-thirds {
        grid-template-columns: 1fr;
    }
}

body.ecc-checkout-page .ecc-form-field {
    display: flex;
    flex-direction: column;
}

body.ecc-checkout-page .ecc-form-field label {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 6px;
}

body.ecc-checkout-page .ecc-form-field label .required {
    color: #dc2626;
    margin-left: 1px;
}

body.ecc-checkout-page .ecc-optional {
    font-weight: 400;
    color: #9ca3af;
}

/* Input & Select Styles - High specificity */
body.ecc-checkout-page .ecc-input,
body.ecc-checkout-page .ecc-select,
body.ecc-checkout-page input.ecc-input,
body.ecc-checkout-page select.ecc-select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #111827;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

body.ecc-checkout-page .ecc-input:focus,
body.ecc-checkout-page .ecc-select:focus,
body.ecc-checkout-page input.ecc-input:focus,
body.ecc-checkout-page select.ecc-select:focus {
    border-color: #6366f1;
    box-shadow: none;
}

body.ecc-checkout-page .ecc-input::placeholder {
    color: #9ca3af;
}

body.ecc-checkout-page .ecc-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

body.ecc-checkout-page .ecc-field-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

/* Phone Field */
body.ecc-checkout-page .ecc-phone-field {
    display: flex;
    gap: 0;
}

body.ecc-checkout-page .ecc-phone-country-selector {
    position: relative;
}

body.ecc-checkout-page .ecc-phone-country-button {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #e5e7eb;
    border-right: none;
    border-radius: 6px 0 0 6px;
    background: #f9fafb;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body.ecc-checkout-page .ecc-phone-country-button:hover {
    background: #f3f4f6;
}

body.ecc-checkout-page .ecc-country-flag img {
    width: 20px;
    height: auto;
    border-radius: 2px;
}

body.ecc-checkout-page .ecc-country-code {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

body.ecc-checkout-page .ecc-dropdown-arrow {
    color: #9ca3af;
    width: 12px;
    height: 12px;
}

body.ecc-checkout-page .ecc-phone-country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 240px;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    margin-top: 4px;
}

body.ecc-checkout-page .ecc-phone-country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

body.ecc-checkout-page .ecc-phone-country-option:hover {
    background: #f3f4f6;
}

body.ecc-checkout-page .ecc-phone-country-option img {
    width: 20px;
    height: auto;
    border-radius: 2px;
}

body.ecc-checkout-page .ecc-option-name {
    flex: 1;
    font-size: 14px;
    color: #374151;
}

body.ecc-checkout-page .ecc-option-code {
    font-size: 13px;
    color: #6b7280;
}

body.ecc-checkout-page .ecc-phone-input {
    flex: 1;
    border-radius: 0 6px 6px 0 !important;
}

/* ==========================================
   PAYMENT METHODS
   ========================================== */

body.ecc-checkout-page .ecc-payment-section {
    margin-top: 32px;
}

body.ecc-checkout-page .ecc-payment-title {
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    margin: 0 0 16px;
    padding: 0;
    border: none;
}

body.ecc-checkout-page .ecc-gateways-list {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
}

body.ecc-checkout-page .ecc-gateway-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: #fff;
}

body.ecc-checkout-page .ecc-gateway-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.ecc-checkout-page .ecc-gateway-selected {
    border-color: #6366f1;
    box-shadow: none;
    background: #fafafa;
}

body.ecc-checkout-page .ecc-gateway-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
}

body.ecc-checkout-page .ecc-gateway-radio {
    display: none;
}

body.ecc-checkout-page .ecc-gateway-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

body.ecc-checkout-page .ecc-gateway-selected .ecc-gateway-radio-custom {
    border-color: #6366f1;
}

body.ecc-checkout-page .ecc-gateway-radio-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6366f1;
    transform: scale(0);
    transition: transform 0.2s;
}

body.ecc-checkout-page .ecc-gateway-selected .ecc-gateway-radio-dot {
    transform: scale(1);
}

body.ecc-checkout-page .ecc-gateway-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.ecc-checkout-page .ecc-gateway-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

body.ecc-checkout-page .ecc-gateway-selected .ecc-gateway-title {
    color: #111827;
}

body.ecc-checkout-page .ecc-gateway-icon {
    display: flex;
    gap: 4px;
}

body.ecc-checkout-page .ecc-gateway-icon img {
    height: 20px;
    width: auto;
}

body.ecc-checkout-page .ecc-gateway-check {
    width: 20px;
    height: 20px;
    color: #6366f1;
    opacity: 0;
    transition: opacity 0.2s;
}

body.ecc-checkout-page .ecc-gateway-selected .ecc-gateway-check {
    opacity: 1;
}

/* Custom gateway content (for custom partial - not currently used) */
body.ecc-checkout-page .ecc-gateway-content,
body.ecc-checkout-page .ecc-gateway-item .payment_box {
    display: none;
    padding: 16px;
    background: transparent;
    border: none;
    border-top: 1px solid #e5e7eb;
    margin-top: 12px;
}

/* Show payment box only for selected custom gateway */
body.ecc-checkout-page .ecc-gateway-item.ecc-gateway-selected .ecc-gateway-content,
body.ecc-checkout-page .ecc-gateway-item.ecc-gateway-selected .payment_box {
    display: block;
}

/* NOTE: Native WooCommerce payment boxes (.wc_payment_method .payment_box)
   are handled by WooCommerce's own JavaScript - do not override with !important */

body.ecc-checkout-page .ecc-gateway-description {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px;
}

body.ecc-checkout-page .ecc-gateway-fields {
    background: #f9fafb;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Style WooCommerce gateway fields */
body.ecc-checkout-page .ecc-gateway-fields input,
body.ecc-checkout-page .ecc-gateway-fields select,
body.ecc-checkout-page .ecc-gateway-fields .input-text {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    margin-bottom: 12px;
    background: #fff;
}

body.ecc-checkout-page .ecc-gateway-fields input:focus,
body.ecc-checkout-page .ecc-gateway-fields select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: none;
}

body.ecc-checkout-page .ecc-gateway-fields label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

/* ==========================================
   CHECKOUT SUBMIT
   ========================================== */

body.ecc-checkout-page .ecc-checkout-submit {
    margin-top: 36px;
}

/* Terms Checkbox */
body.ecc-checkout-page .ecc-terms-wrapper {
    margin-bottom: 24px;
}

body.ecc-checkout-page .ecc-terms-wrapper .ecc-terms-label,
body.ecc-checkout-page .ecc-terms-wrapper label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    line-height: 1.5;
}

body.ecc-checkout-page .ecc-terms-wrapper input[type="checkbox"],
body.ecc-checkout-page .ecc-terms-checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 0;
    flex-shrink: 0;
    accent-color: #6366f1;
    cursor: pointer;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

body.ecc-checkout-page .ecc-terms-wrapper input[type="checkbox"]:checked {
    background-color: #6366f1;
    border-color: #6366f1;
}

body.ecc-checkout-page .ecc-terms-wrapper a,
body.ecc-checkout-page .ecc-checkout-submit a {
    color: #6366f1;
    text-decoration: underline;
    transition: color 0.2s;
}

body.ecc-checkout-page .ecc-terms-wrapper a:hover,
body.ecc-checkout-page .ecc-checkout-submit a:hover {
    color: #4f46e5;
}

/* Pay Button - Disabled State */
body.ecc-checkout-page .ecc-pay-button,
body.ecc-checkout-page button#place_order {
    width: 100%;
    height: 48px;
    padding: 0 20px;
    background: #d1d5db;
    color: transparent !important; /* Hide any default text */
    border: none;
    border-radius: 8px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0 !important; /* Hide any default text */
    font-weight: 500;
    cursor: not-allowed;
    transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Show our custom spans - override the hidden text */
body.ecc-checkout-page .ecc-pay-button span,
body.ecc-checkout-page button#place_order span {
    font-size: 15px !important;
    color: #6b7280 !important;
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body.ecc-checkout-page .ecc-pay-button.ecc-btn-enabled span,
body.ecc-checkout-page button#place_order.ecc-btn-enabled span {
    color: #fff !important;
}

/* Pay Button - Enabled State (when terms accepted) */
body.ecc-checkout-page .ecc-pay-button.ecc-btn-enabled,
body.ecc-checkout-page button#place_order.ecc-btn-enabled {
    background: #00D66E;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 214, 110, 0.4);
}

body.ecc-checkout-page .ecc-pay-button.ecc-btn-enabled:hover,
body.ecc-checkout-page button#place_order.ecc-btn-enabled:hover {
    background: #00c462;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 214, 110, 0.5);
}

body.ecc-checkout-page .ecc-pay-button.ecc-btn-enabled:active,
body.ecc-checkout-page button#place_order.ecc-btn-enabled:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 214, 110, 0.4);
}

/* Shine effect */
body.ecc-checkout-page .ecc-pay-button.ecc-btn-enabled::after,
body.ecc-checkout-page button#place_order.ecc-btn-enabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

body.ecc-checkout-page .ecc-pay-button.ecc-btn-enabled:hover::after,
body.ecc-checkout-page button#place_order.ecc-btn-enabled:hover::after {
    left: 100%;
}

body.ecc-checkout-page .ecc-pay-button-text {
    font-size: 15px;
    font-weight: 500;
}

body.ecc-checkout-page .ecc-pay-button-amount {
    font-size: 15px;
    font-weight: 600;
}

/* Powered by Stripe */
body.ecc-checkout-page .ecc-powered-by {
    text-align: center;
    margin-top: 24px;
    font-size: 11px;
    color: #9ca3af;
}

body.ecc-checkout-page .ecc-powered-by span {
    font-weight: 600;
}

/* ==========================================
   FOOTER
   ========================================== */

body.ecc-checkout-page .ecc-checkout-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: #6b7280;
}

body.ecc-checkout-page .ecc-checkout-footer a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

body.ecc-checkout-page .ecc-checkout-footer a:hover {
    color: #374151;
}

body.ecc-checkout-page .ecc-footer-separator {
    margin: 0 12px;
    opacity: 0.5;
}

/* ==========================================
   EMPTY CART
   ========================================== */

body.ecc-checkout-page .ecc-empty-cart {
    text-align: center;
    padding: 60px 24px;
    color: #6b7280;
    font-size: 16px;
}

/* ==========================================
   HIDE WOOCOMMERCE DEFAULT STYLES
   ========================================== */

body.ecc-checkout-page .woocommerce form .form-row {
    padding: 0;
    margin: 0;
}

body.ecc-checkout-page .woocommerce-billing-fields__field-wrapper,
body.ecc-checkout-page .woocommerce-shipping-fields__field-wrapper {
    display: none;
}

/* Hide WooCommerce's default terms checkbox - we have our own */
body.ecc-checkout-page .woocommerce-terms-and-conditions-wrapper {
    display: none !important;
}

/* ==========================================
   NATIVE WOOCOMMERCE PAYMENT SECTION STYLING
   ========================================== */

/* Payment section wrapper */
body.ecc-checkout-page .ecc-payment-section {
    padding: 0;
    margin-bottom: 24px;
}

body.ecc-checkout-page .ecc-payment-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

/* Main payment container */
body.ecc-checkout-page #payment {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Payment methods list */
body.ecc-checkout-page #payment ul.payment_methods,
body.ecc-checkout-page #payment .payment_methods {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    list-style: none !important;
}

/* Individual payment method items */
body.ecc-checkout-page #payment ul.payment_methods li,
body.ecc-checkout-page #payment .wc_payment_method {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    margin-bottom: 12px !important;
    padding: 0 !important;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

body.ecc-checkout-page #payment ul.payment_methods li:last-child {
    margin-bottom: 0 !important;
}

body.ecc-checkout-page #payment ul.payment_methods li:hover {
    border-color: #d1d5db !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Radio button styling - appears first in flex row */
body.ecc-checkout-page #payment .wc_payment_method > input[type="radio"],
body.ecc-checkout-page #payment ul.payment_methods li > input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    margin-left: 16px !important;
    accent-color: #6366f1;
    cursor: pointer;
    flex-shrink: 0;
    order: 1;
}

/* Payment method label (header) - appears after radio in flex row */
body.ecc-checkout-page #payment .wc_payment_method > label,
body.ecc-checkout-page #payment ul.payment_methods li > label {
    display: flex !important;
    align-items: center !important;
    padding: 16px !important;
    padding-left: 12px !important;
    margin: 0 !important;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    background: transparent;
    flex: 1;
    order: 2;
}

/* Payment box (expanded content) */
body.ecc-checkout-page #payment div.payment_box {
    background: #f9fafb !important;
    border: none !important;
    border-top: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
    padding: 16px !important;
    margin: 0 !important;
    color: #6b7280;
    font-size: 14px;
    width: 100%;
    order: 3;
}

/* Hide payment box arrow/triangle */
body.ecc-checkout-page #payment div.payment_box::before,
body.ecc-checkout-page #payment div.payment_box::after {
    display: none !important;
    content: none !important;
}

/* Payment box description */
body.ecc-checkout-page #payment div.payment_box p {
    margin: 0 0 12px 0;
    color: #6b7280;
}

body.ecc-checkout-page #payment div.payment_box p:last-child {
    margin-bottom: 0;
}

/* Stripe elements styling */
body.ecc-checkout-page #payment .wc-stripe-upe-element,
body.ecc-checkout-page #payment .wc-stripe-elements-field {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 12px !important;
    margin-bottom: 12px !important;
    min-height: 40px;
}

/* Ensure Stripe iframe container is clean */
body.ecc-checkout-page #payment .wc-stripe-upe-element > *,
body.ecc-checkout-page #payment #wc-stripe-payment-element > * {
    /* Allow Stripe to render its elements */
}

body.ecc-checkout-page #payment fieldset {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Saved payment methods */
body.ecc-checkout-page #payment .woocommerce-SavedPaymentMethods {
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

body.ecc-checkout-page #payment .woocommerce-SavedPaymentMethods li {
    border: none !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    background: transparent !important;
}

/* Save payment method checkbox */
body.ecc-checkout-page #payment .woocommerce-SavedPaymentMethods-saveNew {
    margin: 12px 0 0 0 !important;
    padding: 0 !important;
}

body.ecc-checkout-page #payment .woocommerce-SavedPaymentMethods-saveNew label {
    font-size: 13px !important;
    color: #6b7280 !important;
    font-weight: normal !important;
}

/* Place order section - hide WooCommerce's default */
body.ecc-checkout-page #payment .place-order {
    display: none !important;
}

/* PayPal specific styling */
body.ecc-checkout-page #payment .payment_method_ppcp-gateway .payment_box,
body.ecc-checkout-page #payment .payment_method_paypal .payment_box {
    background: #f9fafb !important;
}

/* Pay button - flex layout for Paga and Amount */
body.ecc-checkout-page .ecc-pay-button,
body.ecc-checkout-page button#place_order {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 24px !important;
}

body.ecc-checkout-page .ecc-pay-button-text,
body.ecc-checkout-page .ecc-pay-button-amount {
    position: relative;
    z-index: 1;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    body.ecc-checkout-page .ecc-checkout-container {
        padding: 16px;
    }

    body.ecc-checkout-page .ecc-checkout-left,
    body.ecc-checkout-page .ecc-checkout-right {
        padding: 24px 20px;
    }

    body.ecc-checkout-page .ecc-billing-form {
        max-width: 100%;
    }

    body.ecc-checkout-page .ecc-back-link {
        margin-bottom: 24px;
    }
}
