/**
 * Kokh Al-Mooneh Supermarket - Offers Flyer & Top Announcement Bar Styles
 */

/* ==========================================================================
   Critical Top Announcement Bar Styles (Guaranteed No Unstyled Flash)
   ========================================================================== */
#kookhAnnouncementBar {
  background: linear-gradient(90deg, #064e3b 0%, #065f46 45%, #047857 100%) !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.4) !important;
  color: #ffffff !important;
  position: relative !important;
  z-index: 1001 !important;
  font-family: inherit !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12) !important;
  transition: all 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: hidden !important;
  direction: rtl !important;
}

.kookh-ann-dismissing {
  max-height: 0 !important;
  opacity: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-bottom-width: 0 !important;
  box-shadow: none !important;
}

.kookh-announcement-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  padding: 8px 0 !important;
  min-height: 44px !important;
}

.kookh-announcement-content {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.kookh-announcement-badge {
  background: rgba(245, 158, 11, 0.22) !important;
  border: 1px solid rgba(245, 158, 11, 0.55) !important;
  color: #fef08a !important;
  border-radius: 9999px !important;
  padding: 4px 12px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.kookh-announcement-dot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  background: #f59e0b !important;
  position: relative !important;
  display: inline-block !important;
}

.kookh-announcement-dot::after {
  content: '' !important;
  position: absolute !important;
  top: -2px !important;
  left: -2px !important;
  right: -2px !important;
  bottom: -2px !important;
  border-radius: 50% !important;
  background: rgba(245, 158, 11, 0.5) !important;
  animation: kookhPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
}

.kookh-announcement-ticker {
  position: relative !important;
  overflow: hidden !important;
  height: 26px !important;
  display: flex !important;
  align-items: center !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.kookh-announcement-slide {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(14px) !important;
  transition: opacity 0.35s ease, transform 0.35s ease !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.kookh-announcement-slide.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
  position: relative !important;
}

.kookh-announcement-text-link {
  color: #f8fafc !important;
  text-decoration: none !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  display: inline-block !important;
  cursor: pointer !important;
}

.kookh-announcement-text-link:hover {
  color: #fef08a !important;
  text-decoration: underline !important;
}

.kookh-announcement-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
}

.kookh-announcement-btn {
  background: #f59e0b !important;
  color: #78350f !important;
  border: none !important;
  border-radius: 9999px !important;
  padding: 5px 14px !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
}

.kookh-announcement-btn:hover {
  background: #fbbf24 !important;
  color: #451a03 !important;
  transform: translateY(-1px) !important;
}

.kookh-announcement-close {
  background: rgba(255, 255, 255, 0.12) !important;
  border: none !important;
  color: #cbd5e1 !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
}

.kookh-announcement-close:hover {
  background: rgba(239, 68, 68, 0.85) !important;
  color: #ffffff !important;
}

/* ==========================================================================
   Navbar & Floating Flyer Badges
   ========================================================================== */
.kookh-nav-flyer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(16, 185, 129, 0.15));
  border: 1.5px solid #f59e0b;
  color: #d97706;
  padding: 7px 14px;
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  white-space: nowrap;
}

.kookh-nav-flyer-btn:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.kookh-nav-pulse-dot {
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  right: 6px;
  animation: kookhPulse 1.8s infinite;
}

/* Floating Flyer Pill on Mobile & Desktop */
.kookh-floating-flyer-pill {
  position: fixed;
  bottom: 95px;
  inset-inline-start: 20px;
  z-index: 9999;
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
  color: #ffffff;
  border: 1.5px solid #f59e0b;
  border-radius: 9999px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(6, 78, 59, 0.35), 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: bottom 0.3s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  user-select: none;
  animation: kookhFloatGentle 3s ease-in-out infinite;
}

.kookh-floating-flyer-pill:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 28px rgba(6, 78, 59, 0.45);
}

.kookh-floating-flyer-icon {
  width: 32px;
  height: 32px;
  background: #f59e0b;
  color: #78350f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.kookh-floating-flyer-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.kookh-floating-flyer-badge {
  font-size: 0.68rem;
  color: #fef08a;
  font-weight: 700;
}

.kookh-floating-flyer-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
}

.kookh-floating-flyer-dismiss {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  margin-inline-start: 6px;
  padding: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.kookh-floating-flyer-dismiss:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.15);
}

@keyframes kookhFloatGentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ==========================================================================
   Offers Flyer Interactive Viewer Modal
   ========================================================================== */
.kookh-flyer-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 12px calc(env(safe-area-inset-bottom, 0px) + 16px) 12px;
  animation: kookhFadeIn 0.24s ease-out;
  direction: rtl;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.kookh-flyer-modal-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 900px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: kookhModalPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

/* Modal Header */
.kookh-flyer-modal-header {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 60%, #047857 100%);
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid #f59e0b;
}

.kookh-flyer-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.kookh-flyer-modal-icon {
  width: 38px;
  height: 38px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.kookh-flyer-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kookh-flyer-valid-badge {
  display: none !important;
}

.kookh-flyer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.kookh-flyer-header-btn {
  display: none !important;
}

.kookh-flyer-header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.kookh-flyer-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  line-height: 1;
}

.kookh-flyer-close-btn:hover {
  background: rgba(239, 68, 68, 0.9);
  transform: scale(1.08);
}

