@import url(./login.css);
@import url(./cadastro.css);
@import url(./main.css);

/* global */
*{
    box-sizing: border-box;
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
}

:root{
    --bg: #F5F9F2;
    --bg-sec: #e7e7e7;
    --text-color: #1B1B1B;
    --strange-color: #2F7D32;
    --accent-color: #CE772F;
    --sale: #c90000;
    --saleprice: rgba(153, 153, 153, 0.75);
    --op25: rgba(0, 0, 0, 0.25);

    /* btns */
    --btn-hover: #3eac42;
    --btn-laranja-hover: rgb(233, 133, 52);
    --btn-vermelho-hover: rgb(255, 53, 53);
}

body{
    background-color: var(--bg-sec);
    color: var(--text-color);
    line-height:1.6;
    width: 100%;
    min-height: 100dvh;
    overflow-y: scroll;
    overflow-x: hidden;
    display: grid;
    font-family: 'Nunito', sans-serif;

    grid-template-rows: auto 1fr auto;
    grid-template-areas: 
    "header header header"
    "main main main"
    "footer footer footer";
    padding-top: 65px;
}

h1{
    font-family: 'Poppins', serif;
    font-size: clamp(3rem, 7vw, 8rem);
    text-align: center;
    line-height: 1.3;
    letter-spacing: 0.2rem;
    text-shadow: 5px 4px 4px rgba(0, 0, 0, 0.15);
}

h2{    
    font-family: 'Poppins', serif;
    font-size: clamp(1.8rem, 4vw, 3.75rem);
    text-shadow: 5px 4px 4px rgba(0, 0, 0, 0.15);
}

h3{
    font-family: 'Poppins', serif;
    font-size: clamp(1rem, 1.8vw, 1.5rem);
    text-align: center;
    text-shadow: 5px 4px 4px rgba(0, 0, 0, 0.15);
    font-weight: 300;
    color: var(--text-color);
}

h4{
    margin: 0;
}

p, ul, li{
    font-family: 'Nunito', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.25rem);
    color: var(--text-color);
}

a{
    text-decoration: none;
    color: inherit;
}

/* BOTÕES */
button {
    background: transparent;
    cursor: pointer;
    outline: none;
    border: none;
}

.btn{
    color: var(--bg);
    font-weight: 700; 
    padding: 0.5rem 0.75rem; 
    border-radius: 5px;


    transition: transform .15s ease, box-shadow .15s ease;

    &.verde{ background-color: var(--strange-color);}
    &.laranja{ background-color: var(--accent-color);}
    &.vermelho{ background-color: var(--sale);}
    &.branco{ background-color: var(--bg-sec);}
}

.btn.verde:hover{ 
    transform:translateY(-3px); 
    background-color: var(--btn-hover);
}
.btn.laranja:hover{ 
    transform:translateY(-3px); 
    background-color: var(--btn-laranja-hover);
}
.btn.vermelho:hover{
    transform:translateY(-3px); 
    background-color: var(--btn-vermelho-hover);
}

.label {
    font-weight: 700;
    color: var(--accent-color);
}



/* FIXOS */
nav{
    height: 65px;
    background-color: var(--accent-color);
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.25);

    position: fixed;
    right: 0;
    top: 0;
    z-index: 999;
    width: 100%;

  ul{
    list-style: none;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    gap: 1rem;

    @media (max-width:350px){
        gap: 0.25rem;
    }}

    /* logo */
  li.logoimg{ 
    margin-right: auto;
    img{
        width: 90px;
        height: auto;
        display: block;
    }
  }

    button{
        height: 100%;
        padding: 0 1rem;
        display: flex;
        align-items: center;
        cursor:pointer;
        transition: transform .15s ease, box-shadow .15s ease;
    }

    svg{
        fill: var(--bg)
    }
    
    button:hover{
        transform: translateY(-3px);
        svg{
            fill: var(--strange-color);
        }
    }

        @media (max-width: 900px) {
            button{
            padding: 0 0.5rem;}
    }

/* perfil */
.nav-perfil {
    position: relative;
}

.btn-nav-perfil {
    display: flex;
    align-items: center;
    gap: 0.35rem;

    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
}

