:root {
    --bg: #f0e3c8;
    --card: #e0d4be;
    --primary: #3e302d;
    --secondary: #0c0a09;
    --text: #0099ff;
    --muted: #3e302d;
    --border: #3e302d;
}

* {
    box-sizing: border-box;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: linear-gradient(rgb(240, 227, 200), rgb(216, 204, 180));
    position: relative;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background-image: url("bg_pattern.svg");
    background-repeat: repeat;
    background-size: 40vw;
    opacity: 1;

    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.2));
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.2));

    -webkit-mask-composite: destination-in;
    mask-composite: intersect;
    z-index: 0;
}

body>* {
    position: relative;
    z-index: 1;
}


header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #f0e3c8;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

header h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
}

header p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.95;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.1rem 1.25rem 3rem;
}

section {
    margin-bottom: 5rem;
}

.section-title {
    margin-bottom: 0.01rem;
    font-size: 2rem;
    color: var(--primary);
}

.section-subtitle {
    margin-bottom: 1.5rem;
    color: var(--muted);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 0.25rem;
    font-size: 1.3rem;
    color: var(--primary);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.price {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary);
    margin-bottom: 0.75rem;
}

.card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.custom {
    background: #f5a146;
    border: 2px dashed #f0e3c8;
    border-radius: 14px;
    padding: 2rem 1.5rem;
    text-align: center;
}

.custom h2 {
    margin-top: 0;
    color: #f0e3c8;
}

.custom p {
    max-width: 700px;
    margin: 0.75rem auto 0;
    color: #f0e3c8;
}

footer {
    background-color: rgb(62, 48, 45);
    height: 8vh;
    color: rgb(240, 227, 200);
    margin: 0;
    font-size: 2vh;
    padding: 1.5rem;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.footer p {
    background-color: rgb(62, 48, 45);
    height: 8vh;
    color: rgb(240, 227, 200);
    margin: 0;
    font-size: 0.85vh;
    padding: 1.5rem;
    text-align: center;
    align-items: center;
    justify-content: center;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.6rem;
    }
}

.card.selected {
    background: var(--primary);
    color: #f0e3c8;
    transform: scale(1.03);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
}

.card.selected h3,
.card.selected .price,
.card.selected p {
    color: #f0e3c8;
}

.selection-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #df5369;
    color: #f0e3c8;
    padding: 0.9rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.25s ease;
}

.selection-bar.visible {
    transform: translateY(0);
}

.selection-info {
    font-size: 0.95rem;
}

.selection-info strong {
    display: block;
    font-size: 1rem;
}

.selection-button {
    background: #f0e3c8;
    color: #df5369;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.selection-button:active {
    transform: scale(0.96);
}

.hidden-step {
    display: none;
}

.option-card {
    text-align: center;
    cursor: pointer;
}

.option-card h3 {
    margin-bottom: 0.5rem;
}

.option-card.selected {
    background: var(--primary);
    color: #f0e3c8;
    transform: scale(1.03);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
}

.option-card.selected h3,
.option-card.selected p {
    color: #f0e3c8;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2.5rem;
    gap: 1rem;
}

.step-actions button {
    flex: 1;
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #df5369;
    color: #f0e3c8;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

header.header-compact {
    padding: 1.2rem 1.5rem;
}

header.header-compact h1 {
    font-size: 1.4rem;
    margin-bottom: 0;
}

header.header-compact p {
    display: none;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(223, 83, 105, 0.3);
    border-radius: 999px;
    outline: none;
}

/* Trilho preenchido (Chrome, Edge, Safari) */
input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: #9c3a4a;
    border-radius: 999px;
}

/* Botão (thumb) */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #df5369;
    border-radius: 50%;
    margin-top: -7px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.15);
}

/* ===== Firefox ===== */
input[type="range"]::-moz-range-track {
    height: 6px;
    background: #9c3a4a;
    border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #df5369;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

body.finalizing footer {
    display: none;
}

.decor-card.selected {
    background: var(--primary);
    color: #f0e3c8;
    transform: scale(1.02);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.decor-card.selected h3,
.decor-card.selected p {
    color: #f0e3c8;
}


.cake-preview {
    display: flex;
    justify-content: center;
    margin: 3rem 0 1.5rem;
}

#cakeLayers {
    display: flex;
    flex-direction: column-reverse;
    /* base embaixo */
    align-items: center;
    gap: 6px;
}

.layer {
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    transition: width 0.3s ease;
}

/* Massa */
.layer-base {
    background: #3e302d;
    color: #f0e3c8;
}

/* Creme */
.layer-cream {
    background: #d9c3a5;
    color: #3e302d;
}

.builder-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

#customCakeTrigger {
    cursor: pointer;
}

#customCakeTrigger:active {
    transform: scale(0.98);
}