:root {
    --bg-color: #000000;
    --card-bg: #111111;
    --input-bg: #222222;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    
    /* New Vegas Theme Colors (From Logo SVG) */
    --accent-color: #fe24f8; /* Neon Pink/Magenta from logo */
    --accent-hover: #d916d3; /* Darker Pink */
    --highlight-blue: #2fa4fb; /* Blue from logo */
    
    --brand-gradient: linear-gradient(135deg, #fe24f8 0%, #2fa4fb 100%);
    
    --border-color: #333333;
    --success-color: #4caf50;
    --error-color: #f44336;
    --font-main: 'Inter', sans-serif;
    --shadow-soft: 0 4px 15px rgba(254, 36, 248, 0.15); /* Pink glow */
}

* {
    box-sizing: border-box;
}

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

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: 1250px; /* Increased from 1100px */
    margin: 0 auto;
}

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

.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);
}

.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;
}

/* --- Dynamic Fields --- */
.hidden-field {
    display: none !important;
}

/* --- Upsell / Stops Styling --- */
.add-stop-btn {
    background: transparent;
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-stop-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(176, 38, 255, 0.05);
}

.plus-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Selected Stop Item */
.stop-item {
    background: #1a1a1a;
    border-left: 3px solid var(--accent-color);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.3s ease;
    cursor: grab; /* Indicate draggable */
    transition: background 0.2s, transform 0.2s;
}

.stop-item:active {
    cursor: grabbing;
}

.stop-item.dragging {
    opacity: 0.4;
    border: 2px dashed #666;
}

.stop-item.drag-over {
    border-top: 2px solid var(--accent-color);
    transform: translateY(2px);
}

.stop-info strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.stop-info small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.remove-stop {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal Styling */
.stops-modal-overlay {
    position: absolute; /* Changed from fixed to absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9); /* Darker opacity (0.9) for better coverage */
    display: none; /* Let JS handle display logic */
    align-items: flex-start; /* Align to top of overlay area */
    justify-content: center;
    flex-direction: column; /* Allow stacking of Summary Card + Modal Content */
    align-items: center;    /* Center them horizontally */
    z-index: 10000; /* Super high z-index to cover everything */
    padding: 20px;
    padding-top: 50px;
    backdrop-filter: blur(5px); /* Optional: nice blur effect for background */
}

.stops-modal-overlay:not(.hidden-field) {
    display: flex;
}

/* New Live Summary Card inside Modal */
.modal-live-summary {
    background: #222; /* Dark card */
    color: #fff;
    width: 100%;
    max-width: 500px;
    margin-bottom: 15px; /* Gap above the white content box */
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--accent-color); /* Subtle accent border */
    text-align: left;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

.live-summary-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.live-summary-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.live-summary-stops-header {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 5px;
    margin-bottom: 5px;
}

.live-summary-stop-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 10px;
    margin-bottom: 4px;
    display: block;
}

.live-summary-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #444;
}


.stops-modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    overflow: hidden;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

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

.stops-header h4 {
    color: var(--text-primary);
    margin: 0;
}

.close-modal, .close-custom-modal {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.stops-options {
    padding: 15px;
    overflow-y: auto;
}

/* Category Headers */
.stops-category-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 15px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    font-weight: 600;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.stops-category-title:first-child {
    margin-top: 0;
}

.stop-option-card {
    background: #222;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stop-option-card:hover {
    border-color: var(--accent-color);
    background: #2a2a2a;
}

.stop-option-card.selected-stop {
    border-color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
}

/* Dashed Placeholder Card */
.add-new-stop-card {
    background: transparent;
    border: 2px dashed #444;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.add-new-stop-card:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(254, 36, 248, 0.05);
}

.add-new-stop-card span {
    font-weight: 600;
    font-size: 1.2rem;
}

.option-details h5 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.option-details p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.option-price {
    text-align: right;
}

.price-tag {
    display: block;
    color: var(--success-color); /* Green for price increase */
    font-weight: bold;
    font-size: 0.95rem;
}

.time-tag {
    display: block;
    color: #ffffff; /* White text as requested */
    font-size: 0.75rem;
    margin-top: 2px;
}

/* --- 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%;
}

/* Specific styling for Select Dropdowns */
select {
    height: 52px; /* Force explicit height to match inputs */
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
}

/* Specific styling for Checkboxes */
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    background-image: none; /* Remove any accidental arrow */
    appearance: auto; /* Let browser handle the checkmark, or custom style */
    -webkit-appearance: auto;
    accent-color: var(--accent-color); /* Browser supported neon color */
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: #333;
    box-shadow: 0 0 0 3px rgba(176, 38, 255, 0.2); /* Purple glow matches accent */
}

