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

.pay-button:disabled {
    background-color: #333;
    color: #666;
    cursor: not-allowed;
    opacity: 0.7;
}

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

/* --- Promo Code Section --- */
.promo-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed #333;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.promo-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.promo-yes-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.promo-yes-btn:hover {
    background: var(--accent-color);
    color: white;
}

.promo-input-area {
    display: flex;
    gap: 10px;
    animation: fadeInSlide 0.3s ease forwards;
}

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

.promo-apply-btn {
    background: #333;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
}

.promo-apply-btn:hover {
    background: #444;
}

.promo-message {
    font-size: 0.8rem;
    margin-top: 8px;
    font-weight: 600;
}

.promo-message.success { color: var(--success-color); }
.promo-message.error { color: var(--error-color); }

/* --- Summary Discount Style --- */
.price-row.discount {
    color: var(--success-color);
    font-weight: 600;
}

/* --- Rachel's Brand Theme --- */
body.rachels-theme {
    background-color: #0D0D0D;
    padding: 0 !important; /* Set padding to 0 for bleed full-width header/footer */
    --bg-color: #0D0D0D;
    --card-bg: #161616;
    --input-bg: #222222;
    --border-color: #2c2c2c;
    --accent-color: #FFFFFF; /* Pure White */
    --accent-hover: #e6e6e6; /* Off-white */
    --accent-glow: 0 0 25px rgba(255, 255, 255, 0.06); /* Luxury White Glow */
}

body.rachels-theme .checkout-container {
    padding: 40px 20px !important; /* Adds padding back to form container */
}

body.rachels-theme a {
    color: #FFFFFF !important; /* White links */
    text-decoration: underline;
}

/* --- Desktop Rachel's Header --- */
body.rachels-theme .custom-brand-header-desktop {
    display: flex !important; /* Force display */
    justify-content: center;
    background-color: #000000;
    width: 100%;
    border-bottom: 1px solid #1a1a1a;
}

body.rachels-theme .custom-brand-header-desktop img {
    width: 100%;
    max-width: 1400px;
    height: auto;
    display: block;
}

/* --- Mobile Rachel's Header --- */
body.rachels-theme .website-header-mobile {
    display: none;
    background-color: #000;
    border-bottom: 1px solid #1a1a1a;
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.rachels-theme .mobile-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    height: 65px;
    width: 100%;
}

body.rachels-theme .mobile-logo {
    display: block !important;
}

body.rachels-theme .mobile-logo-img {
    height: 38px;
    width: auto;
    display: block;
    object-fit: contain;
}

body.rachels-theme .mobile-hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 5px;
}

body.rachels-theme .mobile-hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #FFFFFF !important; /* Pure White */
    transition: all 0.3s ease;
}

/* Sliding Sidebar Drawer Menu */
body.rachels-theme .mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

body.rachels-theme .mobile-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.rachels-theme .mobile-sidebar-menu {
    position: fixed;
    top: 0;
    right: -340px !important; /* Move fully off-screen */
    width: 300px !important;
    height: 100%;
    background-color: #0D0D0D;
    border-left: 1px solid #1a1a1a;
    z-index: 2000;
    padding: 30px 20px !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box !important; /* Prevent padding from expanding actual width */
    transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.rachels-theme .mobile-sidebar-menu.active {
    right: 0 !important;
}

body.rachels-theme .mobile-sidebar-menu.active {
    right: 0;
}

body.rachels-theme .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 15px;
    border-bottom: 1px solid #222;
}

body.rachels-theme .sidebar-logo {
    display: block !important;
}

body.rachels-theme .sidebar-logo-img {
    height: 42px;
    width: auto;
    display: block;
    object-fit: contain;
}

body.rachels-theme .close-sidebar-btn {
    background: none;
    border: none;
    color: var(--accent-color); /* Gold */
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
}

body.rachels-theme .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

body.rachels-theme .sidebar-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 5px 0;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

body.rachels-theme .sidebar-link:hover, body.rachels-theme .sidebar-link.active {
    color: var(--accent-color); /* Gold */
    padding-left: 5px;
}

/* --- Responsive Layout Switches --- */
@media (max-width: 768px) {
    body.rachels-theme .custom-brand-header-desktop {
        display: none !important;
    }
    body.rachels-theme .website-header-mobile {
        display: block !important;
    }
}

/* --- Rachel's Footer --- */
body.rachels-theme .custom-brand-footer {
    display: flex !important; /* Force display */
    justify-content: center;
    background-color: #000000;
    width: 100%;
    border-top: 1px solid #1a1a1a;
    margin-top: 40px;
}

body.rachels-theme .custom-brand-footer img {
    width: 100%;
    max-width: 1400px;
    height: auto;
    display: block;
}

/* Default state for custom header and footer elements: completely hidden */
.custom-brand-header-desktop,
.website-header-mobile,
.mobile-sidebar-overlay,
.mobile-sidebar-menu,
.custom-brand-footer {
    display: none;
}

