/* Main Content */
.main-content {
max-width: fit-content;
margin: 0 auto;
padding: 32px 24px;
}
h1 {
font-family: var(--ff-label);
font-size: 2.4rem;
line-height: 1.1;
text-align: center;
margin-bottom: 32px;
color: var(--clr-dark);
}

/* Presets - Full width top */
.presets-wrapper {
margin-bottom: 40px;
position: relative;
}
.presets-wrapper::before,
.presets-wrapper::after {
content: '';
position: absolute;
top: 12px;
bottom: 24px;
width: 60px;
z-index: 2;
pointer-events: none;
}
.presets-wrapper::before {
left: 0;
background: linear-gradient(to right, var(--clr-cream), transparent);
}
.presets-wrapper::after {
right: 0;
background: linear-gradient(to left, var(--clr-cream), transparent);
}
.presets,
.presets-mobile {
display: flex;
gap: 16px;
overflow-x: auto;
padding: 12px 0 24px;
scroll-snap-type: x mandatory;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
}
.presets::-webkit-scrollbar,
.presets-mobile::-webkit-scrollbar {
display: none;
}

.preset-card {
flex: 0 0 13.27%;
border-radius: 24px;
overflow: hidden;
box-shadow: 0 8px 24px rgba(43, 34, 23, 0.12);
cursor: pointer;
transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.preset-card:hover {
transform: translateY(-6px);
box-shadow: 0 16px 40px rgba(43, 34, 23, 0.18);
}
.preset-card img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}

/* Mobile: Second row (scrolled to end) */
.presets-mobile {
display: none;
}

/* Desktop Two-Column */
.workspace {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 40px;
}

/* Left Column - Inputs */
.input-panel {
background: var(--clr-white);
border-radius: 24px;
padding: 32px;
box-shadow: var(--shadow-soft);
border: 3px solid var(--clr-primary);
}
.factor-row {
display: flex;
align-items: center;
gap: 16px;
margin: 24px 0;
}
.factor-input {
flex: 1;
padding: 16px 20px;
border: 3px solid var(--clr-primary);
border-radius: 16px;
font-size: 1.05rem;
background: var(--clr-white);
}
.scale-btn {
background: var(--clr-primary);
color: var(--clr-white);
font-family: var(--ff-label);
font-size: 1.4rem;
padding: 16px 40px;
border: 2px solid var(--clr-primary);
border-radius: 999px;
cursor: pointer;
white-space: nowrap;
font-weight: bold;
box-shadow: var(--shadow-soft);
transition: all 0.2s;
}
.scale-btn:hover {
transform: translateY(-3px);
box-shadow: 0 12px 40px rgba(255, 216, 150, 0.5);
}

.ingredients-table {
width: 100%;
border-collapse: collapse;
margin-top: 8px;
}
.ingredients-table th {
text-align: left;
padding-bottom: 12px;
font-family: var(--ff-label);
color: var(--clr-muted);
}
.ingredients-table td {
padding: 12px 8px;
border-bottom: 2px solid #e8d9b8;
}
.ingredients-table input {
width: 100%;
padding: 10px 14px;
border: 2px solid var(--clr-primary);
border-radius: 12px;
background: var(--clr-white);
}
.add-btn {
color: var(--clr-muted);
font-family: var(--ff-label);
cursor: pointer;
margin-top: 20px;
display: inline-flex;
align-items: center;
gap: 8px;
}

/* Right Column - Results */
.results-panel {
background: var(--clr-white);
border-radius: 24px;
box-shadow: var(--shadow-soft);
position: relative;
display: flex;
align-items: center;
flex-direction:column;
}
.results-panel button {
display: none;
}
.progress {
    display: none;
}
.bake-time {
border: 3px solid var(--clr-primary);
border-radius: 999px;
padding: 10px 24px;
text-align: center;
margin-bottom: 24px;
max-width: fit-content;
}
.bake-text,
.bake-min {
font-size: xx-large;
}
.alarm-clock {
    height: auto;
    width: 200px;
}
.alarm-clock.ringing {
animation: shake 0.5s infinite alternate;
}

@keyframes shake {
    0% {
        transform: rotate(-8deg);
    }
    100% {
        transform: rotate(8deg);
    }
}

/* Mobile Modal */
.mobile-modal {
position: fixed;
inset: 0;
background: rgba(43, 34, 23, 0.7);
display: none;
align-items: flex-end;
z-index: 3000;
}
.mobile-modal.open {
display: flex;
}
.modal-content {
background: var(--clr-white);
width: 100%;
max-height: 85vh;
border-radius: 24px 24px 0 0;
overflow-y: auto;
padding: 24px;
}

/* ===== TABLET ≤ 860px ===== */
@media (max-width: 860px) {
    html,
    body {
        overflow: auto;
    }
    .nav-links {
        display: none;
    }
    nav {
        justify-content: space-between;
    }
    nav {
        padding: 0 16px;
        gap: 12px;
        justify-content: space-between;
    }
    #custom-lang-selector {
        margin-left: 8px;
    }
    .nav-search-input {
        width: 60vw;
        font-size: 0.85rem;
    }
}

/* ===== PHONE ≤ 520px ===== */
@media (max-width: 520px) {
    :root {
        --nav-h: 56px;
    }

    nav {
        padding: 0 0px;
        gap: 8px;
    }
    .nav-search-wrap {
        width: fit-content;
    }
    .nav-search-input {
        width: 60vw;
        font-size: 0.85rem;
    }
    .nav-search-icon {
        width: 15px;
        height: 15px;
        left: 9px;
    }
    #custom-lang-selector > div {
        height: 6vh;
        padding: 4px 10px 4px 6px;
    }
    #current-flag {
        width: 24px;
        height: 24px;
    }

    h1 {
        font-size: large;
    }
    h2 {
        display: none;
    }
    .input-panel {
        display: flex;
        flex-direction: column;
        max-width: fit-content;
        border: 0;
    }
    .workspace {
        display: flex;
        flex-direction: column;
    }
    .preset-card {
        height: 160px;
        flex: 0 0 35%;
    }
    .presets {
        gap: 12px;
    }
    .presets-wrapper-phone {
        display: flex;
    }
    .factor-row {
        flex-direction: column;
        margin: 0 0;
    }
    .factor-input, .scale-btn {
        min-width: 75vw;
    }
    .alarm-clock {
        width: 220px;
        height: 220px;
        margin: 32px auto;
        display: block;
    }
    .presets-mobile {
        display: flex;
        margin-trim: 3vh;
    }
    .progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8vh;
    width: 75vw;
    }
    .progress-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0e6c8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 3px solid white;
    transition: all 0.4s;
    }
    .progress-dot.active {
    background: var(--clr-primary);
    transform: scale(1.2);
    }
    .progress-line {
    flex: 1;
    height: 5px;
    background: #f0e6c8;
    border-radius: 9999px;
    }
    .step {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e8d9b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ff-label);
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 2;
    border: 3px solid var(--clr-primary);
    }
    .step.active {
    background: var(--clr-primary);
    }
    .step.done {
    background: #2b2217;
    color: var(--clr-primary);
    }
}