/* Reset e Estilos Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #16151D;
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header */
header {
    background-color: rgb(48, 48, 136);
    width: 100%;
    height: 65px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 100;
}

#logo {
    color: white;
    font-size: 1.6em;
    font-weight: bold;
}

#ipesquisa {
    padding: 7px 14px;
    border-radius: 18px;
    border: none;
    width: 220px;
    font-size: 0.95em;
}

.pc {
    display: flex;
    align-items: center;
    gap: 18px;
}

.pc a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.3s;
    font-size: 1em;
}

.pc a:hover {
    opacity: 0.8;
}

.material-symbols-outlined {
    font-size: 1.3em;
}

/* Menu Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: 0.3s;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 65px;
    right: 0;
    background-color: rgb(48, 48, 136);
    width: 200px;
    border-radius: 0 0 0 10px;
    box-shadow: -2px 5px 10px rgba(0,0,0,0.3);
    z-index: 99;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: background-color 0.3s;
}

.mobile-menu a:hover {
    background-color: rgba(255,255,255,0.1);
}

.mobile-menu a:last-child {
    border-bottom: none;
}

/* Botão Voltar */
.botao-voltar-desktop {
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s;
    font-size: 0.9em;
}

.botao-voltar-desktop:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.botao-voltar-mobile {
    display: none;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    background-color: rgba(48, 48, 136, 0.9);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: background-color 0.3s;
    font-size: 1em;
    font-weight: 500;
}

.botao-voltar-mobile:hover {
    background-color: rgba(48, 48, 136, 1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Menu de Navegação */
.nav-menu {
    background-color: #222222;
    padding: 12px 0;
    border-bottom: 2px solid rgb(48, 48, 136);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 0 20px;
}

.nav-item {
    color: white;
    text-decoration: none;
    font-size: 1.05em;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-item:hover {
    background-color: rgba(48, 48, 136, 0.3);
}

.nav-item.active {
    background-color: rgb(48, 48, 136);
}

/* Conteúdo Principal */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Seções de Categoria */
.categoria-section {
    background-color: #222222;
    width: 100%;
    margin: 25px 0;
    border-radius: 10px;
    overflow: hidden;
}

.categoria-header {
    background-color: rgb(48, 48, 136);
    height: 50px;
    width: 100%;
    display: flex;
    align-items: center;
    padding-left: 20px;
}

.categoria-header h2 {
    color: white;
    font-size: 1.3em;
    margin: 0;
    background: none;
    text-align: left;
    width: auto;
}

/* Grid de Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
}

.card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s;
    text-decoration: none;
    color: white;
    background-color: #1a1a2e;
}

.card:hover {
    transform: scale(1.05);
}

.card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    border-radius: 8px 8px 0 0;
}

.card-info {
    padding: 10px;
}

.card-info p {
    font-size: 0.95em;
    color: white;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: none;
    text-align: left;
    border-radius: 0;
}

.card-info span {
    font-size: 0.8em;
    color: #a3a3a3;
}

/* Footer */
footer {
    background-color: #222222;
    width: 100%;
    padding: 18px;
    margin-top: 45px;
}

#cor2 {
    background-color: rgb(48, 48, 136);
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    margin-bottom: 15px;
}

#termodu {
    color: white;
    text-decoration: none;
    font-size: 1.05em;
}

footer p {
    text-align: center;
    color: #a3a3a3;
    font-size: 0.95em;
    line-height: 1.5;
    max-width: 750px;
    margin: 0 auto;
}

/* Responsividade */
@media (max-width: 900px) {
    .pc {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .nav-container {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-item {
        font-size: 0.95em;
        padding: 6px 12px;
    }
}

@media (max-width: 768px) {
    header {
        height: 60px;
        padding: 0 15px;
    }

    #logo {
        font-size: 1.5em;
    }

    .botao-voltar-desktop {
        display: none;
    }

    .botao-voltar-mobile {
        display: flex;
    }

    #ipesquisa {
        width: 180px;
        font-size: 0.9em;
        padding: 6px 12px;
    }

    .mobile-menu {
        top: 60px;
    }

    .card img {
        height: 200px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 15px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    header {
        flex-wrap: wrap;
        height: auto;
        padding: 12px;
        gap: 10px;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 8px;
    }

    #ipesquisa {
        width: 100%;
        order: 3;
        margin-top: 8px;
    }

    .hamburger {
        order: 2;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
        padding: 12px;
    }

    .card img {
        height: 170px;
    }

    .card-info p {
        font-size: 0.85em;
    }

    .card-info span {
        font-size: 0.75em;
    }

    footer {
        padding: 15px;
    }
}

@media (max-width: 360px) {
    .card img {
        height: 150px;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
}