:root {
    --ifome-red: #D10000;
    --ifome-cream: #FFF0C4;
    --ifome-graphite: #2F2F2F;
    --ifome-charcoal: #1C1C1C;
    --ifome-white: #FFFFFF;
    --ifome-burgundy: #660B05;
    --ifome-green: #6D9E51;
    
    --font-display: 'Gasoek One', sans-serif;
    --font-script: 'Damion', cursive;
    --font-body: 'Lexend', sans-serif;
}

/* --- GLOBAL SCROLL FIX --- */
html, body {
    max-width: 100vw; /* Forbids the screen from expanding horizontally */
    overflow-x: hidden;
}
html {
    /* This forces the scrollbar track to stay, preventing the UI from "jumping" left/right */
    overflow-y: scroll; 
}
/* 1. THE FATHER CANVAS: The single source of truth */
body {
    background-image: 
        url('images/Padrao.png'), 
        linear-gradient(to right, 
            var(--ifome-burgundy) 0%,   
            var(--ifome-red) 25%,       
            var(--ifome-red) 75%,       
            var(--ifome-burgundy) 100%  
        );
    
    background-position: bottom center, center;
    background-repeat: repeat-x, no-repeat; 
    background-size: 250px, 100% 100%;
    background-attachment: fixed;
    background-blend-mode: soft-light, normal; 
    
    font-family: var(--font-body);
    color: var(--ifome-charcoal);
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    
    /* Ensure body doesn't generate its own scrollbar */
    overflow: visible; 
}


/* 2. THE TRANSPARENT WINDOW */
#app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    height: auto; 
    background-color: transparent; 
    box-shadow: 0 0 60px rgba(209, 0, 0, 0.15); 
    position: relative;
    z-index: 10;
    
    /* THE FIX: This acts as the scissors to cut off the sideways swipe! */
    overflow-x: clip; 
    overflow-y: visible; 
}

/* 3. THE INTERNAL SCREENS */
/* The welcome screen stays transparent to show the Father canvas */
#view-welcome {
    background-color: transparent; 
}

/* The actual ordering screens get painted Cream so they cover the background */
#view-build, #view-cart, #view-checkout {
    background-color: var(--ifome-cream);
    min-height: 100vh;
    position: relative; 
    
    /* Change this! Only hide horizontal overflow for the watermark */
    overflow: visible; 
}

/* View Management */
.view {
    display: none;
    width: 100%;
    /* Let it grow naturally, no internal scrollbars! */
    min-height: 100vh;
    height: auto;
    overflow: visible;
}
.view.active { display: block; animation: fadeIn 0.3s ease-in; }

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

/* Typography Helper Classes */
.font-display { font-family: var(--font-display); }
.font-script { font-family: var(--font-script); }

/* Custom UI Elements */
.ifome-header {
    background-color: var(--ifome-red);
    color: var(--ifome-white);
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.ifome-btn-primary {
    background-color: var(--ifome-red);
    color: var(--ifome-white);
    border-radius: 50px;
    font-weight: 600;
    padding: 15px;
    border: none;
    width: 100%;
    transition: transform 0.2s;
}
.ifome-btn-primary:active { transform: scale(0.98); }
.ifome-btn-primary:disabled { background-color: var(--ifome-graphite); opacity: 0.5; }

.ifome-btn-whatsapp {
    background-color: var(--ifome-green);
}

.option-card {
    background-color: rgba(255, 255, 255, 0.7);
    border: 3px solid transparent;
    border-radius: 20px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}
.option-card.selected {
    background-color: var(--ifome-white);
    border-color: var(--ifome-green);
    box-shadow: 0 4px 15px rgba(209, 0, 0, 0.15);
}

.step-badge {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--ifome-graphite);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}
.step-badge.active { background-color: var(--ifome-green); }

.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
    scrollbar-width: none; /* Firefox */
}
.horizontal-scroll::-webkit-scrollbar { display: none; } /* Chrome */

/* --- RESTORE HORIZONTAL SCROLL FOR EXTRAS --- */
.addons-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px; /* Leaves room for the native scrollbar */
    
    /* Smooth iOS-style snapping */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; 
}

