﻿/**
 * Order Payment - Complete CSS with Enhanced Payment Methods
 * Version: 27.02.05.03
 * Preserves ALL cartv1.06.css + adds enhanced payment method styles
 * .group-header and .wallet-header hidden by default with d-none
 */

/* ============================================================================
   ORIGINAL CART STYLES - PRESERVED
   ============================================================================ */

:root {
    --primary-color: #046878;
    --primary-hover: #046878;
    --primary-light: #ede9ve;
    --success-color: #059669;
    --danger-color: #dc2626;
    --badge-bg-color: #fef3c7;
    --badge-text-color: #92400e;
    --main-bg-color: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 25px 60px rgba(0, 0, 0, 0.15);
}

body {
    background: linear-gradient(135deg, #010B3B 0%, #046878 50%, #046878 100%);
    background-attachment: fixed;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.6;
}

.payment-card {
    background: var(--main-bg-color);
    backdrop-filter: blur(20px);
    border: none;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

    .payment-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--primary-color), #046878, #f59e0b);
    }

    .payment-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 30px 70px rgba(0, 0, 0, 0.18);
    }

/* ============================================================================
   ENHANCED PAYMENT METHOD STYLES (NEW)
   ============================================================================ */

/* Payment Groups */
.payment-group {
    margin-bottom: 0;
}

    .payment-group:last-child {
        margin-bottom: 0;
    }
/* ← NEW: Hidden payment groups on mobile */
.payment-group-hidden {
    display: none;
}
/* Group Headers - Hidden by default with d-none */
.group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

    .group-header i {
        font-size: 1.2rem;
        color: var(--primary-color);
    }

