:root {
  --max-width: 1200px;
  --bg: #f9f9f9;
  --card: #fff;
  --text: #333;
  --primary: #ff6347;
}

:root[data-theme="dark"] {
  --bg: #121212;
  --card: #1e1e1e;
  --text: #eee;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* HEADER */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  padding: 15px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  flex-wrap: wrap;
}
.logo {
  font-size: 1.6em;
  font-weight: bold;
  color: var(--primary);
}
nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}
nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}
nav a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

/* BANNER */
.promo-banner {
  display: flex;
  gap: 20px;
  background: linear-gradient(to right, #ffecd2, #fcb69f);
  padding: 30px;
  border-radius: 12px;
  flex-wrap: wrap;
}
.banner-img {
  max-width: 280px;
  border-radius: 10px;
}
.btn-promo {
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  display: inline-block;
  margin-top: 10px;
}

/* CATEGORIES */
.categories {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 20px;
  flex-wrap: wrap;
}
.cat {
  background: var(--card);
  text-align: center;
  padding: 10px;
  font-size: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  flex: 0 1 100px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.cat:hover {
  background: var(--primary);
  color: #fff;
}
.cat.active {
  background: var(--primary);
  color: white;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* PRODUCTS */
.products {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding: 40px 20px;
}
.product-card {
  background: var(--card);
  padding: 12px;
  width: 180px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  position: relative;
  opacity: 0;
  transform: scale(0.95);
}
.product-card.show {
  opacity: 1;
  transform: scale(1);
}
.product-card.hidden {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  visibility: hidden;
  z-index: -1;
}
.product-card:hover {
  transform: translateY(-3px);
}
.product-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.product-card img.loaded {
  opacity: 1;
}
.product-card h3 {
  font-size: 1em;
  margin: 8px 0 4px;
}
.sku {
  font-size: 0.8em;
  color: gray;
  margin-bottom: 8px;
}
.icon-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
}
.icon-actions button {
  background: none;
  border: none;
  font-size: 1em;
  cursor: pointer;
  color: var(--primary);
  padding: 2px;
}
.icon-actions button:hover {
  background: var(--primary);
  color: white;
  border-radius: 50%;
}
.add-btn {
  background: none;
  border: none;
  font-size: 1.4em;
  cursor: pointer;
  color: var(--primary);
}
.add-btn:hover {
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 32px;
  height: 32px;
}
.status {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
  font-size: 0.9em;
  color: gray;
}
.status span.active {
  color: var(--primary);
  font-weight: bold;
}

/* FOOTER */
.sticky-footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: var(--card);
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
  z-index: 800;
}
.cart-dropdown {
  position: absolute;
  background: var(--card);
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: none;
  bottom: 50px;
  right: 20px;
}
#favBtn:hover,
#compBtn:hover,
#cartBtn:hover {
  color: var(--primary);
  transform: scale(1.05);
  transition: 0.2s ease;
}

/* SCROLL TO TOP */
#scrollTopBtn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  font-size: 1.5em;
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 50%;
  display: none;
  z-index: 900;
}

/* CONTACT WIDGET */
#contactWidget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-size: 1.6em;
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 900;
}
.contact-popup {
  position: fixed;
  bottom: 90px;
  right: 20px;
  background: var(--card);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  display: none;
  z-index: 901;
}

/* MODAL */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.modal-content {
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  max-width: 800px;
  width: 90%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.close-modal {
  font-size: 1.5em;
  cursor: pointer;
  float: right;
}
.modal-inner {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.modal-inner img {
  max-width: 250px;
  border-radius: 8px;
}

/* 🖼️ FLY IMAGE */
.fly-image {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transition: transform 0.8s ease, opacity 0.8s ease;
  border-radius: 6px;
  max-width: 100px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
}

/* 💫 PULSE EFFECT */
.pulse {
  animation: pulse 0.4s ease;
}
@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* 📱 ADAPTIVE STYLES */
@media screen and (max-width: 1024px) {
  .product-card { width: 160px; }
}

@media screen and (max-width: 768px) {
  .main-header { flex-direction: column; }
  nav ul { flex-wrap: wrap; gap: 10px; margin-top: 10px; }
  .promo-banner { flex-direction: column; text-align: center; }
  .banner-img { max-width: 100%; }
  .product-card { width: 45%; }
}

@media screen and (max-width: 480px) {
  .product-card { width: 100%; max-width: 320px; }
  .icon-actions { top: 4px; right: 4px; }
  .icon-actions button { font-size: 0.9em; }
}
