* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Screen reader only - acessível mas visualmente oculto */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #fbefe6;
  min-height: 100vh;
  padding: 20px;
  padding-top: 50px; /* Reservar espaço para o top-banner fixo */
}

.top-banner {
  background: #4c211b;
  color: #fbefe6;
  text-align: center;
  padding: 8px 15px;
  font-size: 0.8em;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.top-banner a {
  color: #e66d75;
  text-decoration: none;
  font-weight: 600;
}

.top-banner a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 25px;
}

header {
  background: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.header-left {
  flex: 1;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 5px;
}

.logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 8px;
}

h1 {
  color: #b4013e;
  font-size: 1.8em;
  margin-bottom: 0;
}

.company-description {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.company-info {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85em;
  color: #555;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-icon {
  font-size: 16px;
}

.whatsapp-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.info-item a {
  color: #25d366;
  text-decoration: none;
  font-weight: 600;
}

.info-item a:hover {
  text-decoration: underline;
}

.whatsapp-alert {
  width: 100%;
  display: block;
  text-align: center;
  padding-top: 7px;
  color: gray;
}

.preview-link {
  display: block;
  text-align: center;
  color: #b4013e;
  font-size: 0.85em;
  margin-top: 8px;
  cursor: pointer;
}

.preview-link:hover {
  text-decoration: underline;
}

.message-preview {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.message-preview.active {
  display: flex;
}

.message-preview-content {
  background: white;
  color: #4c211b;
  border-radius: 15px;
  padding: 25px;
  max-width: 400px;
  width: 90%;
  max-height: 70vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.message-preview-content h4 {
  color: #b4013e;
  margin-bottom: 15px;
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-preview-content h4::before {
  content: "📱";
}

.message-preview-content pre {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.85em;
  line-height: 1.6;
  margin: 0;
  font-family: inherit;
  color: #333;
}

.close-preview {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f0e6de;
  border: none;
  color: #b4013e;
  font-size: 20px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.close-preview:hover {
  background: #e8ddd4;
}

@media (max-width: 768px) {
  header {
    padding: 12px;
    margin-bottom: 15px;
  }

  .header-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }

  .logo-title {
    gap: 8px;
  }

  .logo {
    width: 35px;
    height: 35px;
  }

  h1 {
    font-size: 1.1em;
  }

  .company-description {
    display: none;
  }

  .company-info {
    flex-direction: column;
    gap: 4px;
    font-size: 0.75em;
  }

  .info-icon {
    font-size: 12px;
  }

  .whatsapp-icon {
    width: 14px;
    height: 14px;
  }

  .cart-btn {
    padding: 8px 12px;
    font-size: 14px;
  }

  .cart-count {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
}

.cart-btn {
  background: #b4013e;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
}

.cart-btn:hover {
  background: #4c211b;
  transform: scale(1.05);
}

.cart-count {
  background: white;
  color: #b4013e;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
  min-height: 600px; /* Reservar espaço para evitar CLS */
}

/* Skeleton loading para cards */
.skeleton-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  height: 420px;
}

.skeleton-image {
  width: 100%;
  height: 220px;
  background: linear-gradient(90deg, #f0e6de 25%, #e8ddd4 50%, #f0e6de 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.skeleton-content {
  padding: 20px;
}

.skeleton-text {
  height: 20px;
  background: linear-gradient(90deg, #f0e6de 25%, #e8ddd4 50%, #f0e6de 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 10px;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-text.price {
  width: 40%;
  height: 28px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    min-height: 400px;
    gap: 10px;
  }

  .skeleton-card {
    height: 280px;
  }

  .skeleton-image {
    height: 140px;
  }

  .product-card {
    min-height: 280px;
  }

  .product-image {
    height: 140px;
    min-height: 140px;
    max-height: 140px;
  }

  .product-info {
    padding: 12px;
  }

  .product-title {
    font-size: 1em;
  }

  .product-price {
    font-size: 1.2em;
  }

  .size-chip {
    padding: 4px 8px;
    font-size: 0.75em;
  }

  .card-actions {
    padding: 0 12px 12px 12px;
    gap: 8px;
  }

  .quantity-btn {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  .quantity-display {
    min-width: 20px;
    font-size: 0.9em;
  }

  .add-to-cart {
    padding: 8px 10px;
    font-size: 12px;
  }

  .cart-badge {
    padding: 5px 10px;
    font-size: 0.75em;
  }
}

@media (max-width: 480px) {
  .container {
    padding-top: 20px;
  }

  .header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .cart-btn {
    width: 100%;
    justify-content: center;
  }

  .products-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .modal-content {
    padding: 15px;
    width: 95%;
  }

  .cart-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 10px;
    align-items: center;
  }

  .cart-item-image {
    width: 50px;
    height: 50px;
    grid-row: span 1;
  }

  .cart-item-info {
    min-width: 0;
  }

  .cart-item-title {
    font-size: 0.9em;
  }

  .cart-item-controls {
    flex-direction: column;
    gap: 6px;
    align-items: center;
  }

  .remove-btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  .qty-btn {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .skeleton-card {
    height: 380px;
  }

  .skeleton-image {
    height: 200px;
  }

  .product-card {
    min-height: 380px;
  }

  .product-image {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
  }
}

.product-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  contain: layout style;
  will-change: transform;
}

.product-image {
  width: 100%;
  height: 220px;
  min-height: 220px;
  max-height: 220px;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  background-color: #f0e6de; /* Placeholder enquanto carrega */
}

.cart-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #4c211b;
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  animation: bounceIn 0.5s;
  cursor: pointer;
  transition: transform 0.3s, background-color 0.3s;
  will-change: transform;
}

.cart-badge:hover {
  background: #b4013e;
  transform: scale(1.05);
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.product-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  color: #4c211b;
  font-size: 1.3em;
  margin-bottom: 10px;
}

.product-size {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.product-price {
  color: #b4013e;
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 15px;
}

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.size-chip {
  padding: 6px 12px;
  border: 2px solid #e66d75;
  background: white;
  color: #b4013e;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.3s;
  font-weight: 600;
}

.size-chip:hover {
  background: #fbefe6;
}

.size-chip.active {
  background: #b4013e;
  color: white;
  border-color: #b4013e;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-btn {
  background: #b4013e;
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background: #4c211b;
}

.quantity-display {
  min-width: 30px;
  text-align: center;
  font-weight: bold;
  font-size: 1.1em;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px 20px;
  margin-top: auto;
}

.add-to-cart {
  background: #b4013e;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  flex: 1;
}

.add-to-cart:hover {
  background: #4c211b;
}

.add-to-cart:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 15px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 30px;
  cursor: pointer;
  color: #666;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  aspect-ratio: 1 / 1;
  background-color: #f0e6de;
}

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

.cart-item-title {
  font-weight: bold;
  margin-bottom: 5px;
}

.cart-item-price {
  color: #b4013e;
  font-weight: bold;
}

.cart-item-size {
  color: #888;
  font-size: 0.85em;
  margin-top: 2px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  background: #b4013e;
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
}

.qty-btn:hover {
  background: #4c211b;
}

.remove-btn {
  background: #ff4444;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
}

.cart-total {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #eee;
  text-align: right;
  font-size: 1.3em;
  font-weight: bold;
  color: #4c211b;
}

.checkout-btn {
  width: 100%;
  background: #25d366;
  color: white;
  border: none;
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.checkout-btn:hover:not(:disabled) {
  background: #20ba5a;
}

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

.empty-cart {
  text-align: center;
  padding: 40px;
  color: #999;
}

footer {
  background: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-top: 30px;
  text-align: center;
  color: #4c211b;
  font-size: 0.9em;
}

footer p {
  margin: 0;
}

footer a {
  color: #b4013e;
  text-decoration: none;
  font-weight: 600;
}

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

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #b4013e;
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  animation: slideIn 0.3s ease-out;
  will-change: transform, opacity;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