/* Hide Peppermint Hippo specific logos or change them when in Rachel's theme */
body.rachels-theme .brand-logo,
body.rachels-theme .os-logo,
.rachels-theme .brand-logo,
.rachels-theme .os-logo {
    display: none !important;
}

body.rachels-theme .agreements-section {
    border-color: #2c2c2c !important;
}

body.rachels-theme .agreement-item input[type="checkbox"] {
    accent-color: #FFFFFF !important;
}

body.rachels-theme .location-badge {
    background-color: #FFFFFF !important; /* Pure White location badge */
    color: #000000 !important; /* Black text */
}

/* --- Rachel's Custom White Shadows & Focus Glow Overrides --- */
body.rachels-theme .form-section, 
body.rachels-theme .summary-card {
    box-shadow: var(--shadow-soft), var(--accent-glow) !important;
}

body.rachels-theme input:focus, 
body.rachels-theme select:focus {
    border-color: #FFFFFF !important; /* White border */
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15) !important; /* White focus glow */
}

/* --- Rachel's Demo Promo Notice --- */
.rachels-demo-promo-notice {
    display: none;
    color: #888888; /* Silver/Grey text */
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 10px;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
}

body.rachels-theme .rachels-demo-promo-notice {
    display: block !important;
}

/* --- Rachel's Premium White Monochrome Layout Elements Overrides --- */
body.rachels-theme .step-num {
    background-color: #FFFFFF !important;
    color: #000000 !important; /* Black step number inside white circle */
}

body.rachels-theme .pay-button {
    background-color: #FFFFFF !important;
    color: #000000 !important; /* Black bold text on white submit button */
}

body.rachels-theme .pay-button:hover {
    background-color: #E6E6E6 !important; /* Elegant off-white hover */
}

body.rachels-theme .bottom-recap {
    border-left-color: #FFFFFF !important; /* White recap left accent line */
}

body.rachels-theme .package-info h4 {
    color: #FFFFFF !important; /* White package title in summary */
}

body.rachels-theme .promo-yes-btn {
    border-color: #FFFFFF !important;
    color: #FFFFFF !important;
}

body.rachels-theme .promo-yes-btn:hover {
    background-color: #FFFFFF !important;
    color: #000000 !important;
}

body.rachels-theme .close-sidebar-btn {
    color: #FFFFFF !important; /* White close button inside mobile drawer */
}

body.rachels-theme .sidebar-link:hover, 
body.rachels-theme .sidebar-link.active {
    color: #FFFFFF !important; /* White sidebar links on hover/active */
}

/* --- Rachel's Custom Upsell Modal Overrides --- */
body.rachels-theme .upsell-backdrop {
    align-items: flex-end !important; /* Force bottom sheet alignment! */
}

body.rachels-theme .upsell-card {
    background-color: #121212 !important;
    border: 1px solid #222 !important;
    border-bottom: none !important;
    border-radius: 24px 24px 0 0 !important; /* Premium rounded top drawer */
    color: #FFFFFF !important;
    width: 100% !important;
    max-width: 550px !important;
    padding: 20px 30px 40px 30px !important;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.rachels-theme .upsell-backdrop.visible .upsell-card {
    transform: translateY(0) !important; /* Smooth slide up! */
}

/* Premium Pull Drawer Handle Line */
body.rachels-theme .upsell-card::before {
    content: "";
    width: 50px;
    height: 5px;
    background-color: #2c2c2c;
    border-radius: 10px;
    margin: 0 auto 20px auto;
    display: block;
}

body.rachels-theme .upsell-title {
    color: #FFFFFF !important;
}

body.rachels-theme .upsell-subtitle {
    color: #888888 !important;
    font-size: 0.82rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
}

body.rachels-theme .upsell-current-card,
body.rachels-theme .upsell-next-card {
    background-color: #1c1c1c !important;
    border-color: #2c2c2c !important;
    color: #FFFFFF !important;
}

body.rachels-theme .upsell-current-card h4,
body.rachels-theme .upsell-next-card h4 {
    color: #FFFFFF !important;
}

body.rachels-theme .upgrade-total-comparison {
    border-color: #2c2c2c !important;
}

body.rachels-theme #upsell-upgrade-btn {
    background-color: #FFFFFF !important;
    color: #000000 !important; /* Bold black text on white button */
    border: 1px solid #FFFFFF !important;
}

body.rachels-theme #upsell-upgrade-btn:hover {
    background-color: #E6E6E6 !important;
}

body.rachels-theme #upsell-decline-btn {
    color: #888888 !important;
    border-color: #2c2c2c !important;
}

body.rachels-theme #upsell-decline-btn:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #FFFFFF !important;
}

body.rachels-theme .legal-content h2 {
    color: #FFFFFF !important;
}

/* Embed mode overrides to hide header and footer */
.embed-mode .custom-brand-header-desktop,
.embed-mode .website-header-mobile,
.embed-mode .custom-brand-footer {
    display: none !important;
}
.embed-mode body {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.embed-mode .checkout-container {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}