@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root{
 --red:#ea1d2c;
 --dark:#2e2e2e;
 --gray:#f7f7f7;
}

*{
 box-sizing:border-box;
}

body{
 margin:0;
 font-family:'Poppins',sans-serif;
 background:var(--gray);
 color:var(--dark);
}

/* HEADER */
header{
 background:#fff;
 padding:15px 25px;
 display:flex;
 align-items:center;
 gap:10px;
 box-shadow:0 2px 10px rgba(0,0,0,.08);
 position:sticky;
 top:0;
 z-index:10;
}

header img{
 height:40px;
}

header h1{
 font-size:22px;
 margin:0;
}

/* MENU DE CATEGORIAS */
.categorias-menu{
 position:sticky;
 top:70px;
 background:#fff;
 display:flex;
 gap:10px;
 overflow-x:auto;
 padding:12px 15px;
 border-bottom:1px solid #eee;
 z-index:9;
}

.categorias-menu a{
 white-space:nowrap;
 padding:15px 28px;
 background:#f3f3f3;
 border-radius:20px;
 text-decoration:none;
 color:#333;
 font-size:18px;
 font-weight:500;
 transition:.2s;
}

.categorias-menu a:hover{
 background:var(--red);
 color:#fff;
}

/* CONTAINER */
.container{
 max-width:1200px;
 margin:auto;
 padding:25px;
}

/* TITULO CATEGORIA */
.categoria-titulo{
 margin:30px 0 15px;
 font-size:20px;
 font-weight:600;
}

/* GRID PRODUTOS */
.produtos{
 display:grid;
 grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
 gap:20px;
}

/* CARD */
.card{
 background:#fff;
 border-radius:16px;
 overflow:hidden;
 box-shadow:0 6px 18px rgba(0,0,0,.08);
 transition:.25s;
 display:flex;
 flex-direction:column;
}

.card:hover{
 transform:translateY(-5px);
}

.card img{
 width:100%;
 height:230px;
 object-fit:cover;
}

/* CONTEÚDO CARD */
.card-body{
 padding:12px;
 display:flex;
 flex-direction:column;
 gap:6px;
 flex:1;
}

.card-body h3{
 margin:0;
 font-size:22px;
}

.card-body p{
 margin:0;
 font-size:13px;
 color:#666;
}

.preco{
 font-weight:600;
 font-size:22px;
 margin-top:auto;
 min-width:70px;
 text-align:left;
}

/* BOTÃO */
.card button{
 background:var(--red);
 color:#fff;
 border:none;
 padding:20px;
 border-radius:10px;
 cursor:pointer;
 font-weight:500;
 margin-top:8px;
 font-size: 28px;
}

.card button:hover{
 opacity:.9;
}

/* CARRINHO */
.carrinho{
 position:fixed;
 bottom:20px;
 right:20px;
 background:#fff;
 width:300px;
 max-height:420px;
 border-radius:18px;
 box-shadow:0 10px 30px rgba(0,0,0,.2);
 display:flex;
 flex-direction:column;
 overflow:hidden;
}

.carrinho h2{
 background:var(--red);
 color:#fff;
 margin:0;
 padding:12px;
 font-size:16px;
}

.carrinho textarea{
 flex:1;
 border:none;
 padding:10px;
 resize:none;
}

.carrinho button{
 border:none;
 background:var(--red);
 color:#fff;
 padding:14px;
 font-size:15px;
 cursor:pointer;
}

/* SCROLL SUAVE */
html{
 scroll-behavior:smooth;
}

.container{
 padding-bottom: 120px; /* espaço pro botão flutuante */
}

/* BOTÃO SACOLA */
.btn-carrinho{
 position: fixed;
 bottom: 20px;
 left: 50%;
 transform: translateX(-50%);
 background: #ea1d2c;
 color: #fff;
 border: none;
 padding: 15px 30px;
 border-radius: 30px;
 font-size: 30px;
 z-index: 1000;
 box-shadow: 0 8px 20px rgba(0,0,0,.25);
}


/* FUNDO ESCURO */
.overlay{
 position:fixed;
 inset:0;
 background:rgba(0,0,0,.4);
 opacity:0;
 pointer-events:none;
 transition:.3s;
 z-index:19;
}

.overlay.ativo{
 opacity:1;
 pointer-events:auto;
}

/* BOTTOM SHEET */
.bottom-sheet{
 position:fixed;
 bottom:-100%;
 left:0;
 right:0;
 background:#fff;
 border-radius:20px 20px 0 0;
 height:60vh;
 padding:15px;
 transition:.35s;
 z-index:20;
 display:flex;
 flex-direction:column;
}

.bottom-sheet.ativo{
 bottom:0;
}

/* PUXADOR */
.sheet-header{
 display:flex;
 justify-content:center;
 margin-bottom:10px;
}

