/* ===== checkout.css ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-soft {
    0%, 100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(25, 135, 84, 0); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}

/* ===== Section Titles ===== */
.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    padding: 20px;
    animation: fadeInUp 0.6s ease-out;
}
.section-title i {
    color: var(--secondary-color);
}

/* ===== Card Components ===== */
.checkout-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #eef0f5;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.checkout-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
.col-lg-7 .checkout-card {
    animation: fadeInUp 0.6s ease-out;
}
.col-lg-5 .checkout-card {
    animation: fadeInRight 0.6s ease-out 0.2s both;
}
.card-header-custom {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 20px 24px;
    font-weight: 600;
    font-size: 18px;
    position: relative;
    overflow: hidden;
}
.card-header-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 3s infinite;
}
.card-header-custom i { margin-right: 8px; }

/* ===== Form Elements ===== */
.form-label {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}
.form-control {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafbfc;
}
.form-control:hover {
    border-color: #cbd5e1;
    background: #fff;
}
.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(11, 140, 249, 0.12);
    background: #fff;
    transform: translateY(-1px);
}
.form-control.is-valid {
    border-color: var(--theme-color) !important;
    background-image: none;
    background-color: #f0fdf4;
}
.form-control.is-invalid {
    border-color: #dc3545 !important;
    background-image: none;
    background-color: #fef2f2;
    animation: shake 0.4s ease;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== Validation Icons ===== */
.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}
.validation-icon {
    position: absolute;
    right: 14px;
    top: 42px;
    font-size: 18px;
    pointer-events: none;
    z-index: 10;
    animation: fadeInUp 0.3s ease;
}
.validation-icon.success { color: var(--theme-color); }
.validation-icon.error { color: #dc3545; }

/* ===== Order Type Toggle ===== */
.order-type-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.order-type-btn {
    flex: 1;
    max-width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}
.order-type-btn i {
    font-size: 18px;
    margin: 0;
    transition: transform 0.3s ease;
}
.order-type-btn:hover {
    border-color: var(--secondary-color);
    background: #f0f7ff;
    transform: translateY(-2px);
}
.order-type-btn:hover i {
    transform: scale(1.15);
}
.order-type-btn.active {
    background: #5a141d;
    color: #fff;
    border-color: var(--theme-color);
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
    animation: pulse-soft 2s infinite;
}
.order-type-btn.active i {
    color: #fff;
}

/* ===== Summary Card ===== */
.summary-card {
    position: sticky;
    top: 20px;
}
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 2px dotted #d1d5db;
    transition: background 0.2s ease;
}
.summary-item:hover {
    background: #f8fafc;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 8px;
}
.summary-item:last-child {
    border-bottom: none;
}
.item-name {
    font-weight: 600;
    font-size: 16px;
    color: #1a1a1a;
}
.item-price {
    font-weight: 700;
    color: var(--theme-color);
}
.qty-control {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}
.qty-control:hover {
    border-color: var(--secondary-color);
    background: #f0f7ff;
}
.qty-control i {
    color: #6c757d;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}
.qty-control i:hover {
    color: var(--secondary-color);
    transform: scale(1.2);
}
.qty-control span {
    margin: 0 8px;
    font-weight: 600;
    font-size: 16px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 16px;
}
.summary-row.total {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 3px double #eef0f5;
    font-size: 18px;
    font-weight: 700;
}
.summary-row.total .amount {
    color: var(--theme-color);
    font-size: 26px;
    font-weight: 800;
}

/* ===== Coupon Section ===== */
#coupon-message {
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 8px;
    display: none;
    align-items: center;
    margin-top: 8px;
    animation: slideDown 0.3s ease;
}
#coupon-message.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
#coupon-message.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
#coupon-applied .alert {
    font-size: 16px;
    padding: 8px 12px;
    margin-bottom: 0;
}
#couponCode:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}
#button-addon2 {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-light) 100%);
    border: none;
    transition: all 0.3s ease;
}
#button-addon2:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(11, 140, 249, 0.4);
}

/* ===== Buttons ===== */
.btn-pay {
    background: linear-gradient(135deg, var(--theme-color) 0%, #146c43 100%);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    padding: 16px;
    border-radius: 12px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
    position: relative;
    overflow: hidden;
}
.btn-pay::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.btn-pay:hover:not(.disabled)::before {
    left: 100%;
}
.btn-pay:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(25, 135, 84, 0.45);
}
.btn-pay:active:not(.disabled) {
    transform: translateY(-1px);
}
.btn-pay.disabled {
    background: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== Restaurant Info - OPTIMIZED ===== */
.restaurant-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #1a1a1a;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid #dee2e6;
}
.restaurant-info::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(25,135,84,0.05) 0%, transparent 70%);
    pointer-events: none;
}
.restaurant-info h6 {
    font-weight: 700;
    margin: 0;
    font-size: 16px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}
.restaurant-info h6 i {
    color: var(--theme-color);
    font-size: 18px;
}
.restaurant-info small {
    color: #6c757d;
    position: relative;
    z-index: 1;
    font-size: 16px !important;
    font-weight: 400;
    margin-top: 2px;
    display: block;
}

.section-divider {
    border-top: 2px dashed #eef0f5;
    margin: 20px 0;
}

/* ===== Postal Code UI ===== */
.postal-hint {
    font-size: 16px;
    color: #6c757d;
    margin-top: 4px;
    display: block;
}
.postal-status {
    font-size: 16px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--secondary-color);
    font-weight: 500;
}
.postal-status .fetch-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--secondary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: postalSpin 0.8s linear infinite;
}
@keyframes postalSpin {
    to { transform: rotate(360deg); }
}

/* ===== Textarea Validation ===== */
textarea.form-control.is-valid,
textarea.form-control.is-invalid {
    background-image: none !important;
}
textarea.form-control.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

/* ===== Pulse Success Effect ===== */
.pulse-success {
    animation: pulse-success-anim 0.6s ease;
}
@keyframes pulse-success-anim {
    0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(25, 135, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .order-type-container {
        flex-direction: column;
    }
    .order-type-btn {
        max-width: 100%;
    }
    .summary-card {
        position: relative;
        top: 0;
    }
    .section-title {
        font-size: 22px;
    }
    .restaurant-info {
        padding: 10px 15px;
    }
}
