/* ==================================================================
   PAYMENT METHOD SELECTION FIX
   Ensures payment method functionality works properly on mobile
================================================================== */

/* Restore payment method functionality */
@media (max-width: 768px) {
    
    /* Payment Methods Grid - Ensure proper interaction */
    .payment-methods-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
        margin: 1rem 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        /* Ensure it's not affected by language switcher resets */
        position: relative !important;
        z-index: 10 !important;
    }

    /* Payment Method Cards - Restore full functionality */
    .payment-method {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 1rem 0.75rem !important;
        border: 2px solid #e5e7eb !important;
        border-radius: 12px !important;
        background: white !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        min-height: 85px !important;
        text-align: center !important;
        position: relative !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
        /* Ensure interactivity is preserved */
        pointer-events: auto !important;
        user-select: none !important;
        -webkit-user-select: none !important;
        /* Allow transforms for hover effects */
        transform: translateZ(0) !important; /* Force hardware acceleration */
        will-change: transform, box-shadow, border-color !important;
        z-index: 10 !important;
    }

    /* Hover and Active States - Restore functionality */
    .payment-method:hover {
        border-color: #10b981 !important;
        transform: translateY(-1px) translateZ(0) !important;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15) !important;
        background: #f9fafb !important;
        /* Ensure hover works */
        z-index: 11 !important;
    }

    .payment-method:active {
        transform: translateY(0) translateZ(0) !important;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2) !important;
    }

    /* Selected State - Enhanced visibility */
    .payment-method.selected {
        border-color: #10b981 !important;
        background: #f0fdf4 !important;
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
        z-index: 12 !important;
        transform: translateZ(0) !important;
    }

    /* Selection Checkmark */
    .payment-method.selected::after {
        content: '✓' !important;
        position: absolute !important;
        top: 8px !important;
        right: 8px !important;
        width: 20px !important;
        height: 20px !important;
        background: #10b981 !important;
        color: white !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 12px !important;
        font-weight: bold !important;
        z-index: 13 !important;
    }

    /* Payment Method Icons - Ensure visibility */
    .payment-method-icon {
        width: 32px !important;
        height: 24px !important;
        margin-bottom: 0.5rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        pointer-events: none !important;
        /* Preserve icon transforms */
        transform: translateZ(0) !important;
    }

    /* Payment Method Names */
    .payment-method-name {
        font-size: 0.85rem !important;
        font-weight: 600 !important;
        color: #374151 !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        pointer-events: none !important;
        /* Ensure text is visible */
        opacity: 1 !important;
        visibility: visible !important;
    }

    .payment-method.selected .payment-method-name {
        color: #059669 !important;
    }

    /* Payment Section Container */
    .payment-section {
        margin-bottom: 2rem !important;
        position: relative !important;
        z-index: 10 !important;
        /* Ensure section is not affected by resets */
        transform: none !important;
        contain: none !important;
        isolation: auto !important;
        pointer-events: auto !important;
    }

    /* Section Title */
    .payment-section .section-title {
        text-align: center !important;
        margin-bottom: 1.5rem !important;
        font-size: 1.2rem !important;
        font-weight: 600 !important;
        color: #1e293b !important;
        position: relative !important;
        z-index: 10 !important;
    }
}

/* Small screens - Single column for very cramped spaces */
@media (max-width: 400px) {
    .payment-methods-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    .payment-method {
        flex-direction: row !important;
        justify-content: flex-start !important;
        text-align: left !important;
        padding: 1rem !important;
        min-height: 70px !important;
        gap: 1rem !important;
    }

    .payment-method-icon {
        width: 28px !important;
        height: 20px !important;
        margin-bottom: 0 !important;
    }

    .payment-method-name {
        font-size: 0.9rem !important;
    }
}

/* RTL Support for Payment Methods */
html[dir="rtl"] .payment-methods-grid {
    direction: rtl !important;
}

html[dir="rtl"] .payment-method {
    text-align: center !important;
}

@media (max-width: 400px) {
    html[dir="rtl"] .payment-method {
        flex-direction: row-reverse !important;
        text-align: right !important;
    }
}

/* Desktop - Ensure no conflicts */
@media (min-width: 769px) {
    .payment-method {
        /* Preserve all desktop functionality */
        transform: none !important;
        transition: all 0.2s ease !important;
    }

    .payment-method:hover {
        transform: translateY(-2px) !important;
    }
}

/* Emergency Payment Method Selector Fix */
.payment-method[data-method] {
    /* Ensure data attributes work for selection */
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Click/Touch Event Restoration */
.payment-method,
.payment-method-icon,
.payment-method-name {
    /* Ensure all click events work */
    pointer-events: auto !important;
}

/* Override any conflicting styles from language switcher fix */
.payment-methods-grid,
.payment-method,
.payment-section {
    /* Ensure these are not affected by universal resets */
    transform: initial !important;
    contain: initial !important;
    isolation: initial !important;
    perspective: initial !important;
    filter: initial !important;
    backdrop-filter: initial !important;
    -webkit-backdrop-filter: initial !important;
} 