/* --- Date & Time Picker Customization --- */
input[type="date"],
input[type="time"] {
    color-scheme: dark; /* Forces iOS/Android/Desktop pickers to be Dark */
    accent-color: var(--accent-color); /* Makes the selection Purple */
}

/* Make the little calendar/clock icon white */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1); /* Turns black icon to white */
    cursor: pointer;
    opacity: 0.8;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Override Browser Autofill Yellow/Blue Background */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--input-bg) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

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;
}

.embed-header {
    display: none; /* Removed from top */
}

/* --- Mobile Header (Hidden on Desktop) --- */
.package-mobile-preview {
    display: none;
}

@media (max-width: 900px) {
    .package-mobile-preview {
        display: block;
        position: sticky;
        top: 10px; /* Small gap from top */
        z-index: 100;
        background: var(--card-bg);
        padding: 15px;
        margin: 0 10px 20px 10px; /* Spaced from edges */
        border: 1px solid var(--accent-color);
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    }

    .m-header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 6px;
    }

    .m-header-details {
        font-size: 0.75rem;
        color: var(--text-secondary);
        display: flex;
        justify-content: space-between;
        border-top: 1px solid #333;
        padding-top: 8px;
        margin-top: 4px;
    }
    
    .m-divider { display: none; }
}

/* --- Mobile Top Mini Card --- */
.package-mobile-preview {
    display: none; /* Hidden on desktop */
    background: var(--card-bg);
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 12px;
    border: 1px solid var(--accent-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.m-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.m-header-top h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.m-total-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.m-header-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #333;
}

.m-divider {
    color: #555;
}

/* --- Mobile Bottom Receipt --- */
.bottom-recap {
    display: none; /* Hidden on desktop */
    background: #1a1a1a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 3px solid var(--accent-color);
}

.recap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.recap-header span:first-child {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

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

.recap-details {
    margin-bottom: 8px;
}

.recap-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.recap-tax-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    border-top: 1px dashed #333;
    padding-top: 8px;
}

@media (max-width: 900px) {
    .package-mobile-preview {
        display: block; /* Show Top Mini Card */
    }
    .bottom-recap {
        display: block; /* Show Bottom Receipt */
    }
}

@media (max-width: 600px) {
    .checkout-container {
        padding: 10px;
    }
    
    .input-grid {
        grid-template-columns: 1fr; 
    }
    /* We removed the .order-summary-section: none rule so the big summary stays visible */
}

/* --- 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);
}

.summary-header h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

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

.package-info p {
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.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: var(--brand-gradient);
    color: white;
    border: none;
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(254, 36, 248, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.pay-button::before {
    content: '';
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2fa4fb 0%, #fe24f8 100%); /* Reversed gradient */
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.pay-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 164, 251, 0.4);
}

.pay-button:hover::before {
    opacity: 1; /* Fade into reversed gradient on hover */
}

/* --- Autocomplete Styling --- */
.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: 0 4px 15px rgba(0,0,0,0.5);
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #222;
    color: var(--text-secondary);
    transition: all 0.2s;
}

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

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

.autocomplete-item strong {
    color: var(--accent-color); /* Highlight match in neon pink/purple */
    font-weight: 700;
}

/* --- 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/mobile */
        display: block; /* Ensure it's visible */
        margin-bottom: 20px;
    }

    .summary-card {
        position: static; /* Remove sticky behavior from the big card on mobile */
    }

    /* Mini Sticky Header (Initially Hidden) */
    .package-mobile-preview {
        display: none; /* Hidden by default, JS toggles to block */
        position: absolute; 
        top: 80px;      
        left: 0;
        right: 0;    
        z-index: 500;
        background: var(--card-bg);
        padding: 15px 20px; 
        border-bottom: 1px solid var(--accent-color); 
        border-radius: 0; 
        box-shadow: 0 5px 20px rgba(0,0,0,0.8);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-100%); 
        transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); 
    }

    /* Dim header when modal is open */
    body.modal-open .package-mobile-preview {
        opacity: 0.3 !important;
        filter: blur(2px);
    }

    .package-mobile-preview.show-sticky-header {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
    
    /* (Existing inner content styles...) */
    .m-header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 6px;
    }

    .m-header-details {
        font-size: 0.75rem;
        color: var(--text-secondary);
        display: flex;
        justify-content: space-between;
        border-top: 1px solid #333;
        padding-top: 8px;
        margin-top: 4px;
    }
    
    .m-divider { display: none; }
}
