/* =====================================================
   PROFESSIONAL CHECKOUT PAGE - Foxtale Inspired
   ===================================================== */

.checkout-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
}

/* Phone Login Modal */
.phone-login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.phone-login-modal.active {
    opacity: 1;
    visibility: visible;
}

.phone-login-content {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: #e8e8e8;
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-logo {
    font-size: 48px;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.modal-subtitle {
    font-size: 14px;
    color: #7f8c8d;
    margin: 0;
}

.phone-input-group {
    margin-bottom: 20px;
}

.phone-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 16px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.phone-input-wrapper:focus-within {
    border-color: #2c3e50;
    background: #fff;
}

.country-code {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #2c3e50;
}

.phone-input {
    flex: 1;
    min-width: 200px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    outline: none;
    width: 100%;
}

.phone-input::placeholder {
    color: #bdc3c7;
}

.otp-input-group {
    margin-bottom: 20px;
}

.otp-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.otp-input {
    width: 52px;
    height: 52px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
    color: #2c3e50;
    transition: all 0.2s ease;
}

.otp-input:focus {
    border-color: #2c3e50;
    background: #fff;
    outline: none;
}

.modal-action-btn {
    width: 100%;
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 62, 80, 0.3);
}

.modal-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.resend-link {
    text-align: center;
    margin-top: 16px;
}

.resend-btn {
    background: none;
    border: none;
    color: #3498db;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.resend-btn:hover {
    color: #2980b9;
}

.gokwik-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
}

.badge-text {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 600;
}

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

.security-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.security-icon {
    width: 24px;
    height: 24px;
    background: #e8f8f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #27ae60;
}

.security-label {
    font-size: 10px;
    color: #95a5a6;
    font-weight: 600;
}

/* Delivery Details Section */
.checkout-section {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.edit-btn {
    background: none;
    border: none;
    color: #3498db;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.edit-btn:hover {
    color: #2980b9;
}

.address-display {
    padding: 16px;
    background: #f9f9f9;
    border-radius: 12px;
    border-left: 4px solid #27ae60;
}

.address-name {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.address-details {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.6;
    margin: 0;
}

.address-phone {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 600;
    margin-top: 8px;
}

.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.delivery-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delivery-option:hover {
    border-color: #2c3e50;
    background: #fff;
}

.delivery-option.selected {
    border-color: #2c3e50;
    background: #f0f8ff;
}

.delivery-option-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.delivery-icon {
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.delivery-option-details {
    flex: 1;
}

.delivery-option-name {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 4px 0;
}

.delivery-option-desc {
    font-size: 13px;
    color: #7f8c8d;
    margin: 0;
}

.delivery-price {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.delivery-price.free {
    color: #27ae60;
}

/* Coupons Section */
.coupons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.coupon-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8cc 100%);
    border: 2px dashed #f39c12;
    border-radius: 12px;
}

.coupon-info {
    flex: 1;
}

.coupon-code {
    font-size: 15px;
    font-weight: 700;
    color: #d35400;
    font-family: 'Courier New', monospace;
    margin: 0 0 4px 0;
}

.coupon-desc {
    font-size: 13px;
    color: #7f8c8d;
    margin: 0;
}

.apply-coupon-btn {
    background: #f39c12;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.apply-coupon-btn:hover {
    background: #e67e22;
}

.apply-coupon-btn.applied {
    background: #27ae60;
    cursor: default;
}

/* Recommendations */
.last-minute-favorites {
    margin-top: 16px;
}

.favorites-title {
    font-size: 16px;
    font-weight: 700;
    color: #e74c3c;
    margin: 0 0 12px 0;
}

.favorites-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.favorite-item {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.favorite-image {
    width: 100%;
    height: 120px;
    background: #fafafa;
    overflow: hidden;
}

.favorite-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-details {
    padding: 12px;
}

.favorite-name {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.favorite-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.favorite-price {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
}

.favorite-discount {
    font-size: 12px;
    font-weight: 600;
    color: #27ae60;
    background: #e8f8f5;
    padding: 2px 8px;
    border-radius: 4px;
}

.favorite-add-btn {
    width: 100%;
    background: #2c3e50;
    color: #fff;
    border: none;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s ease;
}

.favorite-add-btn:hover {
    background: #1a252f;
}

/* Payment Options */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.payment-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-option:hover {
    border-color: #2c3e50;
    background: #fafafa;
}

.payment-option.selected {
    border-color: #2c3e50;
    background: #f0f8ff;
}

.payment-option-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.payment-icon {
    width: 40px;
    height: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.payment-option-details {
    flex: 1;
}

.payment-option-name {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 4px 0;
}

.payment-option-desc {
    font-size: 13px;
    color: #7f8c8d;
    margin: 0;
}

.payment-discount-badge {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.upi-qr-section {
    margin-top: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 12px;
    text-align: center;
}

.qr-code {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    background: #fff;
    padding: 16px;
    border-radius: 12px;
}

.upi-apps {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.upi-app {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Order Summary Sidebar */
.order-summary {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.summary-header {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 20px 0;
}

.summary-items {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.summary-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    flex-shrink: 0;
}

.summary-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.summary-item-details {
    flex: 1;
}

.summary-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.summary-item-qty {
    font-size: 12px;
    color: #7f8c8d;
}

.summary-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    text-align: right;
}

.summary-calculations {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-label {
    font-size: 14px;
    color: #7f8c8d;
}

.summary-value {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.summary-discount {
    color: #27ae60;
    font-weight: 700;
}

.summary-total {
    padding-top: 16px;
    border-top: 2px solid #2c3e50;
    margin-top: 16px;
}

.summary-total .summary-label {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.summary-total .summary-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.place-order-btn {
    width: 100%;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.place-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.3);
}

.place-order-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 992px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }
    
    .order-summary {
        position: static;
        max-height: none;
    }
    
    .favorites-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .checkout-container {
        padding: 0 16px;
    }
    
    .checkout-section {
        padding: 16px;
    }
    
    .order-summary {
        padding: 16px;
    }
    
    .phone-login-content {
        padding: 24px;
    }
    
    .otp-input {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}
