:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --input-bg: #2c2c2c;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #E60023; /* Changed to Premium Red */
    --accent-hover: #b3001b; /* Darker red */
    --border-color: #333333;
    --success-color: #4caf50;
    --error-color: #f44336;
    --font-main: 'Inter', sans-serif;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.5);
    --accent-glow: 0 0 25px rgba(230, 0, 35, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    margin: 0;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

/* --- Container & Grid --- */
.checkout-container {
    max-width: 1100px;
    margin: 0 auto;
}

.secure-badge-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.secure-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success-color);
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(76, 175, 80, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px; /* Form takes rest, Summary is fixed 380px */
    gap: 40px;
    position: relative;
}

/* --- Typography --- */
h2, h3, h4 {
    margin: 0;
    font-weight: 600;
}

h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 15px;
}

p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- Form Sections --- */
.checkout-form-section {
    width: 100%;
}

.form-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft), var(--accent-glow);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.step-num {
    background-color: var(--accent-color);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

/* --- Inputs --- */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

input, select {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.2s ease;
    width: 100%;
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: #333;
    box-shadow: 0 0 0 3px rgba(230, 0, 35, 0.2);
}

input::placeholder {
    color: #555;
}

/* Credit Card Special Styling */
.cc-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.card-icons {
    position: absolute;
    right: 12px;
    display: flex;
    gap: 8px;
}

.card-icon {
    font-size: 0.7rem;
    background: #fff;
    color: #000;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: bold;
    opacity: 0.8;
}

.pci-notice {
    font-size: 0.75rem;
    text-align: center;
    margin-top: 10px;
    color: #666;
}

/* --- Mobile Header (Hidden on Desktop) --- */
/* Mobile preview removed */

/* --- Sticky Summary (Right Side) --- */
.summary-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    position: sticky;
    top: 20px; /* Makes it sticky */
    box-shadow: var(--shadow-soft), var(--accent-glow);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.summary-header h2 {
    font-size: 1.2rem;
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.brand-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.brand-logo {
    height: 50px; /* Reduced from 80px */
    width: auto;
    object-fit: contain;
}

.location-badge {
    background-color: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.package-info h4 {
    color: var(--accent-color);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.package-info p {
    color: #a0a0a0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    white-space: pre-line; /* Respect new lines from the database */
}

.price-breakdown {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333; /* Divider Line Above Prices */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fine-print {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 12px;
    font-style: italic;
}

.savings-highlight {
    display: block;
    font-size: 0.9rem;
    color: var(--success-color); /* Green */
    font-weight: 700;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.price-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 10px 0;
}

.price-row.total {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.pay-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pay-button:hover {
    background-color: var(--accent-hover);
}

/* --- Bottom Recap (Receipt Style) --- */
.bottom-recap {
    background: #1a1a1a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px; /* Space before button */
    border-left: 3px solid var(--accent-color);
    display: block;
    font-size: 0.9rem;
}

.recap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
    font-weight: 600;
    color: var(--text-primary);
}

.recap-total {
    color: var(--accent-color);
    font-size: 1.1rem;
}

.recap-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recap-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    .checkout-grid {
        grid-template-columns: 1fr; /* Stack vertically */
    }

    .order-summary-section {
        order: -1; /* Move summary to top on tablets */
    }

    .summary-card {
        position: static; /* Remove sticky on mobile/tablet if it takes too much vertical space */
    }
}

@media (max-width: 600px) {
    .checkout-container {
        padding: 10px;
    }
    
    .input-grid {
        grid-template-columns: 1fr; /* Full width inputs on mobile */
    }

    .order-summary-section {
        order: -1; /* Move summary to top on mobile too */
        margin-bottom: 20px;
    }

    .package-mobile-preview {
        display: none; 
    }

    /* Mobile specific glow boost */
    .form-section, .summary-card {
        box-shadow: var(--shadow-soft), 0 0 40px rgba(230, 0, 35, 0.45);
    }
}

/* --- Autocomplete Styles --- */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid var(--border-color);
    border-top: none;
    z-index: 1000;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-soft);
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-family: var(--font-main);
    font-size: 0.95rem;
}

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

.autocomplete-item:hover {
    background-color: #333;
    color: var(--text-primary);
    border-left: 3px solid var(--accent-color);
}

.autocomplete-item strong {
    color: var(--accent-color);
    font-weight: 700;
}

.hidden-field {
    display: none !important;
}