.nav-usuario-nome {
    display: inline-block;
    max-width: 90px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.menu-nav-perfil {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 20;

    display: flex;
    flex-direction: column;
    min-width: 210px;
    margin: 0;
    padding: 0.4rem;
    list-style: none;

    background-color: var(--bg);
    border: 1px solid var(--op25);
    border-radius: 8px;
    box-shadow: 2px 2px 6px var(--op25);
}
.menu-nav-perfil[hidden] {
    display: none;
}

.menu-nav-perfil li {
    display: block;
}

.menu-nav-perfil button {
    width: 100%;
    text-align: center;
    padding: 0.55rem 0.6rem;
    margin: 0;

    background: none;
    border: none;
    border-radius: 6px;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.menu-nav-perfil button:hover,
.menu-nav-perfil button:focus-visible {
    background-color: var(--bg-sec);
    outline: none;
}

#btnNavLogout {
    color: var(--sale);
}

.zap {
    position: fixed;
    bottom: 3%;
    right: 3%;
    z-index: 999;
    width: 70px;
    height: 70px;
    display: flex;
    transition: background-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}
.zap:hover{
    transform: translateY(-10px);
}

    /* bolinha do carrinho */
.btn-carrinho {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
}
}

main{
    margin: 0;
    grid-area: main;
    padding: 1rem;
}

footer{
    grid-area: footer;
    display: grid;
    justify-items: start;
    justify-content: center;
    grid-template-columns: 0.4fr 0.6fr 0.6fr 0.6fr;
    gap: 2rem 3rem;
    align-items: start;

    width: 100%;
    margin-inline: auto;
    padding: 0.5rem 1.5rem;
    position: relative;
    z-index: 998;

    background-color: var(--accent-color);

    .logo-footer{
        display: grid;
        gap: 0.75rem;
        justify-items: start;
        img{
        width: clamp(100px, 15vw, 150px);
        height: auto;
        }
        p{
        font-size: 0.85rem;
        max-width: 220px;
        line-height: 1.5;
        }
    }

    ul{
        list-style: none;
        display: grid;
        gap: 0.35rem;

        li{
            font-size: clamp(0.75rem, 1vw, 0.85rem);
            line-height: 1.5;

            span{
                display: block;
                font-weight: 800;
                font-size: clamp(0.9rem, 1vw, 1rem);
                margin-bottom: 0.3rem;
            }
            a{
                text-decoration: underline;
            }
        }
    }

    @media (max-width: 900px) {
        grid-template-columns: 1fr 1fr;
        row-gap: 1.75rem;
        column-gap: 2rem;
        padding: 1rem 1.5rem;
    }

    @media (max-width: 480px) {
        column-gap: 1.25rem;
        row-gap: 1.5rem;
        padding: 0.75rem 1.25rem;

        .logo-footer{
            gap: 0.5rem;
            p{
                font-size: 0.8rem;
            }
        }
    }
}