.group-methods {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

/* Payment Method Cards - Enhanced */
.payment-method-card {
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 0.25rem 0.25em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--main-bg-color);
    position: relative;
    overflow: hidden;
}

    .payment-method-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, var(--primary-light) 0%, transparent 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .payment-method-card:hover {
        border-color: var(--primary-color);
        transform: translateY(-4px) scale(1.02);
        box-shadow: var(--shadow-md);
    }

        .payment-method-card:hover::before {
            opacity: 0.5;
        }

    .payment-method-card.selected {
        border-color: var(--primary-color);
        border-width: 3px;
        background: linear-gradient(135deg, var(--primary-light) 0%, #ffffff 100%);
        box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
        transform: scale(1.03);
    }

        .payment-method-card.selected::after {
            content: '✓';
            position: absolute;
            top: 12px;
            right: 12px;
            width: 28px;
            height: 28px;
            background: var(--primary-color);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 16px;
            animation: checkmark-pop 0.3s ease;
        }

@keyframes checkmark-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Payment Icons - Enhanced with brand support */
.payment-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fef3c7 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

    .payment-icon i {
        color: var(--primary-color);
    }

.payment-method-card:hover .payment-icon {
    transform: scale(1.1) rotate(5deg);
}

.payment-icon.brand-icon {
    background: #ffffff;
    border: 0px solid var(--border-color);
    padding: 0.5rem;
}

    .payment-icon.brand-icon svg {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

/* Wallet Combo - Hidden header by default */
.wallet-header {
    text-align: center;
    margin-bottom: 1rem;
}

    .wallet-header h6 {
        margin: 0 0 0.5rem 0;
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text-primary);
    }

    .wallet-header small {
        color: var(--text-secondary);
    }

/* Form Controls */
.form-control {
    border-radius: 14px;
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    background-color: #fafafa;
    color: var(--text-primary);
}

    .form-control:hover {
        border-color: var(--primary-color);
        background-color: #ffffff;
    }

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
        background-color: #ffffff;
        outline: none;
    }

    .form-control::placeholder {
        color: var(--text-muted);
        opacity: 0.8;
    }

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: 14px;
    padding: 1rem 2.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

    .btn-primary::before {
        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;
    }

    .btn-primary:hover::before {
        left: 100%;
    }

    .btn-primary:hover {
        background: linear-gradient(135deg, var(--primary-hover) 0%, #5b21b6 100%);
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(124, 58, 237, 0.4);
    }

    .btn-primary:active {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    }
/* ← NEW: Show More Methods Button */
.show-more-methods {
    border-radius: 12px;
    padding: 0.875rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none; /*2px solid var(--border-color);*/
    background: var(--main-bg-color);
    color: var(--primary-color);
}

    .show-more-methods:hover {
        background: var(--primary-light) !important;
        border-color: var(--primary-color);
        transform: translateY(-2px);
        /*box-shadow: var(--shadow-md);*/
        color: var(--primary-color) !important;
    }

    .show-more-methods i {
        transition: transform 0.3s ease;
    }

    .show-more-methods.expanded i.bi-chevron-down {
        transform: rotate(180deg);
    }
/* Product Header Container */
.product-header-container {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    margin-bottom: 0.1rem;
    align-items: start;
}

.product-image-container {
    position: relative;
}

.product-image {
    width: 150px;
    height: 150px;
    border-radius: 28px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    border: 4px solid white;
    transition: all 0.3s ease;
}

    .product-image:hover {
        transform: scale(1.05) rotate(2deg);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    }
.product-badge {
    background: linear-gradient(135deg, var(--badge-bg-color) 0%, #fde68a 100%);
    color: var(--badge-text-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.7rem;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(146, 64, 14, 0.2);
    width: max-content;
    position: absolute;
    top: 7px;
    left: 100%; 
    transform: translateX(-50%); 
    letter-spacing: 0.5px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    max-width: 245px;
    /* remove margin-left entirely */
}
.product-badge-o {
    background: linear-gradient(135deg, var(--badge-bg-color) 0%, #fde68a 100%);
    color: var(--badge-text-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.7rem;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(146, 64, 14, 0.2);
    width: max-content;
    position: absolute;
    top: 12px;
    letter-spacing: 0.5px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    margin-left: -70px;
    max-width: 245px;
}

.product-info-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.product-name-price-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-name {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.product-price-display {
    font-size: 1.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), #010B3B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.3;
    text-align: end;
    letter-spacing: -1px;
}

.product-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

/* Expand/Collapse Toggle */
.expand-toggle {
    display: none;
    width: 100%;
    margin-top: 0.125rem;
    background: none;
    border: none;
    border-radius: 12px;
    text-align: right;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .expand-toggle:hover {
        transform: translateY(-2px);
    }

    .expand-toggle:active {
        transform: translateY(0);
    }

/* Product Summary Collapsible */
.product-summary-collapsible {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-summary-collapsed {
    max-height: 0px;
    overflow: hidden;
    position: relative;
    opacity: 0;
}

    .product-summary-collapsed::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 80px;
        background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.95));
        pointer-events: none;
    }

.product-summary-expanded {
    max-height: 1000px;
    opacity: 1;
}

/* Order Details Table */
.order-details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

    .order-details-table td {
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
        font-size: 1rem;
    }

    .order-details-table tr:last-child td {
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 1.25rem;
        padding-top: 1.25rem;
    }

.order-details-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

.order-details-value {
    text-align: right;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.order-details-total {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), #046878);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Security Badge */
.security-badge {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    border: 2px solid #a7f3d0;
    border-radius: 16px;
    transition: all 0.3s ease;
}

    .security-badge:hover {
        transform: scale(1.02);
        box-shadow: var(--shadow-sm);
    }
.fs-8 {
    font-size: 0.85rem !important;
}
.fs-11 {
    font-size: 11px;
}
/* Country Flag */
.country-flag {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid white;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-btn {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .language-btn:hover {
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        border-color: #0d6efd;
    }

.language-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    overflow: hidden;
}

    .language-menu.show {
        display: block;
    }

.language-option {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

    .language-option:hover {
        background-color: #f8f9fa;
    }

    .language-option.active {
        background-color: #e7f1ff;
        color: #0d6efd;
        font-weight: 600;
    }

/* Loading Overlay */
.language-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    .language-loading.show {
        display: flex;
    }

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .group-methods {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .payment-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .group-header {
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }
}

/* Mobile (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .payment-method-card {
        padding: 1rem;
    }

    .payment-icon {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }

    .group-header {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .payment-method-card.selected::after {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
}

/* Small Mobile (400px - 575px) */
@media (min-width: 400px) and (max-width: 575px) {
    .payment-group {
        margin-bottom: 0;
    }

    .payment-method-card {
        padding: 0.475rem;
    }

    .payment-icon {
        width: 48px;
        height: 48px;
        font-size: 1.35rem;
    }

    .group-header {
        padding: 0.625rem 0.875rem;
        font-size: 0.825rem;
        border-left-width: 3px;
    }

    .payment-method-card.selected::after {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
        top: 0.625rem;
        right: 0.625rem;
    }
}

/* Extra Small Mobile (<400px) */
@media (max-width: 399px) {
    .payment-group {
        margin-bottom: 0;
    }

    .payment-method-card {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .payment-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .group-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        border-left-width: 3px;
        gap: 0.5rem;
    }

    .payment-method-card.selected::after {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
        top: 0.5rem;
        right: 0.5rem;
    }
}

/* Mobile Specific */
@media (max-width: 768px) {
    .expand-toggle {
        display: block;
        padding: 0 !important;
        font-size: 0.65rem;
    }

    .product-header-container {
        grid-template-columns: 110px 1fr;
        gap: 0.875rem;
    }

    .product-image {
        width: 50px;
        height: 50px;
        border-radius: 18px;
        border-width: 3px;
    }

    .product-name {
        font-size: 1.25rem;
        display: none !important;
    }
    .product-description {
        display: none !important;
    }
    .product-price-display {
        font-size: 1.25rem;
    }
    .product-badge {
        font-size: 0.65rem;
        padding: 4px 4px;
        top: -5px;
        left: 82%;
        transform: translateX(-50%);
    }
    .product-badge-o {
        font-size: 0.65rem;
        padding: 4px 4px;
        top: -5px;
        margin-left: -8px;
    }

    .page-header {
        display: none !important;
    }
}

/* ============================================================================
   RTL SUPPORT
   ============================================================================ */

[dir="rtl"] .group-header {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

[dir="rtl"] .payment-method-card.selected::after {
    right: auto;
    left: 12px;
}

[dir="rtl"] .language-menu {
    text-align: left;
    left: 0;
}

@media (max-width: 767px) {
    [dir="rtl"] .payment-method-card.selected::after {
        left: 10px;
    }
}

@media (max-width: 399px) {
    [dir="rtl"] .payment-method-card.selected::after {
        left: 0.5rem;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

.payment-method-card:focus-within {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(4, 104, 120, 0.25);
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .payment-method-card {
        border-width: 3px;
    }

        .payment-method-card.selected {
            border-width: 4px;
        }

    .group-header {
        border-left-width: 6px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .payment-method-card:hover {
        transform: none;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.payment-group {
    animation: fadeIn 0.4s ease-out;
}

    .payment-group:nth-child(2) {
        animation-delay: 0.1s;
    }

    .payment-group:nth-child(3) {
        animation-delay: 0.2s;
    }

    .payment-group:nth-child(4) {
        animation-delay: 0.3s;
    }

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.form-check-input:checked {
    visibility: hidden !important;
}

.vat-percentage {
    font-size: 0.875rem;
}

.currency-display {
    font-weight: 600;
}

/* Print Styles */
@media print {
    .payment-method-card {
        break-inside: avoid;
        border: 2px solid #000;
    }

        .payment-method-card.selected {
            border: 3px solid #000;
        }

    .group-header {
        background: white;
        border: 2px solid #000;
    }
}
#toast-container.toast-bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 90%;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #toast-container.toast-bottom-center {
        bottom: 15px;
        max-width: 95%;
    }
}