/* ============================================================
 *  TECH ZONE — featured-carousel.css
 *  Auto-scrolling featured products carousel with hover/touch
 *  support. Matches the orange/red brand palette exactly.
 *  Load AFTER all other stylesheets in <head>.
 * ============================================================ */

/* ── Section wrapper ─────────────────────────────────────── */
.tz-featured-section {
  padding: 40px 0 48px;
  background: #fff;
  overflow: hidden;
}

.tz-featured-section .tz-featured-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 var(--container-pad, 16px);
  max-width: var(--container-max, 1280px);
  margin-left: auto;
  margin-right: auto;
}

.tz-featured-section .tz-featured-header h2 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 800;
  color: #1f2937;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tz-featured-section .tz-featured-header h2 .tz-feat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #ff7a00, #e56700);
  border-radius: 8px;
  color: #fff;
  flex-shrink: 0;
}

.tz-featured-section .tz-featured-header a {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ff7a00;
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}
.tz-featured-section .tz-featured-header a:hover { color: #e56700; }

/* ── Carousel track wrapper ──────────────────────────────── */
.tz-feat-carousel-outer {
  position: relative;
  overflow: hidden;
  /* subtle fade edges */
  -webkit-mask-image: linear-gradient(90deg,
    transparent 0%,
    #000 3%,
    #000 97%,
    transparent 100%
  );
  mask-image: linear-gradient(90deg,
    transparent 0%,
    #000 3%,
    #000 97%,
    transparent 100%
  );
}

/* On mobile hide the edge fade so arrows still sit flush */
@media (max-width: 600px) {
  .tz-feat-carousel-outer {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.tz-feat-track-wrap {
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.tz-feat-track-wrap.is-dragging { cursor: grabbing; }

.tz-feat-track {
  display: flex;
  gap: 18px;
  width: max-content;
  will-change: transform;
  transition: transform 0s linear; /* JS overrides this */
  padding: 12px 0 20px;
}

/* ── Individual product card ─────────────────────────────── */
.tz-feat-card {
  flex: 0 0 220px;
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.07),
    0 0 0 1px rgba(0,0,0,0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition:
    transform 0.35s cubic-bezier(.25,.8,.25,1),
    box-shadow 0.35s cubic-bezier(.25,.8,.25,1);
  will-change: transform;
}

/* ── Card sizes at different breakpoints ─────────────────── */
@media (min-width: 480px) { .tz-feat-card { flex: 0 0 230px; } }
@media (min-width: 768px) { .tz-feat-card { flex: 0 0 248px; } }
@media (min-width: 1200px) { .tz-feat-card { flex: 0 0 260px; } }

/* ── Card hover / active states ──────────────────────────── */
.tz-feat-card:hover,
.tz-feat-card.is-active {
  transform: translateY(-6px) scale(1.018);
  box-shadow:
    0 16px 40px rgba(255,122,0,0.18),
    0 4px 12px rgba(0,0,0,0.1),
    0 0 0 2px rgba(255,122,0,0.25);
  z-index: 3;
}

/* ── Featured badge (top-left corner) ───────────────────── */
.tz-feat-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: linear-gradient(90deg, #ff7a00, #e56700);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(255,122,0,0.4);
}
.tz-feat-badge svg { width: 9px; height: 9px; }

/* ── Discount badge (top-right) ──────────────────────────── */
.tz-feat-discount {
  position: absolute;
  top: 10px; right: 10px;
  background: #e02020;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  z-index: 4;
  letter-spacing: 0.2px;
}

/* ── Image area ──────────────────────────────────────────── */
.tz-feat-card__img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f8f8f8;
  overflow: hidden;
}
.tz-feat-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(.25,.8,.25,1);
}
.tz-feat-card:hover .tz-feat-card__img-wrap img,
.tz-feat-card.is-active .tz-feat-card__img-wrap img {
  transform: scale(1.07);
}

/* ── Quick-view overlay (appears on hover/tap) ───────────── */
.tz-feat-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(31, 41, 55, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  gap: 10px;
}
.tz-feat-card:hover .tz-feat-card__overlay,
.tz-feat-card.is-active .tz-feat-card__overlay {
  opacity: 1;
}

.tz-feat-overlay-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s;
  white-space: nowrap;
  transform: translateY(10px);
  transition: transform 0.3s cubic-bezier(.25,.8,.25,1), background 0.2s;
}
.tz-feat-card:hover .tz-feat-overlay-btn,
.tz-feat-card.is-active .tz-feat-overlay-btn {
  transform: translateY(0);
}
.tz-feat-overlay-btn:nth-child(2) {
  transition-delay: 0.06s;
}

.tz-feat-overlay-btn--view {
  background: #ff7a00;
  color: #fff;
}
.tz-feat-overlay-btn--view:hover { background: #e56700; color: #fff; }

.tz-feat-overlay-btn--wishlist {
  background: rgba(255,255,255,0.92);
  color: #1f2937;
}
.tz-feat-overlay-btn--wishlist:hover { background: #fff; }
.tz-feat-overlay-btn--wishlist.active {
  background: #fff0f0;
  color: #e02020;
}

.tz-feat-overlay-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Body ────────────────────────────────────────────────── */
.tz-feat-card__body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 5px;
}

.tz-feat-card__cat {
  font-size: 0.65rem;
  font-weight: 600;
  color: #ff7a00;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tz-feat-card__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}
.tz-feat-card__name:hover { color: #ff7a00; }

.tz-feat-card__desc {
  font-size: 0.73rem;
  color: #6b7280;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;

  /* Hidden by default, revealed on hover */
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.35s cubic-bezier(.25,.8,.25,1),
    opacity 0.3s ease;
}
.tz-feat-card:hover .tz-feat-card__desc,
.tz-feat-card.is-active .tz-feat-card__desc {
  max-height: 60px;
  opacity: 1;
}

.tz-feat-card__price-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.tz-feat-card__price {
  font-size: 1.15rem;
  font-weight: 900;
  color: #1f2937;
  font-variant-numeric: tabular-nums;
}
.tz-feat-card__old-price {
  font-size: 0.78rem;
  color: #9ca3af;
  text-decoration: line-through;
}
.tz-feat-card__saving {
  font-size: 0.66rem;
  font-weight: 700;
  color: #16a34a;
  background: #f0fdf4;
  padding: 2px 6px;
  border-radius: 20px;
}

/* ── Cart button ─────────────────────────────────────────── */
.tz-feat-card__actions {
  margin-top: 12px;
  display: flex;
  gap: 7px;
  align-items: center;
}

.tz-feat-btn-cart {
  flex: 1;
  background: linear-gradient(90deg, #ff7a00 0%, #e56700 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition:
    background 0.2s,
    transform 0.15s,
    box-shadow 0.2s;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(255,122,0,0.28);
}
.tz-feat-btn-cart:hover {
  background: linear-gradient(90deg, #e56700 0%, #cc5a00 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255,122,0,0.38);
  color: #fff;
}
.tz-feat-btn-cart svg { width: 14px; height: 14px; flex-shrink: 0; }
.tz-feat-btn-cart--oos {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: default;
  box-shadow: none;
}
.tz-feat-btn-cart--oos:hover { transform: none; box-shadow: none; }

.tz-feat-btn-wl {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #9ca3af;
}
.tz-feat-btn-wl:hover { background: #fff0f0; border-color: #fca5a5; color: #e02020; }
.tz-feat-btn-wl.active { background: #fff0f0; border-color: #fca5a5; color: #e02020; }
.tz-feat-btn-wl svg { width: 15px; height: 15px; }

/* ── Navigation arrows ───────────────────────────────────── */
.tz-feat-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #1f2937;
}
.tz-feat-nav:hover {
  background: #ff7a00;
  border-color: #ff7a00;
  color: #fff;
  box-shadow: 0 6px 20px rgba(255,122,0,0.35);
}
.tz-feat-nav--prev { left: 6px; }
.tz-feat-nav--next { right: 6px; }
.tz-feat-nav svg { width: 18px; height: 18px; }
.tz-feat-nav:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 600px) {
  .tz-feat-nav { display: none; }
}

/* ── Dot indicators ──────────────────────────────────────── */
.tz-feat-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.tz-feat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  padding: 0;
  flex-shrink: 0;
}
.tz-feat-dot.active {
  background: #ff7a00;
  width: 22px;
  border-radius: 20px;
}

/* ── Pause indicator ─────────────────────────────────────── */
.tz-feat-pause-hint {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,122,0,0.9);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 20;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.tz-feat-carousel-outer.is-paused .tz-feat-pause-hint {
  opacity: 1;
}

/* ── Skeleton loader ─────────────────────────────────────── */
@keyframes tz-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.tz-feat-card--skeleton .tz-feat-card__img-wrap,
.tz-feat-card--skeleton .tz-feat-card__body {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: tz-shimmer 1.4s infinite linear;
}
.tz-feat-card--skeleton .tz-feat-card__img-wrap {
  min-height: 220px;
}
.tz-feat-card--skeleton .tz-feat-card__body {
  min-height: 130px;
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .tz-feat-track,
  .tz-feat-card,
  .tz-feat-card__img-wrap img,
  .tz-feat-card__overlay,
  .tz-feat-card__desc,
  .tz-feat-overlay-btn {
    transition: none !important;
    animation: none !important;
  }
}