dialog{
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.15s ease, transform 0.15s ease, overlay 0.15s ease allow-discrete, display 0.15s ease allow-discrete;
    position: fixed;
    align-self: center;
    justify-self: center;
    margin: 1rem;
    border: 3px solid var(--accent-color);
    border-radius: 10px;
    background-color: var(--bg);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 2rem);
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem 1rem;
    scrollbar-width: none;
    box-sizing: border-box;
    box-shadow: 5px 4px 2px rgba(0, 0, 0, 0.15);

    #itemDialog{
        position: relative;
    }

    #dialogNome{
        margin-top: 0.5rem;
        letter-spacing: 1.2px;
        text-transform: uppercase;
        text-align: center;
    }

    #dialogDesc{
    opacity: 0.7;
    font-size: clamp(0.75rem, 1vw, 0.85rem);
    color: var(--text-color);
    padding: 1rem 0;
    text-align: center;
    }

    #dialogPreco{
        color: var(--text-color);
        padding-bottom: 1rem;
        text-align: center;

        .preco{
        text-align: center;
        color: var(--text-color);
        font-weight: 700;
        border-top: 1px solid var(--op25);
        padding-top: 0.25rem;
        font-size: 1.3rem;

        .preco-atual{
        color: var(--sale);
        }

        .preco-antigo{
        text-decoration: line-through;
        color: var(--saleprice);
        opacity: 0.8;
        font-size: clamp(0.6rem, 1vw, 0.8rem);
            }
        }
        }
        #imgDialog{
            display: flex;
            margin: 0 auto;
            position: relative;
            border-radius: 5px;
            max-width: 200px;
            max-height: 200px;
        }
        .badge-desconto{
            position: absolute;
            top: 8%;
            right: 2%;
            padding: 0.25rem 0.5rem;
            border-radius: 10px;
            z-index: 3;
            
            background-color: var(--sale);
            color: var(--bg);
            font-weight: 800;
        }
        .fecharDialog{
            align-self: flex-end;
        }

        .btn{
            &.btn-carrinho{
                display: flex;
                justify-content: center;
                align-items: center;
                margin: 0 auto;
                gap: 5px;
            }
        svg{
            fill: var(--bg);
            display: block;
        }
    } 

    &::backdrop{
        background-color: rgba(0, 0, 0, 0.7);
    }
    &[open]{
        display: flex;
        flex-direction: column;
        opacity: 1;
        transform: scale(1);                
        transition: opacity 0.3s ease, transform 0.3s ease, overlay 0.3s ease allow-discrete, display 0.3s ease allow-discrete;
    }
    }

    @starting-style {
    dialog[open] {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Dialog de detalhes do pedido */
.pedidoDetalhesDialog {
    width: 100%;
    max-width: 480px;

    h2{
        text-align: center;
        margin: 0.5rem 0 1rem;
    }
    h3{
        text-align: left;
        font-weight: 600;
        margin-top: 1rem;
        margin-bottom: 0.35rem;
    }
    ul{
        list-style: disc;
        padding-left: 1.25rem;
        li{
            margin-bottom: 0.25rem;
        }}
}



/* BUSCA */
.caixa-busca{
    width: 80%;
    display: flex;
    margin: 0 auto 1rem;
    align-items: center;
    padding: 0 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: var(--bg);

    .input-busca{
        flex: 1;
        width: 100%;
        min-width: 0;
        border: none;
        outline: none;
        background-color: transparent;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;

        padding: 1rem 0;
        font-size: 1rem;
    }

    svg.lupa{
        flex-shrink: 0;
        margin-right: 1rem;
        border-right: 1px solid var(--op25);
    }

    .filtro-wrapper{
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border-left: 1px solid var(--op25);

        &.tem-filtro .badge-filtro-ativo{
            display: block;
        }

        .icone-filtro{
            pointer-events: none;
        }

    #filtroTipo {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    }

    .badge-filtro-ativo {
    position: absolute;
    display: none;
    pointer-events: none;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--strange-color);
    }
    }

    option{
        background-color: var(--bg);

        &:checked{
            font-weight: 600;
            background-color: var(--bg-sec);
        }
    }
}


.sentinela-catalogo {
    width: 100%;
    height: 1px;
}


/* Feedback visual (alert)*/
#feedbackContainer {
    position: fixed;
    top: calc(65px + 1rem);
    right: 1rem;
    z-index: 1200;

    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: min(340px, calc(100vw - 2rem));

    pointer-events: none;
}

.feedback-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;

    background-color: var(--bg);
    color: var(--text-color);
    border-left: 5px solid var(--strange-color);
    border-radius: 8px;
    padding: 0.7rem 0.6rem 0.7rem 0.9rem;
    box-shadow: 2px 2px 8px var(--op25);

    font-size: 0.9rem;
    font-weight: 600;

    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.25s ease, transform 0.25s ease;

    pointer-events: auto;

    &.feedback-visivel{
        opacity: 1;
        transform: translateX(0);
    }
    &.feedback-erro{
        border-left-color: var(--sale);
    }
}


.feedback-texto {
    flex: 1;
    line-height: 1.4;
}

.feedback-fechar {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-color);
    opacity: 0.5;
    padding: 0 0.15rem;
}
.feedback-fechar:hover {
    opacity: 1;
}

@media (max-width: 480px) {
    #feedbackContainer {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}