:root {
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --primary: #10b981;
    --primary-dark: #059669;
    --dark: #1e293b;
    --gray: #64748b;
    --border: #e2e8f0;
    --bg-body: #f8fafc;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -1px rgb(0 0 0 / 0.03);
    --radius: 12px;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-main);
    color: var(--dark);
    margin: 0;
}

/* Layout & Spacing */
.checkout-section {
    padding: 50px 0;
}

.checkout-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.checkout-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px 40px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

/* Header & Steps */
.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.step-nav {
    display: flex;
    gap: 48px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #94a3b8;
}

.step-item.active { color: var(--primary); }
.step-item.completed { color: var(--dark); }

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}

.step-item.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.step-item.completed .step-circle {
    background: var(--dark);
    border-color: var(--dark);
    color: var(--white);
}

/* Main Grid Layout */
.checkout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Left Column Cards */
.main-content-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: var(--dark);
}

.page-desc {
    color: var(--gray);
    font-size: 15px;
    margin-bottom: 32px;
}

/* Cart Items */
.cart-item {
    display: flex;
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
    background: #ffffff;
    transition: all 0.2s;
}

.cart-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.item-icon {
    width: 56px;
    height: 56px;
    background: #ecfdf5;
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.item-info { flex: 1; }

.item-name {
    font-weight: 700;
    font-size: 17px;
    color: var(--dark);
    margin-bottom: 6px;
}

.item-sub {
    font-size: 14px;
    color: var(--gray);
    display: flex;
    gap: 16px;
}

.item-price-block {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.price-tag {
    font-weight: 800;
    font-size: 19px;
    color: var(--dark);
}

.remove-link {
    font-size: 13px;
    color: #ef4444;
    text-decoration: none;
    font-weight: 500;
}

/* Summary Card */
.summary-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    position: sticky;
    top: 30px;
    box-shadow: var(--shadow);
}

.summary-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--dark);
}

/* Mini Product Sidebar */
.mini-product-list {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px dashed var(--border);
}

.mini-product {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.mini-product:last-child { margin-bottom: 0; }

.mini-thumb {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 16px;
}

.mini-details { flex: 1; }

.mini-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.3;
}

.mini-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
}

/* Totals & Buttons */
.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    color: var(--gray);
    margin-bottom: 14px;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-weight: 800;
    font-size: 20px;
    color: var(--dark);
}

.btn-main {
    display: block;
    width: 100%;
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    margin-top: 24px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-main:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Back Button Style */
.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s;
}

.btn-back:hover {
    color: var(--dark);
    background: #f1f5f9;
}

.trust-badge {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.input-group { margin-bottom: 24px; }

.label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    background: #f8fafc;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Payment Selection */
.payment-list { display: grid; gap: 16px; }

.pay-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
}

.pay-option-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-grow: 1;
}

/* Adjust gap between radio and text to match the image spacing */
.pay-option-info {
    gap: 10px;
}

.pay-option:hover {
    border-color: var(--primary);
    background: var(--white);
}

.pay-option.selected {
    border-color: var(--primary);
    background: #ecfdf5;
    box-shadow: 0 0 0 1px var(--primary);
}

.pay-radio {
    accent-color: var(--primary);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Dynamic Payment Form Fields & Stripe Styling */

.payment-fields-wrapper {
    margin-top: 24px;
    min-height: 100px;
}

.payment-form-container {
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    transition: all 0.3s ease;
}

/* Stripe specific grouping and layout */
.stripe-input-group {
    margin-bottom: 20px;
}

.stripe-input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

/* Style for the container where Stripe elements are mounted (e.g., card-number-element) */
.stripe-element-style {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    background: #f8fafc;
    min-height: 44px; 
    display: flex; 
    align-items: center; 
}

.stripe-element-style:focus-within {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.stripe-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.stripe-icon-lock {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
    font-size: 14px;
    margin-top: 10px;
    font-weight: 500;
}

.border-dashed {
    border: 2px dashed #cbd5e1 !important;
    background: #f8fafc !important;
    padding: 20px !important;
}

/* Success Page Specifics */
.success-container {
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
}

.success-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 48px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.check-icon {
    width: 80px;
    height: 80px;
    background: #dcfce7;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 32px;
}

.access-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 16px;
}

.note-text {
    font-size: 14px;
    color: var(--gray);
    margin-top: 24px;
    line-height: 1.5;
    background: #f1f5f9;
    padding: 10px 16px;
    border-radius: 8px;
    display: inline-block;
}

.note-text a {
    color: var(--dark);
    text-decoration: underline;
    font-weight: 600;
}
/* Premium Error Notification Block */
.error-notification {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background-color: #fef2f2; /* Soft Premium Red */
    border: 1px solid #fecaca; /* Subtle Red Border */
    padding: 20px;
    border-radius: 12px; /* Matches card radius */
    margin-bottom: 32px;
}

.error-icon-wrapper {
    background: #ef4444; /* Solid Red */
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 2px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.error-content {
    flex: 1;
}

.error-title {
    font-size: 15px;
    font-weight: 700;
    color: #991b1b; 
    margin: 0 0 4px 0;
}

.error-msg {
    font-size: 14px;
    color: #b91c1c;
    margin: 0;
    line-height: 1.5;
}

/* Field Validation Error Styling */
.input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.error-message {
    font-size: 13px;
    color: #ef4444;
    margin-top: 6px;
    font-weight: 500;
}
/* Utilities */
.fade-in { animation: fadeIn 0.4s ease-out; }

/* Stripe Real-time Error Alert */
#card-errors {
    display: none;
    align-items: center;
    gap: 10px;
    background-color: #fff1f2;
    border: 1px solid #e11d48;
    color: #be123c;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
    animation: slideDown 0.2s ease-out;
}

#card-errors i {
    font-size: 16px;
    color: #e11d48;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Error state for the input container itself */
.stripe-element-style.StripeElement--invalid {
    border-color: #e11d48;
    background-color: #fff1f2;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive adjustments */
@media (max-width: 900px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .step-nav { gap: 20px; }
    .step-nav span { display: none; }
    .checkout-card { padding: 20px 25px; }
    .main-content-card { padding: 30px; }
    .summary-card { position: static; margin-top: 30px; }
}

@media (max-width: 600px) {
    .form-row, .stripe-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .pay-option { padding: 16px; }
}