* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f7f7f7;
}

.container {
    width: 1200px;
    max-width: 95%;
    margin: auto;
}

/* Navbar */
.navbar {
    background: #131921;
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    width: 1200px;
    max-width: 95%;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links>li>a {
    padding: 8px 12px;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;

    background: white;
    min-width: 220px;

    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);

    padding: 6px 0;
    list-style: none;

    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);

    transition: all .2s ease;

    z-index: 2000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 16px;
    color: #333;
}

.dropdown-menu li a:hover {
    background: #f3f3f3;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 80px;
}

/* Search */
.search-bar {
    flex: 1;
    display: flex;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px;
}

.search-bar button {
    background: #ff9900;
    border: none;
    padding: 0 16px;
    cursor: pointer;
}

/* Cart */
.cart-button {
    background: #ff9900;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    color: #111;
    transition: .2s;
}

.cart-button:hover {
    background: #ffb84d;
}

.mini-cart {
    display: flex;
    flex-direction: column;
    width: 280px;
    max-height: 400px;
}

.mini-cart-items {
    overflow-y: auto;
    flex: 1;
}

.mini-cart-footer {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
    font-weight: bold;
}

.mini-cart-wrapper {
    position: absolute;
    right: 0;
    top: 60px;

    width: 320px;
    max-height: 420px;

    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);

    display: flex;
    flex-direction: column;

    overflow: hidden;
    /* 👈 MUITO IMPORTANTE */
    z-index: 9999;
}


/* Product */
.product-grid {
    display: grid;
    gap: 20px;

    /* 🔥 magia aqui */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 20px;
}

.product-card {
    background: white;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    transition: .2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-image-wrapper {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    background: #f2f2f2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card h3 {
    font-size: 15px;
    margin: 10px 0 5px;
}

.product-price {
    font-size: 16px;
    font-weight: bold;
    color: #111;
}

.product-actions {
    flex: 1;
    background: #eee;
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    text-decoration: none;
    color: #111;
}

.btn {
    flex: 1;
    background: #eee;
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    text-decoration: none;
    color: #111;
}

.btn-primary {
    flex: 1;
    background: #ff9900;
    border: none;
    cursor: pointer;
    color: white;
}

/* 4 colunas */
@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 3 colunas */
@media (max-width: 1199px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 2 colunas */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* htmx */
.htmx-request {
    opacity: 0.6;
    transition: .2s;
}

/* Cart */

.cart-card {
    display: flex;
    align-items: center;
    gap: 16px;

    background: white;
    padding: 12px;
    border-radius: 8px;

    margin-bottom: 12px;

    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

.cart-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    background: #f2f2f2;

    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quantity-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quantity-box button {
    padding: 4px 8px;
    cursor: pointer;
}

.cart-price {
    font-weight: bold;
    font-size: 16px;
    color: #111;
}

@media (max-width: 600px) {
    .cart-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-image {
        width: 100%;
        height: 120px;
    }
}