/**
 * FORDIPS TECH - Responsive Checkout Styles
 * Ensures checkout works perfectly on all screen sizes
 */

/* ===== CHECKOUT MODAL RESPONSIVE BASE ===== */
.modal-content {
    width: 95%;
    max-width: 900px;
    max-height: 95vh;
    overflow-y: auto;
    padding: 2rem;
    box-sizing: border-box;
}

.checkout-content {
    max-width: 100%;
    width: 100%;
}

/* ===== PAYMENT METHODS GRID - RESPONSIVE BLOCKS ===== */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns on desktop for 2 rows display */
    gap: 1rem;
    margin: 1.5rem 0;
}

.payment-option {
    display: block;
    position: relative;
    cursor: pointer;
    width: 100%;
}

.payment-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.payment-option-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    min-height: 70px;
    box-sizing: border-box;
}

.payment-option:hover .payment-option-content {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.payment-option input[type="radio"]:checked ~ .payment-option-content {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.payment-logo,
.payment-logo-single {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.payment-logo-group {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.payment-logo-group img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.payment-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.payment-option-content div {
    flex: 1;
    min-width: 0;
}

.payment-option-content strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: #1a1a2e;
    font-weight: 600;
}

.payment-option-content small {
    display: block;
    font-size: 0.8rem;
    color: #666;
}

/* ===== TRUST BADGES - RESPONSIVE GRID ===== */
.trust-badges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.trust-badge svg {
    color: #667eea;
    flex-shrink: 0;
}

.trust-badge strong {
    display: block;
    font-size: 0.9rem;
    color: #1a1a2e;
    margin-bottom: 0.2rem;
}

.trust-badge small {
    display: block;
    font-size: 0.75rem;
    color: #666;
}

/* ===== FORM ROWS - RESPONSIVE ===== */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== CHECKOUT SUMMARY - RESPONSIVE ===== */
.checkout-summary {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.checkout-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkout-summary-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #1a1a2e;
}

.checkout-currency-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.checkout-currency-selector label {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

.currency-select-checkout {
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    box-sizing: border-box;
}

.currency-select-checkout:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.currency-select-checkout:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== SHIPPING OPTIONS - RESPONSIVE ===== */
.shipping-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.shipping-option {
    display: block;
    cursor: pointer;
}

.shipping-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.shipping-option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    transition: all 0.3s ease;
}

.shipping-option:hover .shipping-option-content {
    border-color: #667eea;
}

.shipping-option input[type="radio"]:checked ~ .shipping-option-content {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.shipping-info strong {
    display: block;
    font-size: 0.95rem;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
}

.shipping-info small {
    display: block;
    font-size: 0.8rem;
    color: #666;
}

.shipping-price {
    font-weight: 700;
    font-size: 1rem;
    color: #667eea;
}

/* ===== TABLET RESPONSIVE (768px - 968px) ===== */
@media (max-width: 968px) {
    .payment-methods {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on tablet */
    }

    .trust-badges {
        grid-template-columns: repeat(2, 1fr); /* Keep 2 columns on tablet */
    }

    .modal-content {
        padding: 1.5rem;
    }
}

/* ===== TABLET/MOBILE RESPONSIVE (max-width: 768px) ===== */
@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        padding: 1.5rem 1rem;
        max-height: 98vh;
    }

    .checkout-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    /* Payment methods: 2 columns on mobile for better visibility */
    .payment-methods {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .payment-option-content {
        padding: 0.875rem;
        min-height: 80px;
    }

    .payment-option-content strong {
        font-size: 0.85rem;
    }

    .payment-option-content small {
        font-size: 0.7rem;
    }

    .payment-logo,
    .payment-logo-single {
        width: 32px;
        height: 32px;
    }

    .payment-logo-group img {
        width: 28px;
        height: 28px;
    }

    /* Trust badges: 1 column on mobile */
    .trust-badges {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .trust-badge {
        padding: 0.75rem;
    }

    /* Form rows: 1 column on mobile */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group select {
        padding: 0.625rem 0.875rem;
        font-size: 0.95rem;
    }

    /* Checkout summary header */
    .checkout-summary-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .checkout-summary-header h3 {
        font-size: 1.2rem;
    }

    .checkout-currency-selector {
        width: 100%;
    }

    .currency-select-checkout {
        width: 100%;
        min-width: 100%;
        font-size: 0.85rem;
        padding: 0.5rem 2rem 0.5rem 0.8rem;
    }

    .checkout-summary {
        padding: 1rem;
    }

    /* Checkout actions */
    .checkout-actions {
        gap: 0.75rem;
    }

    .btn-place-order,
    .btn-help-me-pay {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .btn-place-order {
        font-size: 1.05rem;
    }

    /* Shipping options */
    .shipping-option-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.875rem;
    }

    .shipping-price {
        align-self: flex-end;
        font-size: 0.95rem;
    }
}

/* ===== SMALL MOBILE RESPONSIVE (max-width: 576px) ===== */
@media (max-width: 576px) {
    .modal-content {
        width: 100%;
        padding: 1rem 0.75rem;
        border-radius: 0;
        max-height: 100vh;
    }

    .checkout-content h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .checkout-section h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    /* Payment methods */
    .payment-methods {
        gap: 0.625rem;
    }

    .payment-option-content {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .payment-logo,
    .payment-logo-single {
        width: 32px;
        height: 32px;
    }

    .payment-logo-group img {
        width: 28px;
        height: 28px;
    }

    .payment-icon {
        font-size: 1.75rem;
    }

    .payment-option-content strong {
        font-size: 0.85rem;
    }

    .payment-option-content small {
        font-size: 0.7rem;
    }

    /* Trust badges */
    .trust-badges {
        gap: 0.625rem;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    .trust-badge {
        padding: 0.625rem;
        gap: 0.5rem;
    }

    .trust-badge svg {
        width: 24px;
        height: 24px;
    }

    .trust-badge strong {
        font-size: 0.8rem;
    }

    .trust-badge small {
        font-size: 0.7rem;
    }

    /* Form elements */
    .form-group {
        margin-bottom: 0.875rem;
    }

    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.4rem;
    }

    .form-group input,
    .form-group select {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Checkout summary */
    .checkout-summary {
        padding: 0.875rem;
        margin-top: 1.5rem;
    }

    .checkout-summary-header {
        margin-bottom: 1rem;
        padding-bottom: 0.875rem;
    }

    .checkout-summary-header h3 {
        font-size: 1.1rem;
    }

    .checkout-currency-selector label {
        font-size: 0.8rem;
    }

    .currency-select-checkout {
        font-size: 0.8rem;
        padding: 0.5rem 1.75rem 0.5rem 0.75rem;
    }

    .summary-row {
        padding: 0.625rem 0;
        font-size: 0.9rem;
    }

    .summary-row.total {
        font-size: 1.1rem;
        padding-top: 0.875rem;
        margin-top: 0.4rem;
    }

    /* Checkout actions */
    .checkout-actions {
        margin-top: 1rem;
    }

    .btn-place-order,
    .btn-help-me-pay {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    .btn-place-order {
        font-size: 0.95rem;
    }

    .btn-place-order svg,
    .btn-help-me-pay svg {
        width: 18px;
        height: 18px;
    }

    /* Shipping options */
    .shipping-options-section h4 {
        font-size: 0.9rem !important;
        margin: 0.875rem 0 0.625rem !important;
    }

    .shipping-option-content {
        padding: 0.75rem;
    }

    .shipping-info strong {
        font-size: 0.85rem;
    }

    .shipping-info small {
        font-size: 0.75rem;
    }

    .shipping-price {
        font-size: 0.875rem;
    }
}

/* ===== EXTRA SMALL MOBILE (max-width: 400px) ===== */
@media (max-width: 400px) {
    .modal-content {
        padding: 0.75rem 0.5rem;
    }

    .checkout-content h2 {
        font-size: 1.2rem;
    }

    .payment-option-content {
        padding: 0.625rem;
        gap: 0.5rem;
    }

    .payment-logo,
    .payment-logo-single {
        width: 28px;
        height: 28px;
    }

    .payment-logo-group img {
        width: 24px;
        height: 24px;
    }

    .currency-select-checkout {
        font-size: 0.75rem;
        padding: 0.5rem 1.5rem 0.5rem 0.625rem;
    }

    .btn-place-order,
    .btn-help-me-pay {
        padding: 0.75rem 0.875rem;
        font-size: 0.85rem;
        gap: 0.5rem;
    }
}

/* ===== LANDSCAPE MODE FIXES ===== */
@media (max-width: 968px) and (orientation: landscape) {
    .modal-content {
        max-height: 95vh;
        overflow-y: auto;
    }

    .payment-methods {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== ENSURE EVERYTHING IS VISIBLE ===== */
.checkout-section {
    margin-bottom: 2rem;
}

.checkout-section:last-child {
    margin-bottom: 1rem;
}

.checkout-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #1a1a2e;
    font-weight: 700;
}

/* ===== MODAL CLOSE BUTTON - ALWAYS VISIBLE ===== */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

@media (max-width: 576px) {
    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 1.3rem;
        top: 0.75rem;
        right: 0.75rem;
    }
}
