/* ==========================================================================
   Amazon products page (amazon/index.html) — grid, filters, product cards,
   and the detail modal.
   ========================================================================== */

/* ── Real intro copy above the dynamic sections ── */
.section-lede {
  color: var(--grey);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ── BACK LINK (page-specific override) ── */
.back {
  margin-top: 15px;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 20px;
}

.disclosure {
  background: var(--card);
  border-left: 4px solid var(--accent);
  color: var(--grey);
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 40px;
  font-size: 0.9rem;
  box-shadow: 0 0 15px rgba(255, 140, 0, 0.05);
}

.disclosure strong { color: var(--text); }

.filter-buttons {
  text-align: center;
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255, 140, 0, 0.3);
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: linear-gradient(45deg, var(--accent), var(--yellow));
  color: #000;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(255, 200, 0, 0.4);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.product-card {
  background: var(--card);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(255, 140, 0, 0.15);
  transition: 0.4s;
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 0 25px rgba(255, 140, 0, 0.5);
}

.product-image {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, #121214 0%, #1a1a1d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  border-bottom: 1px solid rgba(255, 140, 0, 0.1);
  position: relative;
  overflow: hidden;
}

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

.product-image.tall {
  height: 360px;
  background: #0b0b2e;
}

.product-image.tall img {
  object-fit: contain;
}

.best-seller-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: linear-gradient(45deg, var(--accent), var(--yellow));
  color: #000;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(255, 153, 0, 0.5);
  z-index: 5;
}

.amazon-redirect-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 44px;
  height: 44px;
  background: #FF9900;
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.3s, background-color 0.3s;
  text-decoration: none;
  z-index: 10;
}

.amazon-redirect-icon:hover {
  transform: scale(1.15) rotate(5deg);
  background: #ffb74d;
  box-shadow: 0 4px 15px rgba(255, 153, 0, 0.6);
}

/* ── Phase 6: real links replacing the old modal-click pattern ── */
.product-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.product-name a {
  color: inherit;
  text-decoration: none;
}

.product-name a:hover {
  color: var(--accent);
}

/* ===== Compare modal close button (shared with the compare tool below) ===== */
.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background 0.3s;
}

.detail-close:hover { background: var(--accent); color: #000; }

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.detail-stat {
  background: rgba(255,140,0,0.1);
  border: 1px solid rgba(255,140,0,0.25);
  color: var(--yellow);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

.detail-features { list-style: none; margin-bottom: 24px; }

.detail-features li {
  padding: 7px 0 7px 26px;
  position: relative;
  color: #c9c9ce;
  font-size: 0.92rem;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}

.detail-features li:last-child { border-bottom: none; }

.detail-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
}

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

.product-category {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.product-description {
  font-size: 0.875rem;
  color: var(--grey);
  margin-bottom: 12px;
  flex-grow: 1;
}

.product-features {
  list-style: none;
  padding: 0;
  margin-bottom: 12px;
}

.product-features li {
  font-size: 0.8rem;
  color: var(--grey);
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}

.product-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 140, 0, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--yellow);
}

.buy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(45deg, var(--accent), var(--yellow));
  color: #000;
  font-weight: bold;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 0 10px rgba(255, 200, 0, 0.3);
  transition: 0.3s;
  font-size: 0.9rem;
}

.buy-button:hover {
  box-shadow: 0 0 20px rgb(255, 200, 0);
  transform: scale(1.05);
}

.amazon-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 153, 0, 0.15);
  color: #FF9900;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid rgba(255, 153, 0, 0.3);
}

/* ── WHATSAPP (page-specific override — this page used z-index: 100) ── */
.whatsapp {
  z-index: 100;
}

/* ── FOOTER (page-specific overrides) ── */
footer {
  padding: 40px 20px;
  margin-top: 50px;
}

footer p { font-size: 0.9rem; }

footer a:hover { color: var(--yellow); }

@media (max-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }
}

/* ==========================================================================
   Phase 2 additions — search/sort bar, favorites, compare, collections,
   recently-viewed. Additive only; nothing above this line was changed.
   ========================================================================== */

.tools-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}

