/* ============================================
   Offers Theme - Waleed Toys
   General sales / offers theme in the brand logo colors
   (red #F3331D, yellow #F5E54F, blue #3CB3E4)
   ============================================ */

:root {
  --of-red: #F3331D;
  --of-red-dark: #C8220F;
  --of-yellow: #F5E54F;
  --of-yellow-dark: #E0CB1F;
  --of-blue: #3CB3E4;
  --of-blue-dark: #1E8FC0;
  --of-ink: #1F2A37;
  --of-white: #FFFFFF;
}

.offers-theme {
  position: relative;
}

/* ---- Subtle brand-dot background ---- */
.of-bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.07;
  background-image:
    radial-gradient(circle at 20% 20%, var(--of-red) 2px, transparent 2.5px),
    radial-gradient(circle at 60% 55%, var(--of-yellow-dark) 2px, transparent 2.5px),
    radial-gradient(circle at 85% 85%, var(--of-blue) 2px, transparent 2.5px);
  background-size: 70px 70px;
}

/* ---- Top offers banner ---- */
.of-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  background: linear-gradient(90deg, var(--of-blue-dark) 0%, var(--of-blue) 50%, var(--of-blue-dark) 100%);
  color: var(--of-white) !important;
  text-align: center;
  padding: 9px 16px;
  font-size: 15px;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  z-index: 1040;
  text-decoration: none !important;
  border-bottom: 3px solid var(--of-yellow);
}

.of-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: ofBannerShine 3.5s ease-in-out infinite;
}

@keyframes ofBannerShine {
  0% { left: -50%; }
  100% { left: 150%; }
}

.of-banner-text,
.of-banner-cta {
  position: relative;
  z-index: 1;
}

.of-banner-pct {
  display: inline-block;
  background: var(--of-red);
  color: var(--of-white);
  padding: 1px 9px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(200, 34, 15, 0.35);
  animation: ofPulse 1.8s ease-in-out infinite;
}

.of-banner-cta {
  background: var(--of-yellow);
  color: var(--of-ink);
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.2s ease;
}

.of-banner:hover .of-banner-cta {
  transform: scale(1.06);
}

@keyframes ofPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ---- Floating discount tags on the page sides ---- */
.of-tags {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.of-tag {
  position: absolute;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--of-white);
  opacity: 0.22;
  animation: ofFloat 7s ease-in-out infinite;
}

.of-tag:nth-child(3n+1) { background: var(--of-red); }
.of-tag:nth-child(3n+2) { background: var(--of-blue); }
.of-tag:nth-child(3n)   { background: var(--of-yellow-dark); color: var(--of-ink); }

.of-tag:nth-child(1) { top: 22%; left: 1.5%; animation-delay: 0s; }
.of-tag:nth-child(2) { top: 48%; left: 2.5%; animation-delay: 1.4s; }
.of-tag:nth-child(3) { top: 74%; left: 1%;   animation-delay: 2.8s; }
.of-tag:nth-child(4) { top: 28%; right: 1.5%; animation-delay: 0.7s; }
.of-tag:nth-child(5) { top: 56%; right: 2.5%; animation-delay: 2.1s; }
.of-tag:nth-child(6) { top: 80%; right: 1%;  animation-delay: 3.5s; }

@keyframes ofFloat {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}

/* ---- Product cards: red discount badge, brand hover ---- */
.offers-theme .product-card:hover {
  border-color: var(--of-blue) !important;
  box-shadow: 0 10px 28px rgba(60, 179, 228, 0.22) !important;
}

.offers-theme .product-card .discount-badge {
  background: var(--of-red) !important;
  color: var(--of-white) !important;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(243, 51, 29, 0.4);
  animation: ofPulse 2s ease-in-out infinite;
}

.offers-theme .product-card .current-price {
  color: var(--of-red);
}

/* ---- Offers popup ---- */
.of-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.of-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.of-popup {
  background: var(--of-white);
  border-radius: 20px;
  padding: 44px 32px 30px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  transition: transform 0.35s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.of-popup-overlay.active .of-popup {
  transform: scale(1) translateY(0);
}

/* Three-color logo stripe across the top */
.of-popup-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  display: flex;
}

.of-popup-stripe span { flex: 1; }
.of-popup-stripe span:nth-child(1) { background: var(--of-red); }
.of-popup-stripe span:nth-child(2) { background: var(--of-yellow); }
.of-popup-stripe span:nth-child(3) { background: var(--of-blue); }

.of-popup-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #F1F3F5;
  color: var(--of-ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.of-popup-close:hover {
  background: #E2E6EA;
}

.of-popup-badge {
  width: 118px;
  height: 118px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--of-red);
  color: var(--of-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 6px solid var(--of-yellow);
  box-shadow: 0 0 0 6px rgba(60, 179, 228, 0.35), 0 10px 24px rgba(243, 51, 29, 0.35);
  animation: ofPulse 2.2s ease-in-out infinite;
}

.of-popup-badge-small {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.of-popup-badge-big {
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
}

.of-popup-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--of-blue-dark);
  margin-bottom: 6px;
}

.of-popup-subtitle {
  display: inline-block;
  font-size: 16px;
  font-weight: 800;
  color: var(--of-ink);
  background: linear-gradient(transparent 55%, rgba(245, 229, 79, 0.75) 55%);
  padding: 0 4px;
  margin-bottom: 14px;
}

.of-popup-message {
  font-size: 14px;
  line-height: 1.8;
  color: #4B5563;
  margin-bottom: 22px;
}

.of-popup-btn {
  display: inline-block;
  background: var(--of-red);
  color: var(--of-white) !important;
  font-weight: 800;
  font-size: 16px;
  padding: 12px 36px;
  border-radius: 999px;
  text-decoration: none !important;
  box-shadow: 0 6px 18px rgba(243, 51, 29, 0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}

.of-popup-btn:hover {
  background: var(--of-red-dark);
  transform: translateY(-2px);
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
  .of-tag {
    font-size: 11px;
    padding: 4px 8px;
    opacity: 0.16;
  }
}

@media (max-width: 767px) {
  .of-banner {
    font-size: 13px;
    padding: 7px 10px;
  }
  .of-banner-cta {
    font-size: 12px;
  }
  .of-tags {
    display: none;
  }
  .of-bg-pattern {
    opacity: 0.04;
  }
  .of-popup {
    padding: 38px 22px 24px;
  }
  .of-popup-badge {
    width: 100px;
    height: 100px;
  }
  .of-popup-badge-big {
    font-size: 32px;
  }
  .of-popup-title {
    font-size: 24px;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .of-banner::before,
  .of-banner-pct,
  .of-tag,
  .of-popup-badge,
  .offers-theme .product-card .discount-badge {
    animation: none !important;
  }
  .of-banner::before {
    display: none;
  }
}
