@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Jost:wght@400;500&display=swap');

/* ---------- Tokens ---------- */
:root {
    --preto: #000;
    --branco: #fff;
    --cinza-100: #f3f3f3;
    --cinza-300: #d9d9d9;
    --cinza-600: #666;
    --texto: #111;

    --fonte-titulo: "Montserrat", sans-serif;
    --fonte-corpo: "Montserrat", sans-serif;

    --pad-pagina: 16px;
    --largura-max: 1200px;
    --altura-header: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--fonte-corpo);
    font-size: 14px;
    line-height: 1.5;
    color: var(--texto);
    background: var(--branco);
}

body.sem-scroll { overflow: hidden; }

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/* ---------- Barra de aviso ---------- */
.aviso {
    background: var(--preto);
    color: var(--branco);
    text-align: center;
    font-size: 12px;
    padding: 16px var(--pad-pagina);
    border-bottom: 1px solid #2a2a2a;
    font-weight: bold;
}

/* ---------- Header ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--altura-header);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 var(--pad-pagina);
    background: var(--preto);
    color: var(--branco);
}

.header__logo {
    /* font-family: "Bodoni Moda", serif; */
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 0.04em;
}

@media(max-width: 768px){
    .header__logo {
        /* font-family: "Bodoni Moda", serif; */
        font-size: 16px;
        font-weight: 300;
        letter-spacing: 0.04em;
    }
}

.header__acoes {
    display: flex;
    justify-content: flex-end;
}

.header__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 0;
    color: var(--branco);
}

.header__btn:first-child { justify-self: start; margin-left: -10px; }

.header__btn:hover { opacity: 0.75; }

/* ---------- Busca ---------- */
.busca {
    position: sticky;
    top: var(--altura-header);
    z-index: 29;
    display: flex;
    gap: 8px;
    padding: 12px var(--pad-pagina);
    background: var(--preto);
    border-top: 1px solid #2a2a2a;
}

.busca input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    font: inherit;
    color: var(--branco);
    background: transparent;
    border: 1px solid #555;
    border-radius: 0;
    outline: none;
}

.busca input::placeholder { color: #999; }

.busca button {
    height: 42px;
    font-size: 13px;
    padding: 0 20px;
    background: var(--branco);
    color: var(--preto);
    border: 0;
    font-weight: 500;
}

/* ---------- Menu lateral ---------- */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.overlay.is-aberto { opacity: 1; }

.menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    width: min(320px, 85vw);
    display: flex;
    flex-direction: column;
    padding: 72px 28px 28px;
    background: var(--preto);
    color: var(--branco);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

.menu.is-aberto {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.3s ease;
}

.menu a {
    padding: 14px 0;
    font-family: var(--fonte-titulo);
    font-size: 14px;
    border-bottom: 1px solid #2a2a2a;
}

.menu a:hover { opacity: 0.7; }

.menu__fechar {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 44px;
    height: 44px;
    background: none;
    border: 0;
    font-size: 32px;
    line-height: 1;
    color: var(--branco);
}

/* ---------- Banner arrastavel (70% da altura) ---------- */
.banner {
    background-image: url(./banners/banner_desktop.png);
    height: 60vh;
    background-size: cover;
    background-position: center;
}

/* ---------- Secoes de categoria ---------- */
.categoria {
    max-width: var(--largura-max);
    margin: 0 auto;
    padding: 48px 0 0;
}

.categoria__topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 var(--pad-pagina);
    margin-bottom: 18px;
}

.categoria__topo h2 {
    margin: 0;
    font-family: var(--fonte-titulo);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.1;
}

.categoria__topo a {
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none;
}

.categoria__topo a:hover { opacity: 0.6; }

/* ---------- Carrossel de cards ---------- */
.carrossel {
    display: flex;
    gap: 14px;
    padding: 0 var(--pad-pagina) 4px;
    overflow-x: auto;
    scrollbar-width: none;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
}

.carrossel::-webkit-scrollbar { display: none; }

.carrossel.is-arrastando {
    cursor: grabbing;
    user-select: none;
}

/* evita clique no link ao terminar de arrastar */
.carrossel.is-arrastando .card { pointer-events: none; }

.card {
    flex: 0 0 clamp(160px, 44vw, 230px);
    display: block;
}

.card__img {
    object-fit: contain;
    overflow: hidden;
    width: 100%;
    background-color: red;
    border-bottom: 1px solid rgb(204, 204, 204);
}

