/********** tv.css — Mega Fresh Carolina TV Display Mode **********/
/* Optimized for Samsung TV (Tizen), 1920×1080, no backdrop-filter */

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

body.tv-mode {
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  background: #0A0A0A;
  color: #fff;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Header Bar (76px) ── */
#tv-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  background: #CC0000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 100;
  box-shadow: 0 3px 16px rgba(0,0,0,0.5);
}
#tv-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
#tv-logo img {
  height: 50px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
}
#tv-logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.1;
}
#tv-logo-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  font-weight: 600;
  letter-spacing: 0.04em;
}
#tv-clock {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* ── Slides Container — exactly between header (76px) and ticker (52px) ── */
#tv-slides {
  position: fixed;
  top: 76px;
  left: 0;
  right: 0;
  bottom: 52px;
  overflow: hidden;
}

.tv-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}
.tv-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Slide: Hero Promo ── */
.tv-slide-hero {
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6B0000 0%, #CC0000 50%, #e53935 100%);
  position: relative;
  overflow: hidden;
}
.tv-slide-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 50%, rgba(255,255,255,0.07), transparent 60%);
  pointer-events: none;
}
.tv-hero-content {
  text-align: center;
  z-index: 2;
  padding: 40px 80px;
  max-width: 900px;
}
.tv-hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 8px 24px;
  border-radius: 50px;
  margin-bottom: 28px;
}
.tv-hero-title {
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.08;
  margin-bottom: 20px;
}
.tv-hero-subtitle {
  font-size: clamp(1.2rem, 2.2vw, 1.9rem);
  color: rgba(255,255,255,0.82);
  font-weight: 600;
}

/* ── Slide: Deal Cards Grid ── */
.tv-slide-deals {
  background: #111;
  padding: 32px 48px 28px;
  height: 100%;
}
.tv-slide-title {
  font-size: 1.7rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.tv-slide-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 32px;
  background: #CC0000;
  border-radius: 3px;
  flex-shrink: 0;
}
/* Height: 100% minus title row (~70px) */
.tv-deals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr;
  gap: 20px;
  height: calc(100% - 70px);
}
.tv-deal-card {
  background: #1C1C1C;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.tv-deal-card img {
  width: 100%;
  height: 52%;
  object-fit: cover;
  background: #222;
  flex-shrink: 0;
}
.tv-deal-card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tv-deal-cat {
  font-size: 0.78rem;
  color: #888;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}
.tv-deal-name {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  flex-grow: 1;
  margin-bottom: 10px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tv-deal-price {
  font-size: 1.9rem;
  font-weight: 900;
  color: #CC0000;
  line-height: 1;
}
.tv-deal-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #CC0000;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 50px;
}
.tv-deal-badge.cold { background: #1565C0; }

/* ── Slide: Categories ── */
.tv-slide-categories {
  background: #0D0D0D;
  padding: 32px 48px 28px;
  height: 100%;
}
.tv-cats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 18px;
  height: calc(100% - 70px);
}
.tv-cat-card {
  background: #1C1C1C;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 28px;
}
.tv-cat-card img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 10px;
  background: #2a2a2a;
  padding: 8px;
  flex-shrink: 0;
}
.tv-cat-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.tv-cat-desc {
  font-size: 0.85rem;
  color: #777;
  margin-top: 5px;
  line-height: 1.3;
}

/* ── Bottom Ticker (52px) ── */
#tv-ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: #141414;
  border-top: 3px solid #CC0000;
  overflow: hidden;
  display: flex;
  align-items: center;
  z-index: 100;
}
.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker-scroll 30s linear infinite;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.72);
  font-weight: 600;
}
.ticker-track span { padding: 0 48px; }
.ticker-track i { color: #CC0000; margin-right: 8px; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Progress Dots — vertically centered within slide area ── */
#tv-dots {
  position: fixed;
  top: calc(76px + (100vh - 76px - 52px) / 2);
  right: 20px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99;
}
.tv-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transition: background 0.3s, transform 0.3s;
}
.tv-dot.active {
  background: #CC0000;
  transform: scale(1.5);
}

/* ── Fullscreen hint ── */
#tv-fullscreen-hint {
  position: fixed;
  bottom: 60px;
  right: 20px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.28);
  pointer-events: none;
  letter-spacing: 0.04em;
}