/* Modal Body / Viewer Stage */
.kookh-flyer-stage-wrap {
  position: relative;
  background: #0f172a;
  flex: 1;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.kookh-flyer-img-stage {
  width: 100%;
  height: 100%;
  max-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
}

.kookh-flyer-img-stage.wrap-zoomed {
  overflow: auto;
  cursor: zoom-out;
}

.kookh-flyer-main-img {
  max-width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease-out;
}

.kookh-flyer-main-img.is-zoomed {
  max-width: none;
  max-height: none;
  width: 160%;
  transform: scale(1);
}

/* Navigation Arrows */
.kookh-flyer-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.kookh-flyer-nav-arrow:hover {
  background: #f59e0b;
  color: #78350f;
  border-color: #f59e0b;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.kookh-flyer-nav-arrow.prev {
  right: 14px;
}

.kookh-flyer-nav-arrow.next {
  left: 14px;
}

/* Page Counter Badge on Image */
.kookh-flyer-counter-badge {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 5;
  pointer-events: none;
}

/* Caption Bar */
.kookh-flyer-action-bar {
  background: #ffffff;
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.kookh-flyer-caption-wrap {
  width: 100%;
}

.kookh-flyer-caption-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 3px 0;
}

.kookh-flyer-caption-summary {
  font-size: 0.84rem;
  color: #475569;
  margin: 0;
  line-height: 1.45;
}

/* Actions Group in Viewer */
.kookh-flyer-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kookh-flyer-cart-btn {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 800;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
  transition: all 0.22s ease;
  white-space: nowrap;
}

.kookh-flyer-cart-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.45);
}

.kookh-flyer-price-tag {
  background: rgba(254, 240, 138, 0.25);
  color: #fef08a;
  border: 1px solid rgba(254, 240, 138, 0.55);
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 800;
  margin-inline-start: 4px;
}

/* Direct WhatsApp CTA Button */
.kookh-flyer-wa-btn {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.35);
  transition: all 0.22s ease;
  white-space: nowrap;
}

.kookh-flyer-wa-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
}

/* Bottom Thumbnails Strip */
.kookh-flyer-thumbs-bar {
  background: #f8fafc;
  padding: 8px 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.kookh-flyer-thumb-item {
  width: 58px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  padding: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.kookh-flyer-thumb-item:hover {
  border-color: #059669;
  transform: translateY(-2px);
}

.kookh-flyer-thumb-item.active {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4);
}

.kookh-flyer-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kookh-flyer-thumb-num {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Hide Removed Caption Bar and Thumbnails Bar */
.kookh-flyer-action-bar,
.kookh-flyer-thumbs-bar {
  display: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .kookh-flyer-modal-overlay {
    align-items: flex-start !important;
    padding-top: calc(env(safe-area-inset-top, 0px) + 52px) !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px) !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    overflow-y: auto !important;
  }
  .kookh-flyer-modal-card {
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 68px) !important;
    max-height: calc(100vh - 68px); /* Fallback */
    margin: 0 auto !important;
    border-radius: 18px;
  }
  .kookh-flyer-stage-wrap {
    min-height: 200px;
  }
  .kookh-flyer-img-stage {
    max-height: 52vh;
    padding: 6px;
  }
  .kookh-flyer-main-img {
    max-height: 50vh;
  }
  .kookh-flyer-items-shelf {
    max-height: 220px;
    padding: 10px 12px;
  }
  .kookh-flyer-nav-arrow {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }
  .kookh-flyer-nav-arrow.prev { right: 8px; }
  .kookh-flyer-nav-arrow.next { left: 8px; }
  .kookh-floating-flyer-pill {
    bottom: 85px;
    inset-inline-start: 14px;
    padding: 6px 12px;
  }
  #kookhStickyCartBar.visible ~ #kookhFloatingFlyer {
    bottom: calc(130px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .kookh-floating-flyer-icon {
    width: 28px;
    height: 28px;
    font-size: 0.82rem;
  }
}

/* Interactive Items Shelf on Flyer Page */
.kookh-flyer-items-shelf {
  background: #f8fafc;
  border-top: 1px dashed #cbd5e1;
  padding: 10px 16px;
  max-height: 160px;
  overflow-y: auto;
  overflow-x: hidden;
}

.kookh-flyer-shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 8px;
}

.kookh-flyer-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.kookh-flyer-item-pill {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.kookh-flyer-item-pill:hover {
  border-color: #10b981;
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.15);
  transform: translateY(-1px);
}

.kookh-flyer-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

.kookh-flyer-item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.kookh-flyer-item-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.kookh-flyer-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kookh-flyer-item-price {
  font-size: 0.82rem;
  font-weight: 800;
  color: #059669;
}

.kookh-flyer-item-unit {
  font-size: 0.72rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
}

.kookh-flyer-item-add-btn {
  background: #059669;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.18s ease;
  font-family: inherit;
  flex-shrink: 0;
}

.kookh-flyer-item-add-btn:hover {
  background: #047857;
  transform: scale(1.04);
}

.kookh-flyer-item-add-btn.vet-btn-added {
  background: #10b981 !important;
}

/* In-Flyer Stepper & Action Wrap */
.kookh-flyer-item-action-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-inline-start: auto;
}

.kookh-flyer-item-action-wrap .kookh-card-stepper {
  height: 32px;
  padding: 2px 4px;
  gap: 5px;
  border-radius: 8px;
  background: #f0fdf4;
  border: 1.5px solid #16a34a;
  box-shadow: 0 1px 4px rgba(22, 163, 74, 0.15);
  display: inline-flex;
  align-items: center;
}

.kookh-flyer-item-action-wrap .kookh-stepper-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #15803d;
  color: #ffffff;
  border: none;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.kookh-flyer-item-action-wrap .kookh-stepper-btn:hover {
  background: #166534;
  transform: scale(1.08);
}

.kookh-flyer-item-action-wrap .kookh-stepper-val {
  font-size: 0.88rem;
  font-weight: 800;
  color: #14532d;
  min-width: 18px;
  text-align: center;
}

