/* =========================================================
   VARIÁVEIS GLOBAIS (OBRIGATÓRIO – corrigia bugs visuais)
========================================================= */
:root {
    --primary: #16a34a;
    --primary-dark: #15803d;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f3f4f6;
    --transition: all 0.2s ease;
}

/* =========================================================
   RESET E BASE
========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--light);
    min-height: 100vh;
}

/* =========================================================
   HEADER / NAVBAR
========================================================= */
.header {
    background-color: white;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 40;
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    height: 4rem;
    width: auto;
}

/* =========================================================
   MENU DE NAVEGAÇÃO
========================================================= */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 2rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
    background-color: rgba(22,163,74,0.1);
}

.nav-link.active {
    color: var(--primary);
    background-color: rgba(22,163,74,0.15);
    font-weight: 600;
}

.nav-icon {
    width: 1.125rem;
    height: 1.125rem;
    margin-right: 0.5rem;
}

/* =========================================================
   BOTÃO DO CARRINHO
========================================================= */
.cart-button {
    position: relative;
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.cart-button:hover {
    background: linear-gradient(to right, var(--primary-dark), #166534);
}

.cart-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.cart-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background-color: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   FILTROS
========================================================= */
.filters-section {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
}

.filters-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    overflow-x: auto;
    white-space: nowrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    color: #374151;
    transition: var(--transition);
}

.filter-btn:hover {
    background-color: #dcfce7;
    color: var(--primary);
}

.filter-btn.active {
    background-color: var(--primary);
    color: white;
}

/* =========================================================
   GRID DE PRODUTOS
========================================================= */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

/* =========================================================
   CARD DO PRODUTO
========================================================= */
.product-card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 16rem;
    object-fit: contain;
    padding: 1rem;
}

.product-content {
    padding: 1rem;
}

.product-category {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

.product-name {
    font-weight: bold;
    color: var(--dark);
    margin: 0.5rem 0;
}

.product-description {
    font-size: 0.75rem;
    color: var(--gray);
}

/* =========================================================
   RODAPÉ DO CARD — PREÇO + BOTÃO
========================================================= */
.product-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.add-to-cart-btn {
    width: 100%;
    padding: 10px 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.02em;
}

.add-to-cart-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.add-to-cart-btn:active {
    transform: scale(0.97);
}

/* =========================================================
   CHECKOUT
========================================================= */
.checkout-page {
    position: fixed;
    inset: 0;
    background-color: var(--light);
    z-index: 60;
    overflow-y: auto;
}

/* =========================================================
   RESPONSIVO
========================================================= */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-menu {
        display: none;
    }
}

/* ⭐ Avaliação */
.product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
}

.stars {
  display: flex;
  gap: 2px;
}

.stars svg {
  width: 14px;
  height: 14px;
  fill: #facc15;
  stroke: #facc15;
  flex-shrink: 0;
}

.rating-text {
  font-size: 12px;
  color: #6b7280;
}

/* ==============================
   MODAL DO CARRINHO
============================== */
.cart-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 9999;
}

.cart-modal.show {
  display: flex;
  justify-content: flex-end;
}

/* ==============================
   CONTAINER
============================== */
.cart-container {
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
}

/* ==============================
   HEADER
============================== */
.cart-header {
  padding: 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

/* ==============================
   CONTEÚDO
============================== */
.cart-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

/* ==============================
   ITEM DO CARRINHO
============================== */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fafafa;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.cart-item-image {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 13px;
  color: #666;
}

/* ==============================
   CONTROLES + - LIXEIRA
============================== */
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.quantity-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #eaeaea;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.quantity-btn svg {
  width: 14px;
  height: 14px;
}

.quantity {
  font-size: 14px;
  font-weight: 600;
}

.quantity-btn.remove {
  background: #ffe5e5;
  color: #e53935;
}

/* ==============================
   TOTAL DO ITEM
============================== */
.cart-item-total {
  font-size: 14px;
  font-weight: 600;
  color: #1b8f3a;
}

/* ==============================
   FOOTER FIXO
============================== */
.cart-footer {
  border-top: 1px solid #eee;
  padding: 16px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.total-price {
  color: #1b8f3a;
}

/* ==============================
   BOTÃO FINALIZAR
============================== */
.checkout-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #1b8f3a, #22b455);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.checkout-btn:hover {
  opacity: 0.9;
}

/* ==============================
   CARRINHO VAZIO
============================== */
.empty-cart {
  text-align: center;
  color: #888;
  margin-top: 40px;
}

.empty-cart-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
}

.site-footer {
    width: 100%;
    background: #0f172a;
    padding: 20px 10px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.site-footer p {
    color: #cbd5e1;
    font-size: 14px;
}

.site-footer a {
    color: #38bdf8;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: #0ea5e9;
    text-decoration: underline;
}