/* Hide the ugly scrollbar track but keep the scroll functionality */
.addons-container::-webkit-scrollbar {
    display: none;
}

.addon-card {
    flex: 0 0 auto; /* This forces them to sit side-by-side and NOT shrink! */
    width: 160px; /* Adjust this if your cards need to be wider/thinner */
    scroll-snap-align: start;
    cursor: pointer;
}
.addon-badge {
    position: absolute;
    top: +10px;
    right: +10px;
    background: var(--ifome-red);
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.floating-bottom {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    padding: 20px;
    background: linear-gradient(to top, var(--ifome-cream) 80%, transparent);
    z-index: 20;
}

/* --- Welcome Screen Background Pattern --- 
#view-welcome {
    position: relative;
    background-color: var(--ifome-red);
}

#view-welcome::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20vh; 
    background-image: url('images/Padrao.png');
    background-repeat: repeat; 
    background-size: 150px;
    opacity: 0.15; 
    z-index: 0;
    pointer-events: none; 
}

 Forces all the content to sit ON TOP of the ghost pattern layer */
#view-welcome > div {
    position: relative;
    z-index: 1;
}


/* --- Horizontal Scrolling Arrows (Desktop Only) --- */
.scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.scroll-arrow {
    position: absolute;
    z-index: 10;
    background-color: var(--ifome-white);
    color: var(--ifome-red);
    border: 2px solid var(--ifome-cream);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.2s;
}

.scroll-arrow:hover {
    background-color: var(--ifome-cream);
    transform: translateY(-50%) scale(1.1);
}

.scroll-left { left: -15px; }
.scroll-right { right: -15px; }

/* Only show arrows if the device has a mouse (hover capability) */
@media (hover: hover) and (pointer: fine) {
    .scroll-wrapper:hover .scroll-arrow {
        display: flex;
    }
}

/* Ensure smooth scrolling when clicking the arrows */
.horizontal-scroll {
    scroll-behavior: smooth; 
    width: 100%;
}

/* =========================================
   MOBILE OVERRIDES (Phones & Small Tablets)
   ========================================= */
@media (max-width: 768px) {
    body {
        /* Kills the gradient, keeps the pattern on a solid red background */
        background-image: url('images/Padrao.png');
        background-color: var(--ifome-red);
        
        /* Keep the pattern anchored nicely at the bottom */
        background-position: bottom center;
        background-repeat: repeat-x;
        background-size: 150px;
    }
}


/* --- Frosted Glass Buttons --- */
.btn-glass {
    /* Mixes your cream color with 15% transparency */
    background-color: color-mix(in srgb, var(--ifome-white) 25%, transparent) !important;
    color: var(--ifome-white) !important;
    
    /* The magic frosted glass blur effect */
    backdrop-filter: blur(6px); 
    -webkit-backdrop-filter: blur(6px); /* For iPhones */
    
    /* An optional subtle border to make the edges pop */
    border: 2px solid #FFFFFF !important;
}

.btn-glass:hover {
    transform: scale(1.02);
    /* background-color: color-mix(in srgb, var(--ifome-white) 95%, transparent) !important; */
    background-color: color-mix(in srgb, var(--ifome-cream) 50%, transparent) !important;
}

/* --- Success Checkmark Animation --- */
@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.success-check {
    color: #6D9E51; /* Bootstrap Success Green */
    font-size: 1.3rem;
    margin-left: 10px;
    animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-text {
    color: #198754;
    font-size: 0.9rem;
    margin-left: 8px;
    font-weight: 600;
    animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* --- Step Transition Animation --- */
@keyframes fadeInSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-content-anim {
    animation: fadeInSlideDown 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* --- SUGGESTIONS MENU --- */
.suggestion-card {
    background-color: var(--ifome-white);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.suggestion-img-placeholder {
    width: 100%;
    height: 180px;
    background-color: #f8fff9; /* Light mint green */
    border: 2px dashed var(--ifome-green);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    overflow: hidden; /* Keeps real images inside the borders */
}