.tools-bar input[type="search"],
.tools-bar select {
  background: var(--card);
  border: 1px solid rgba(255,140,0,0.25);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.tools-bar input[type="search"] { flex: 1; min-width: 200px; }

/* ── Favorite heart ── */
.favorite-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 6;
  transition: 0.3s;
}

.favorite-btn.active { background: #e0245e; color: #fff; }
.favorite-btn:hover { transform: scale(1.1); }

/* ── Compare checkbox ── */
.compare-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--grey);
  cursor: pointer;
}

/* ── Compare floating tray ── */
#compareTray {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid rgba(255,140,0,0.3);
  transform: translateY(100%);
  transition: transform 0.3s;
  z-index: 400;
}

#compareTray.open { transform: translateY(0); }

.compare-tray-inner {
  max-width: 1100px;
  margin: auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.compare-count { color: var(--grey); font-size: 0.85rem; }

.compare-thumbs { display: flex; gap: 6px; }
.compare-thumbs img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }

.compare-view-btn, .compare-clear-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
}

.compare-view-btn { background: linear-gradient(45deg, var(--accent), var(--yellow)); color: #000; }
.compare-view-btn:disabled { opacity: 0.5; cursor: default; }
.compare-clear-btn { background: transparent; color: var(--grey); border: 1px solid rgba(255,255,255,0.2); }

/* ── Compare modal ── */
#compareOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#compareOverlay.open { display: flex; }

#compareModal {
  background: var(--card);
  border-radius: 18px;
  max-width: 900px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid rgba(255,140,0,0.2);
}

.compare-modal-body { padding: 30px; }
.compare-modal-body h2 { margin-bottom: 20px; }
.compare-table-wrap { overflow-x: auto; }

.compare-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.compare-table th, .compare-table td {
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-size: 0.85rem;
}
.compare-table th img { width: 60px; height: 60px; object-fit: contain; display: block; margin: 0 auto 8px; }
.compare-table td:first-child, .compare-table th:first-child { text-align: left; color: var(--grey); }

/* ── Collections / Recently Viewed / Favorites ── */
.collection-block { margin-bottom: 36px; }
.collection-block h3, #recentlyViewedSection h3, #favoritesSection h3 {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.collection-desc { color: var(--grey); font-size: 0.85rem; margin-bottom: 14px; }

.collection-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.collection-card {
  flex: 0 0 140px;
  background: var(--card);
  border-radius: 12px;
  padding: 10px;
  text-decoration: none;
  color: var(--text);
  text-align: center;
  box-shadow: 0 0 10px rgba(255,140,0,0.1);
}

.collection-card img { width: 100%; height: 90px; object-fit: contain; margin-bottom: 8px; }
.collection-card span { font-size: 0.78rem; display: block; }

#recentlyViewedSection, #favoritesSection { margin-bottom: 36px; }
.sidebar-empty { color: var(--grey); font-size: 0.85rem; }

.empty-state {
  text-align: center;
  padding: 50px 20px;
  background: var(--card);
  border-radius: 18px;
  border: 1px dashed rgba(255,140,0,0.25);
}
.empty-state-icon { font-size: 2.2rem; margin-bottom: 10px; }
.empty-state h3 { color: var(--accent); margin-bottom: 6px; }
.empty-state p { color: var(--grey); }

/* ── Trust badges ── */
.trust-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.trust-badge {
  background: rgba(255,140,0,0.08);
  border: 1px solid rgba(255,140,0,0.2);
  color: var(--grey);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
}

/* ── How products are selected ── */
.how-selected {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 30px;
}

.how-selected summary { cursor: pointer; font-weight: 600; color: var(--text); }
.how-selected p { color: var(--grey); font-size: 0.88rem; margin-top: 10px; line-height: 1.6; }

/* ── Highlight rail ── */
.highlight-rail { margin-bottom: 10px; }
.highlight-group { margin-bottom: 26px; }
.highlight-group h3 { color: var(--accent); font-size: 1rem; margin-bottom: 12px; }

/* ── Sticky filter + search/sort bar ── */
.sticky-tools {
  position: sticky;
  top: 0;
  z-index: 150;
  background: var(--bg);
  padding: 14px 0 6px;
  margin-bottom: 10px;
}

/* ── Related products inside the detail modal ── */
