/* =============================================
   UPHIX GADGETS — Components
   =============================================*/

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.9375rem;
  border: none; transition: var(--transition);
  cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: var(--shadow-accent); }
.btn-ghost { background: rgba(255,255,255,0.07); color: var(--text-primary); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); border-color: var(--border-accent); }
.btn-whatsapp { background: var(--green-wa); color: #fff; }
.btn-whatsapp:hover { background: var(--green-wa-hover); transform: translateY(-2px); }
.btn-hot { background: linear-gradient(135deg, #ef4444, #f97316); color: #fff; }
.btn-hot:hover { opacity: 0.9; transform: translateY(-2px); }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-lg { padding: 16px 36px; font-size: 1.0625rem; }
.btn-full { width: 100%; justify-content: center; }

/* ---- BADGE ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px; border-radius: 0;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.badge-accent { background: rgba(59,130,246,0.15); color: var(--accent); border: 1px solid rgba(59,130,246,0.3); }
.badge-new { background: rgba(59,130,246,0.2); color: #60a5fa; }
.badge-used { background: rgba(245,158,11,0.15); color: var(--gold); }
.badge-sale { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-hot { background: linear-gradient(135deg,rgba(239,68,68,0.3),rgba(249,115,22,0.3)); color: #fb923c; border: 1px solid rgba(239,68,68,0.4); }
.badge-featured { background: rgba(168,85,247,0.2); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.badge-phone { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.badge-laptop { background: rgba(139,92,246,0.15); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }
.badge-accessory { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }

/* ---- SECTION ---- */
.section { padding: 96px 0; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 { font-size: clamp(2rem, 4vw, 3.25rem); margin-bottom: 12px; }
.section-header p { color: var(--text-secondary); font-size: 1.0625rem; max-width: 560px; margin: 0 auto; }

/* ---- CATALOG HEADER ---- */
.catalog-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.catalog-header > div:first-child { flex: 1; }
.catalog-header h2 { margin: 0; }
.catalog-header p { margin-top: 8px; }

/* ---- MODAL BACKDROP ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 3100; display: none; align-items: center; justify-content: center; padding: 20px; animation: backdropIn 0.25s ease; }
.modal-backdrop.open { display: flex; }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- PRODUCT MODAL ---- */
.product-modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 880px; max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch; animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1); position: relative; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; background: rgba(255,255,255,0.07); border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); z-index: 10; transition: var(--transition); }
.modal-close:hover { background: var(--danger); color: #fff; }
.modal-body { display: grid; grid-template-columns: 1fr 1fr; }
.modal-main-img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.modal-thumbs { display: flex; gap: 8px; padding: 12px; background: var(--bg-secondary); }
.modal-thumb { width: 72px; height: 72px; border-radius: var(--radius-sm); object-fit: cover; cursor: pointer; border: 2px solid transparent; transition: var(--transition); flex-shrink: 0; }
.modal-thumb.active { border-color: var(--accent); }
.modal-thumb:hover { border-color: rgba(59,130,246,0.5); }
.modal-info { padding: 32px 28px; overflow-y: auto; }
.modal-badge { margin-bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.modal-name { font-size: 1.5rem; font-weight: 900; margin-bottom: 6px; }
.modal-spec { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 20px; }
.modal-price { font-family: var(--font-heading); font-size: 2rem; font-weight: 900; margin-bottom: 24px; }
.modal-features { margin-bottom: 28px; }
.modal-features h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 12px; }
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.feature-list li { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--text-secondary); }
.feature-list li::before { content: ''; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; flex-shrink: 0; }
.modal-actions { display: flex; flex-direction: row; gap: 8px; flex-wrap: wrap; }
.modal-source-tag { display: none; }

/* ---- PROMO MODAL ---- */
#promo-modal { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,0.85); display: none; align-items: center; justify-content: center; padding: 20px; }
#promo-modal.open { display: flex; }
.promo-box { background: var(--bg-card); border: 1px solid var(--border-accent); border-radius: var(--radius-lg); max-width: min(480px, calc(100vw - 32px)); width: 100%; box-sizing: border-box; overflow: hidden; animation: modalIn 0.35s cubic-bezier(0.34,1.56,0.64,1); position: relative; }
.promo-content { padding: clamp(16px, 4vw, 28px); text-align: center; }
.promo-content h3 { font-size: 1.5rem; margin-bottom: 10px; word-break: break-word; }
.promo-content p { color: var(--text-secondary); margin-bottom: 24px; word-break: break-word; }
#promo-img { width: 100%; height: auto; display: block; border-radius: 8px 8px 0 0; }

/* ---- TOGGLE SWITCH ---- */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle-input { position: relative; width: 44px; height: 24px; }
.toggle-input input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,0.1); border-radius: 99px;
  transition: 0.3s;
}
.toggle-slider:before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: 0.3s;
}
.toggle-input input:checked + .toggle-slider { background: var(--accent); }
.toggle-input input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ---- SCROLL ANIMATIONS ---- */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.35s ease, transform 0.35s ease; will-change: opacity, transform; contain: layout, paint; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 20px; display: flex; align-items: center; gap: 10px;
  font-size: 0.875rem; z-index: 9999;
  transform: translateY(100px); opacity: 0;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1); max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

/* ---- GLASS CARD ---- */
.glass-card {
  background: rgba(4, 13, 28, 0.6);
  border: 1px solid var(--border-accent);
  border-radius: 10px;
}
/* Backdrop filter: desktop only (expensive for mobile GPU) */
@media (min-width: 1025px) {
  .glass-card {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
}

/* ────────────────────────────────────────────
   PROMOTIONAL SLIDESHOW (Store Page)
   ──────────────────────────────────────────── */
.promo-slideshow-container {
  margin: 32px 0;
  width: 100%;
}

.promo-slideshow-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.promo-slides-track {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  flex: 1;
}

.promo-slides-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.promo-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.promo-slide.active {
  opacity: 1;
}

.promo-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.promo-slide-nav {
  position: relative;
  z-index: 20;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.promo-slide-nav:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--border-accent);
  transform: scale(1.05);
}

.promo-slide-prev {
  margin-left: 8px;
}

.promo-slide-next {
  margin-right: 8px;
}

.promo-slide-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.promo-slide-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.promo-slide-indicator.active {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  border-color: var(--accent);
}

.promo-slide-indicator:hover {
  background: rgba(59, 130, 246, 0.5);
}
