:root {
  --primary: #25D366;
  --primary-dark: #128C7E;
  --text-dark: #1F2937;
  --text-medium: #4B5563;
  --text-light: #9CA3AF;
  --bg-body: #F3F4F6;
  --bg-card: #FFFFFF;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--bg-body);
  color: var(--text-dark);
  /* Layout para manter o rodapé no fundo mesmo com pouco conteúdo */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Faz o conteúdo principal ocupar o espaço disponível */
main.container {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.app-header {
  background-color: var(--bg-card);
  padding: 1.5rem 0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  text-align: center;
}

.hero-slider {
  width: 100%;
  overflow: hidden;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.slider-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: var(--bg-card);
  overflow: hidden;
}

.slider-track {
  display: flex;
  width: 100%;
  transform: translateX(0);
  transition: transform 0.5s ease;
}

.slide {
  min-width: 100%;
  position: relative;
  height: 280px;
}

@media (min-width: 640px) {
  .slide { height: 380px; }
}
@media (min-width: 1024px) {
  .slide { height: 480px; }
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}



.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.35);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

#slider-prev { left: 8px; }
#slider-next { right: 8px; }

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
}

.slider-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: #d1d5db;
  cursor: pointer;
}

.slider-dots button.active {
  background: var(--primary);
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
}

.app-header p {
  color: var(--text-medium);
  font-size: 0.9rem;
}

.store-status {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid;
  background: #fff;
}
.store-status .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.store-status.open {
  border-color: #10B981;
  color: #065F46;
  background: #DEF7EC;
}
.store-status.open .dot {
  background: #10B981;
}
.store-status.closed {
  border-color: #EF4444;
  color: #7F1D1D;
  background: #FEE2E2;
}
.store-status.closed .dot {
  background: #EF4444;
}

/* Grid de Produtos */
.product-grid {
  display: grid;
  grid-template-columns: 1fr; /* Mobile: 1 coluna */
  gap: 1.5rem;
}

.category-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  scroll-margin-top: 12px;
}

.filter-pill {
  background: var(--bg-card);
  border: 1px solid #E5E7EB;
  color: var(--text-medium);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

@media (min-width: 640px) {
  .product-image { height: 280px; }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .product-image { height: 320px; }
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Card de Produto */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
}

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

.product-image {
  width: 100%;
  height: 240px;
  overflow: hidden;
}

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

.product-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-info h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.product-info p {
  font-size: 0.875rem;
  color: var(--text-medium);
  margin-bottom: 1rem;
  line-height: 1.4;
  flex-grow: 1;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.price-container {
  display: flex;
  flex-direction: column;
}

.price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.price-old {
  font-size: 0.85rem;
  text-decoration: line-through;
  color: var(--text-light);
  margin-bottom: -2px;
}

.offer-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #ef4444; /* Cor vermelha direta */
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.add-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s;
  /* Touch target otimizado */
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-btn:hover {
  background-color: var(--primary-dark);
}

.add-btn:active {
  transform: scale(0.96);
}

.add-btn:disabled {
  background-color: #9CA3AF;
  cursor: not-allowed;
  transform: none;
}

/* Estado de indisponível */
.product-card.unavailable .product-image img {
  filter: grayscale(0.2) brightness(0.85);
}
.product-card.unavailable .add-btn {
  background-color: #9CA3AF;
  cursor: not-allowed;
}
.product-card.unavailable .add-btn:active,
.product-card.unavailable .add-btn:hover {
  transform: none;
  background-color: #9CA3AF;
}
.unavailable-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #EF4444;
  color: white;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* Carrinho Flutuante */
.cart-float {
  position: fixed;
  top: 1rem;
  right: 1rem;
  bottom: auto;
  left: auto;
  width: auto;
  background-color: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 100;
  transition: transform 0.3s ease-in-out, background-color 0.2s;
}

.cart-float:hover {
  background-color: var(--primary-dark);
}

.cart-float.hidden {
  transform: translateY(-150%);
}

.cart-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.cart-count {
  font-size: 0.9rem;
  font-weight: 600;
}

.cart-total {
  font-weight: 700;
  font-size: 0.9rem;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  padding-left: 0.5rem;
}

.cart-icon {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
}

/* Responsividade do Carrinho para Mobile (FAB no topo) */
@media (max-width: 640px) {
  .cart-float {
    top: 15px;      /* Move para o topo */
    bottom: auto;   /* Remove fixação inferior */
    right: 15px;
    width: 50px;    /* Um pouco menor para não ocupar muito o header */
    height: 50px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .cart-float.hidden {
    transform: translateY(-200%); /* Esconde para cima no mobile */
  }

  .cart-total {
    display: none; /* Oculta preço no botão FAB */
  }

  .cart-info {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #EF4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
  }

  .cart-count {
    font-size: 0.75rem;
    font-weight: 700;
  }

  .cart-icon {
    font-size: 1.5rem;
  }
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: white;
  width: 100%;
  max-width: 400px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal:not(.hidden) .modal-content {
  transform: translateX(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bg-body);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-light);
}

.cart-items {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  max-height: 40vh;
  min-height: 120px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--bg-body);
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
}

.cart-item-price {
  font-size: 0.85rem;
  color: var(--text-medium);
}

.cart-item-remove {
  color: #EF4444;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 0.5rem;
}

.cart-summary {
  background-color: var(--bg-body);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.1rem;
}

.summary-row + .summary-row {
  margin-top: 0.5rem;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-medium);
}

.form-group input,
.form-group textarea {
  padding: 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.checkout-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  margin-top: 0.5rem;
}

.checkout-btn:hover {
  background-color: var(--primary-dark);
}

.checkout-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.checkout-warning {
    text-align: center;
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 8px;
    transition: opacity 0.3s;
}

.checkout-warning.hidden {
    opacity: 0;
}

.empty-msg {
  text-align: center;
  color: var(--text-light);
  margin-top: 2rem;
}

/* Rodapé */
.site-footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--bg-body);
  margin-top: 1rem;
  padding: 0.5rem 0;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.footer-left {
  color: var(--text-medium);
  font-size: 0.9rem;
  text-align: center;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.footer-links a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Banner de Cookies */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #111827;
  color: #F9FAFB;
  padding: 0.75rem 0;
  z-index: 1000;
  box-shadow: 0 -6px 16px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.cookie-banner.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.cookie-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.cookie-content a {
  color: #93C5FD;
  text-decoration: underline;
}

.accept-cookies-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 640px) {
  .cookie-content {
    flex-direction: column;
    align-items: flex-start;
  }
}
