/* Enhanced Checkout Styles - Premium Design */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #2c2c2c;
    background: linear-gradient(135deg, #f8f6f3 0%, #ffffff 100%);
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Enhanced Header */
.checkout-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 115, 85, 0.1);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

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

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 500;
    color: #2c2c2c;
    text-decoration: none;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.secure-badge {
    display: flex;
    align-items: center;
    color: #059669;
    font-size: 0.95rem;
    font-weight: 500;
    background: rgba(5, 150, 105, 0.08);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    border: 1px solid rgba(5, 150, 105, 0.2);
    transition: all 0.3s ease;
}

.secure-badge:hover {
    background: rgba(5, 150, 105, 0.12);
    transform: translateY(-1px);
}

.lock-icon {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
}

/* Enhanced Success Page */
.success-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    padding: 3rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    border: 1px solid rgba(5, 150, 105, 0.1);
    animation: successFadeIn 0.6s ease-out;
}

@keyframes successFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    animation: checkmarkPulse 0.6s ease-out;
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.2);
}

@keyframes checkmarkPulse {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: #059669;
}

.success-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #1f2937;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.success-card p {
    font-family: 'Cormorant Garamond', serif;
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.payment-id {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 2.5rem;
    font-family: 'Inter', sans-serif;
    background: #f9fafb;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.continue-btn {
    background: linear-gradient(135deg, #8B7355, #6d5a42);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(139, 115, 85, 0.3);
    font-family: 'Inter', sans-serif;
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(139, 115, 85, 0.4);
}

/* Enhanced Main Checkout */
.checkout-main {
    padding: 3rem 0;
    min-height: calc(100vh - 120px);
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

.checkout-forms h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: #1f2937;
    letter-spacing: -0.02em;
}

.checkout-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
    font-style: italic;
}

/* Enhanced Error Alert */
.error-alert {
    background: linear-gradient(135deg, #fef2f2, #ffffff);
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid #dc2626;
    animation: errorSlideIn 0.3s ease-out;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.error-alert p {
    color: #dc2626;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Enhanced Form Sections */
.form-section {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 115, 85, 0.3), transparent);
}

.form-section:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.form-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-section h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #8B7355, #6d5a42);
    border-radius: 2px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #8B7355;
    box-shadow: 0 0 0 4px rgba(139, 115, 85, 0.1);
    background: white;
}

.form-group input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Enhanced Digital Wallet Buttons */
.digital-wallets {
    margin-bottom: 2rem;
}

.digital-wallet-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.5px;
}

.digital-wallet-button:last-child {
    margin-bottom: 0;
}

.digital-wallet-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.digital-wallet-button::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;
}

.digital-wallet-button:hover::before {
    left: 100%;
}

.apple-pay-button {
    background: linear-gradient(135deg, #000000, #333333);
    color: white;
    border: 1px solid #000000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.apple-pay-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #333333, #555555);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.google-pay-button {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    color: #3c4043;
    border: 2px solid #dadce0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.google-pay-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #f8f9fa, #e8eaed);
    border-color: #8B7355;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.wallet-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.apple-pay-button .wallet-icon {
    fill: white;
}

/* Enhanced Payment Divider */
.payment-divider {
    position: relative;
    text-align: center;
    margin: 2.5rem 0;
}

.payment-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(139, 115, 85, 0.2), transparent);
    border-radius: 1px;
}

.payment-divider span {
    background: linear-gradient(135deg, #f8f6f3, #ffffff);
    color: #8B7355;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Enhanced Payment Method */
.payment-option {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.payment-option:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(139, 115, 85, 0.2);
}

.payment-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    accent-color: #8B7355;
    cursor: pointer;
}

.payment-option label {
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
}

.card-form {
    padding: 1.5rem;
    background: rgba(248, 246, 243, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(139, 115, 85, 0.1);
}

/* Square Card Container Enhanced */
#card-container {
    min-height: 120px;
    padding: 1.5rem 0;
}

.demo-notice {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #93c5fd;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #1e40af;
    font-weight: 500;
}

/* Enhanced Complete Order Button */
.complete-order-btn {
    width: 100%;
    background: linear-gradient(135deg, #8B7355, #6d5a42);
    color: white;
    border: none;
    padding: 1.25rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(139, 115, 85, 0.3);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

.complete-order-btn::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;
}

.complete-order-btn:hover:not(:disabled)::before {
    left: 100%;
}

.complete-order-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #6d5a42, #5a4735);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(139, 115, 85, 0.4);
}

.complete-order-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.square-status {
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
    padding: 1rem;
    background: rgba(248, 246, 243, 0.3);
    border-radius: 8px;
    margin-top: 1rem;
}

/* Enhanced Order Summary */
.order-summary {
    position: sticky;
    top: 140px;
    height: fit-content;
}

.summary-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.summary-card:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.summary-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 500;
    margin-bottom: 2rem;
    color: #1f2937;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.summary-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #8B7355, #6d5a42);
    border-radius: 1px;
}

/* Enhanced Cart Items */
.cart-items {
    margin-bottom: 2rem;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(139, 115, 85, 0.1);
    transition: all 0.3s ease;
}

.cart-item:hover {
    background: rgba(248, 246, 243, 0.3);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    margin: 0 -1rem;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-image {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #f8f6f3, #8B7355);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-right: 1.5rem;
    box-shadow: 0 4px 15px rgba(139, 115, 85, 0.2);
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.item-price {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quantity-controls button {
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #8B7355;
}

.quantity-controls button:hover {
    background: #8B7355;
    color: white;
    border-color: #8B7355;
    transform: scale(1.1);
}

.quantity-controls span:not(.remove-btn) {
    min-width: 24px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
}

.remove-btn {
    color: #ef4444;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 0.75rem;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.remove-btn:hover {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

.item-total {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

.empty-cart {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    background: rgba(248, 246, 243, 0.3);
    border-radius: 16px;
}

.empty-cart button {
    background: linear-gradient(135deg, #8B7355, #6d5a42);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.empty-cart button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 115, 85, 0.3);
}

/* Enhanced Order Totals */
.order-totals {
    background: rgba(248, 246, 243, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(139, 115, 85, 0.1);
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    padding: 0.25rem 0;
}

.total-row span:first-child {
    color: #6b7280;
    font-weight: 400;
}

.total-row span:last-child {
    color: #1f2937;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.final-total {
    border-top: 2px solid rgba(139, 115, 85, 0.2);
    padding-top: 1rem;
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.final-total span {
    color: #1f2937;
    font-family: 'Playfair Display', serif;
}

/* Enhanced Security Badge */
.security-badge {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    color: #065f46;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(5, 150, 105, 0.2);
    text-align: center;
    justify-content: center;
}

.security-badge .lock-icon {
    margin-right: 0.5rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .order-summary {
        position: static;
    }

    .checkout-main {
        padding: 2rem 0;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .checkout-forms h1 {
        font-size: 2.2rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .form-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .form-section h3 {
        font-size: 1.2rem;
    }

    .summary-card {
        padding: 2rem;
    }

    .item-image {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-right: 1rem;
    }

    .complete-order-btn {
        padding: 1rem;
        font-size: 1rem;
    }

    .digital-wallet-button {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }

    .checkout-forms h1 {
        font-size: 1.8rem;
    }

    .form-section {
        padding: 1.25rem;
    }

    .summary-card {
        padding: 1.5rem;
    }

    .payment-divider {
        margin: 1.5rem 0;
    }

    .secure-badge {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}