.card__img img {
    transition: transform 0.4s ease;
}

.card:hover .card__img img { transform: scale(1.04); }

.card__nome {
    margin: 12px 0 2px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
}

.card__preco {
    margin: 0;
    font-size: 15px;
    color: var(--cinza-600);
}

/* ---------- Marcas (infinito e continuo) ---------- */
.marcas {
    max-width: var(--largura-max);
    margin: 0 auto;
    padding: 18px 0;
}

.marcas h2 {
    margin: 0 0 24px;
    padding: 0 var(--pad-pagina);
    text-align: center;
    font-family: var(--fonte-titulo);
    font-size: 34px;
    font-weight: 600;
    line-height: 1.1;
}

.marcas__janela {
    overflow: hidden;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
}

.marcas__janela.is-arrastando { cursor: grabbing; }

.marcas__trilho {
    display: flex;
    width: max-content;
    will-change: transform;
}

.marcas__item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    margin-right: 24px;
    padding: 14px;
    border-radius: 50%;
    background: var(--branco);
}

.marcas__item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(1);
}

/* ---------- Footer ---------- */
.footer {
    padding: 24px var(--pad-pagina);
    text-align: center;
    font-size: 13px;
    color: var(--branco);
    background: var(--preto);
    margin-top: 80px;
}

.footer p { margin: 0; }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
    :root {
        --pad-pagina: 32px;
        --altura-header: 72px;
    }

    .categoria { 
        padding: 64px 0; 
    }

    .categoria__topo h2,
    .marcas h2 { font-size: 28px; }

    .carrossel { gap: 20px; }

    .card { 
        flex-basis: 240px;
    }

    .marcas__item {
        width: 120px;
        height: 120px;
        margin-right: 32px;
    }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ---------- Contador do carrinho ---------- */
.header__carrinho { position: relative; }

.header__badge {
    position: absolute;
    top: 4px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--branco);
    color: var(--preto);
    font-size: 11px;
    font-weight: 500;
    line-height: 18px;
    text-align: center;
}

/* ---------- Card como botao ---------- */
button.card {
    margin: 0;
    border: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    background-color: rgb(255, 255, 255);
}

.card__img,
.card__nome,
.card__preco { display: block; }

/* ---------- Modal do produto ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal__fundo {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.modal__caixa {
    position: relative;
    width: 100%;
    border-radius: 4px;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--branco);
    animation: modal-sobe 0.25s ease;
}

@keyframes modal-sobe {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.modal__fechar {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    background: rgba(255, 255, 255, 0.9);
    font-size: 28px;
    line-height: 1;
}

.modal__img {
    aspect-ratio: 1 / 1;
    max-height: 42vh;
    width: 100%;
    background-color: white;
    display: flex;
    align-items: Center;
    justify-content: center;
}

.modal__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal__corpo { padding: 20px var(--pad-pagina) 24px; }

.modal__titulo {
    margin: 0 0 16px;
    font-family: var(--fonte-titulo);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.1;
}

.modal__rotulo {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--cinza-600);
}

.modal__variacoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal__variacao {
    min-height: 44px;
    padding: 0 18px;
    background: var(--branco);
    color: var(--preto);
    border: 1px solid var(--preto);
    border-radius: 4px;
}

.modal__variacao:hover { background: var(--cinza-100); }

.modal__variacao.is-ativa,
.modal__variacao.is-ativa:hover {
    background: var(--preto);
    color: var(--branco);
}

.modal__preco {
    margin: 20px 0 4px;
    font-family: var(--fonte-titulo);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.1;
}

.modal__erro {
    margin: 8px 0 0;
    font-size: 14px;
    color: #b00020;
}

.modal__add {
    width: 100%;
    height: 52px;
    margin-top: 16px;
    background: var(--preto);
    color: var(--branco);
    border: 0;
    font-weight: 500;
    border-radius: 4px;
}

.modal__add:hover { opacity: 0.85; }

.modal__add:disabled { opacity: 0.7; cursor: default; }

@media (min-width: 768px) {
    .modal {
        align-items: center;
        padding: 32px;
    }

    .modal__caixa {
        display: grid;
        grid-template-columns: 1fr 1fr;
        max-width: 860px;
        max-height: 90vh;
    }

    .modal__img {
        aspect-ratio: auto;
        max-height: none;
        min-height: 420px;
    }

    .modal__corpo {
        align-self: center;
        padding: 40px 32px 32px;
    }
}