.sheet-header span{
 width:50px;
 height:5px;
 background:#ccc;
 border-radius:10px;
}

/* CONTEÚDO */
.bottom-sheet h2{
 margin:10px 0;
 font-size:18px;
}

.bottom-sheet textarea{
 flex:1;
 border:1px solid #ddd;
 padding:10px;
 resize:none;
 border-radius:10px;
}

.bottom-sheet button{
 margin-top:10px;
 background:#ea1d2c;
 color:#fff;
 border:none;
 padding:14px;
 border-radius:12px;
 font-size:15px;
 cursor:pointer;
}

.lista-carrinho{
 flex:1;
 overflow-y:auto;
}

.item{
 display:flex;
 align-items:center;
 justify-content:space-between;
 border-bottom:1px solid #eee;
 padding:10px 0;
 font-size:14px;
}

.item .nome{
 flex:1;
}

.controle{
 display:flex;
 align-items:center;
 gap:8px;
}

.controle button{
 width:28px;
 height:28px;
 border:none;
 background:#ea1d2c;
 color:#fff;
 border-radius:50%;
 font-size:16px;
 cursor:pointer;
}

.total{
 padding:10px 0;
 font-size:16px;
 border-top:2px solid #ddd;
 margin-top:5px;
}

/* --- ESTILOS DO CARRINHO --- */
.topo-carrinho {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.topo-carrinho h2 {
    font-size: 24px;
    margin: 0;
}

.topo-carrinho a {
    font-size: 30px;
    text-decoration: none;
    color: var(--red);
    font-weight: bold;
}

/* ITENS DO CARRINHO */
.item {
    display: flex;
    gap: 50px;
    background: #fff;
    margin: 15px;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.item img {
    width: 210px;
    height: 210px;
    border-radius: 25px;
    object-fit: cover;
}

.item .info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item .info strong {
    font-size: 26px;
}

.item .info span {
    font-size: 26px;
    color: #555;
}

/* OBSERVAÇÃO NO CARRINHO */
.item-obs {
    font-size: 20px;
    font-style: italic;
    color: #ea1d2c;
    margin-top: 5px;
    display: block;
}

/* CONTROLES DE QUANTIDADE NO CARRINHO */
.item .qtd {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 5px;
}

.item .qtd button {
    width: 40px;
    height: 40px;
    font-size: 22px;
    background: #eee;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.item .qtd span {
    font-size: 20px;
    font-weight: 600;
}

/* RODAPÉ E TOTAL */
.rodape-carrinho {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #fff;
    padding: 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
}

.rodape-carrinho .total {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
    border: none;
}

.rodape-carrinho button {
    width: 100%;
    padding: 18px;
    background: #25d366; /* Cor oficial do WhatsApp */
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
}

/* --- CONFIGURAÇÃO BASE DO MODAL --- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-content {
    background: #fff;
    width: 90vw; 
    max-width: 600px; 
    height: auto;
    max-height: 90vh;
    border-radius: 20px;
    padding: 25px;
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    gap: 15px;
}

/* --- ELEMENTOS INTERNOS DO MODAL --- */
.modal-content img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
}

.modal-content h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 5px 0;
}

#modal-preco {
    font-size: 28px;
    color: var(--red);
    font-weight: 700;
    margin: 5px 0;
}

.modal-content p {
    font-size: 18px;
    line-height: 1.5;
    color: #444;
}

/* --- CAMPO DE TEXTO (OBSERVAÇÕES) --- */
.modal-content textarea {
    width: 100%;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #ccc;
    resize: none;
    font-size: 20px !important; /* Letra grande para digitação */
    min-height: 120px;
    flex-grow: 0;
}

.modal-content textarea::placeholder {
    font-size: 18px;
}

/* --- CONTROLES DE QUANTIDADE --- */
.controle-qtd {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin: 15px 0;
}

.controle-qtd button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--red);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.controle-qtd span {
    font-size: 30px;
    font-weight: 700;
}

/* --- BOTÕES DE AÇÃO --- */
.fechar {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 35px;
    font-weight: bold;
    color: #000;
    z-index: 100;
    cursor: pointer;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 35px;
}

.btn-confirmar {
    width: 100%;
    padding: 20px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 15px;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
}

/* --- AJUSTES ESPECÍFICOS PARA CELULAR (MEDIA QUERY) --- */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        padding: 15px;
        gap: 8px;
    }

    .modal-content img {
        height: 180px; /* Diminui a foto no celular para caber tudo */
    }

    .modal-content h3 {
        font-size: 22px;
    }

    #modal-preco {
        font-size: 24px;
    }

    .modal-content textarea {
        min-height: 100px;
        font-size: 18px !important;
    }

    .controle-qtd button {
        width: 40px;
        height: 40px;
    }

    .btn-confirmar {
        padding: 15px;
        font-size: 18px;
    }
}
