:root {
    --bg: #827f7f;
    --menu: #a5ff26;
    --menu-text: #121212;
    --card: #fff;
    --text: #111;
    --muted: #444;
    --primary: #0d0d0d;
    --secondary: #a5ff26;
}

body.dark-mode {
    --bg: #1a1a1a;
    --menu: #8acc20;
    --menu-text: #ffffff;
    --card: #2a2a2a;
    --text: #ffffff;
    --muted: #aaaaaa;
    --primary: #ffffff;
    --secondary: #8acc20;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
}

header {
    background: var(--menu);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
    display: grid;
    grid-template-columns: 200px 1fr auto;
    align-items: center;
    gap: 16px;
}

.logo-slot {
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6em;
    font-weight: bold;
}
.logo-slot img {
    height: 45px;
    width: 195px;
}

.search-slot {
    display: flex;
    justify-content: center;
}

.search-slot input {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--muted);
    font-size: 14px;
    background: var(--card);
    color: var(--text);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
    justify-content: flex-end;
}

nav button {
    border: 0;
    background: transparent;
    color: var(--menu-text);
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

nav button:hover {
    background: rgba(255, 255, 255, 0.2);
}

nav button.active {
    background: rgba(0, 0, 0, 0.16);
}

.cart-button, .favorites-button, .theme-button {
    background: var(--primary);
    color: var(--card);
    padding: 8px 12px;
    border-radius: 12px;
    border: 0;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-button:hover, .favorites-button:hover, .theme-button:hover {
    background: var(--secondary);
}

.cart-button span, .favorites-button span {
    font-size: 14px;
}

.favorite-icon {
    background: transparent;
    color: var(--primary);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--primary);
    cursor: pointer;
    font-size: 18px;
}

.favorite-icon.favorited {
    background: var(--secondary);
    color: var(--menu-text);
}

.favorite-icon:hover {
    background: var(--primary);
    color: var(--card);
}

.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px;
}

.headline {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    color: var(--text);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

@media (max-width: 1000px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 760px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.thumb {
    height: 120px;
    display: grid;
    place-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    position: relative;
}

.card img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    display: block;
    border-radius: 16px 16px 0 0;
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: var(--card);
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 999px;
}

.content {
    padding: 10px;
    display: grid;
    gap: 8px;
}

.title {
    font-weight: 700;
    font-size: 14px;
}

.meta {
    color: var(--muted);
    font-size: 12px;
}

.price {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2000;
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    width: min(980px, 100%);
    max-height: 80vh;
    background: var(--card);
    border-radius: 18px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

@media (max-width: 820px) {
    .modal {
        grid-template-columns: 1fr;
    }
}

.modal .left {
    display: grid;
    place-items: center;
    padding: 16px;
}

.modal .left img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    display: block;
    border-radius: 16px;
    background: var(--card);
}

.modal .right {
    padding: 16px;
    display: grid;
    gap: 10px;
}

.close-x {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 0;
    background: var(--primary);
    color: var(--card);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 800;
}

.chip {
    background: var(--muted);
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 700;
    font-size: 12px;
    color: var(--card);
}

.modal .right .price {
    font-weight: 800;
    font-size: 18px;
    color: var(--primary);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    z-index: 2100;
}

.modal-buttons button {
    flex: 1;
    padding: 12px;
    font-weight: 700;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.modal-buttons .comprar {
    background: var(--primary);
    color: var(--card);
}

.modal-buttons .comprar:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.modal-buttons .add-cart {
    background: var(--secondary);
    color: var(--menu-text);
}

.modal-buttons .add-cart:hover {
    background: var(--primary);
    color: var(--card);
    transform: translateY(-2px);
}

.modal-buttons .contato {
    background: var(--secondary);
    color: var(--menu-text);
}

.modal-buttons .contato:hover {
    background: var(--primary);
    color: var(--card);
    transform: translateY(-2px);
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px;
    font-weight: 700;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn.light {
    background: var(--secondary);
    color: var(--menu-text);
}

.btn.light:hover {
    background: var(--primary);
    color: var(--card);
    transform: translateY(-2px);
}

.desc {
    margin: 10px 0;
}

footer {
    text-align: center;
    padding: 16px 0;
    color: var(--text);
    font-size: 14px;
    background: rgba(0, 0, 0, 0.2);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Estilos para a ficha técnica */
.technical-specs {
    margin-top: 16px;
    border-top: 1px solid var(--muted);
    padding-top: 16px;
}

.technical-specs h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
}

.technical-specs table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.technical-specs th, .technical-specs td {
    border: 1px solid var(--muted);
    padding: 8px;
    text-align: left;
}

.technical-specs th {
    background: var(--secondary);
    color: var(--menu-text);
    width: 40%;
}

.technical-specs td {
    background: var(--card);
}

/* Estilos para o carrinho e favoritos */
.cart-item, .favorite-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--muted);
}

.cart-item img, .favorite-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
}

.cart-item .details, .favorite-item .details {
    flex: 1;
}

.cart-item .quantity {
    display: flex;
    gap: 5px;
    align-items: center;
}

.cart-item .quantity input {
    width: 50px;
    padding: 5px;
    border-radius: 8px;
    border: 1px solid var(--muted);
    text-align: center;
    background: var(--card);
    color: var(--text);
}

.cart-total {
    margin-top: 16px;
    font-size: 16px;
    font-weight: 700;
}

/* Estilos para o chat */
.chat-modal {
    width: min(600px, 100%);
    grid-template-columns: 1fr;
}

.chat-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-messages {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--muted);
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 80%;
}

.chat-message.bot {
    background: var(--secondary);
    color: var(--menu-text);
    margin-left: auto;
}

.chat-message.user {
    background: var(--primary);
    color: var(--card);
    margin-right: auto;
}

.chat-error {
    color: red;
    font-size: 12px;
    text-align: center;
    display: none;
}

.chat-error.show {
    display: block;
}

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

.chat-suggestions button {
    background: var(--secondary);
    color: var(--menu-text);
    padding: 8px 12px;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    font-size: 12px;
}

.chat-suggestions button:hover {
    background: var(--primary);
    color: var(--card);
}

.chat-input {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input textarea {
    flex: 1;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--muted);
    resize: none;
    height: 60px;
    background: var(--card);
    color: var(--text);
}

.chat-buttons {
    display: flex;
    gap: 10px;
}