/* ==========================================================================
   MODERN ULTRA-SMART E-COMMERCE STYLES & WORLD-CLASS ANIMATIONS
   Created for Tanjil Mart / Arcyn E-Commerce Platform
   ========================================================================== */

:root {
  --brand-primary: #1e40af;
  --brand-primary-hover: #1d4ed8;
  --brand-accent: #f97316;
  --brand-accent-glow: rgba(249, 115, 22, 0.35);
  --deal-fire: #ef4444;
  --deal-fire-glow: rgba(239, 68, 68, 0.4);
  --card-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --card-shadow-hover: 0 25px 40px -12px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(37, 99, 235, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.6);
}

/* Smooth Scrolling & Typography Optimization */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    transform: scale(1.02);
  }
}

@keyframes flameBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes badgeShine {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   ENHANCED PRODUCT CARDS & 3D HOVER LIFT
   ========================================================================== */

article[data-product-id],
.product-card,
[class*="group/card"] {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  position: relative !important;
  background: #ffffff !important;
  border: 1px solid #f1f5f9 !important;
}

article[data-product-id]:hover,
.product-card:hover,
[class*="group/card"]:hover {
  transform: translateY(-7px) !important;
  box-shadow: var(--card-shadow-hover) !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
}

/* Image Zoom on Card Hover */
article[data-product-id] img,
.product-card img {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

article[data-product-id]:hover img,
.product-card:hover img {
  transform: scale(1.06) !important;
}

/* Shimmer on Hot Deal & Sale Badges */
.hot-deal-badge,
[data-deal-badge="true"],
span[class*="bg-red-"],
span[class*="bg-rose-"] {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 50%, #ef4444 100%) !important;
  background-size: 200% auto !important;
  animation: shimmer 3s infinite linear, flameBounce 2s infinite ease-in-out !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px var(--deal-fire-glow) !important;
}

/* ==========================================================================
   HOT DEAL COUNTDOWN SECTION & CARDS
   ========================================================================== */

.deal-countdown-box {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.deal-timer-unit {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
  min-width: 42px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.deal-timer-unit span:last-child {
  font-size: 9px;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Glowing Hot Deal Headline Banner */
.hot-deals-container {
  background: linear-gradient(135deg, #fff7ed 0%, #fef2f2 50%, #ffffff 100%);
  border: 1.5px solid #fed7aa;
  border-radius: 24px;
  padding: 24px;
  margin: 28px 0;
  box-shadow: 0 15px 35px -10px rgba(249, 115, 22, 0.15);
  position: relative;
  overflow: hidden;
}

.hot-deals-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f97316, #ef4444, #e11d48, #f97316);
  background-size: 200% auto;
  animation: shimmer 3s infinite linear;
}

/* ==========================================================================
   PRIMARY CTA BUTTONS & INTERACTIVE MICRO-INTERACTIONS
   ========================================================================== */

button[type="submit"],
.btn-primary,
button[style*="var(--brand-theme-color)"] {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28) !important;
}

button[type="submit"]:hover,
.btn-primary:hover,
button[style*="var(--brand-theme-color)"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.4) !important;
  filter: brightness(1.08) !important;
}

button[type="submit"]:active,
.btn-primary:active,
button[style*="var(--brand-theme-color)"]:active {
  transform: translateY(0) scale(0.98) !important;
}

/* ==========================================================================
   FLOATING WHATSAPP CHAT BUTTON (POSITIONED CLEANLY ABOVE SCROLL BUTTON)
   ========================================================================== */

#smart-whatsapp-btn {
  position: fixed !important;
  right: 24px !important;
  bottom: 86px !important; /* Perfectly positioned 14px above native scroll-to-top button */
  z-index: 99990 !important;
  width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #25D366 0%, #1ea952 100%) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.42), 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease !important;
  cursor: pointer !important;
}

#smart-whatsapp-btn:hover {
  transform: translateY(-3px) scale(1.06) !important;
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.55), 0 4px 10px rgba(0, 0, 0, 0.15) !important;
}

/* Crisp, subtle ripple ring that does NOT blur or distort */
#smart-whatsapp-btn::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #25D366;
  opacity: 0.8;
  animation: wa-clean-ripple 2.4s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

@keyframes wa-clean-ripple {
  0% {
    transform: scale(0.95);
    opacity: 0.9;
  }
  50% {
    opacity: 0.35;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

/* Hover Tooltip / Badge */
#smart-whatsapp-btn .floating-wa-tooltip {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: #0f172a;
  color: #ffffff;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}

#smart-whatsapp-btn .floating-wa-tooltip::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px 0 5px 6px;
  border-style: solid;
  border-color: transparent transparent transparent #0f172a;
}

#smart-whatsapp-btn:hover .floating-wa-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (max-width: 1024px) {
  #smart-whatsapp-btn {
    right: 16px !important;
    bottom: 144px !important;
    width: 48px !important;
    height: 48px !important;
  }
}

/* ==========================================================================
   HEADER & MOBILE NAVIGATION BAR FIX
   ========================================================================== */

header {
  background-color: #ffffff !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
  /* CRITICAL: Never apply backdrop-filter, filter, or transform to header!
     Doing so creates a containing block that traps all position:fixed children
     (the mobile bottom navigation bar and all side drawers) inside a 60px container! */
}

/* Ensure mobile bottom navigation stays pinned at the viewport bottom */
nav.app-layer-header.fixed.bottom-0,
nav.fixed.inset-x-0.bottom-0 {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  z-index: 128000 !important;
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08) !important;
}

/* Ensure mobile side drawers (All Categories, My Account, Menu) open full viewport height */
.app-layer-drawer {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 129000 !important;
  background: #ffffff !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
  display: flex !important;
  flex-direction: column !important;
}

.app-layer-drawer-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: rgba(15, 23, 42, 0.5) !important;
  z-index: 128500 !important;
}

/* Mobile search button & header enhancement */
@media (max-width: 1023px) {
  body {
    padding-bottom: 65px !important;
  }
  /* Make mobile top header clean and prominent */
  header .flex.items-center.justify-between.py-3.lg\:hidden {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
}

/* ==========================================================================
   MODAL DIALOG BACKDROP FIX (PREVENTS ACCIDENTAL DISMISSAL)
   ========================================================================== */

#easy-admin-modal-backdrop {
  user-select: auto;
}

/* Clean Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Banner Studio & Storefront Description Color Inheritance (only for nested elements inside) */
.banner-desc-preview > p,
.banner-desc-preview > span,
.banner-desc-preview > div,
.banner-desc-preview p,
.banner-desc-preview span,
.banner-desc-storefront > p,
.banner-desc-storefront > span {
  color: inherit !important;
}

/* Lucrative Modern Notifications & Order Approval Animations */
@keyframes notifFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
  animation: notifFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}



/* Mobile Top Header & Search Button Visibility */
header button[aria-label="Toggle search"] {
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}
header button[aria-label="Open menu"] {
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

/* ==========================================================================
   MOBILE ORDER TRACKING STAGES & MODAL (ZERO HORIZONTAL SCROLL)
   ========================================================================== */
@media (max-width: 768px) {
  /* 4 Equal Columns in Top Tracking Stages Bar */
  .occ-stages-bar {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    padding: 6px 0 !important;
    gap: 2px !important;
    width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  .occ-stage-col {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: 25% !important;
    max-width: 25% !important;
    padding: 0 1px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
  .occ-stage-icon-circle {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-radius: 9999px !important;
  }
  .occ-stage-icon-circle svg {
    width: 13px !important;
    height: 13px !important;
  }
  .occ-stage-label {
    font-size: 9.5px !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
    margin-top: 3px !important;
    white-space: normal !important;
    text-align: center !important;
    word-break: break-word !important;
    max-width: 100% !important;
    display: block !important;
  }
  .occ-stage-count {
    font-size: 8.5px !important;
    line-height: 1 !important;
    margin-top: 2px !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
  }

  /* 4 Equal Columns in Modal Interactive Controller */
  .occ-modal-stages-row,
  .occ-ctrl-card > div:nth-child(2) {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 2px !important;
    padding-top: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .occ-stage-step {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: 25% !important;
    max-width: 25% !important;
    padding: 0 1px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
  .occ-stage-circle,
  .occ-ctrl-card div[data-circle-stage] {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-width: 2px !important;
    box-shadow: none !important;
  }
  .occ-stage-circle svg,
  .occ-ctrl-card div[data-circle-stage] svg {
    width: 13px !important;
    height: 13px !important;
  }
  .occ-stage-title,
  .occ-stage-step > span:nth-of-type(1) {
    font-size: 9.5px !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
    margin-top: 3px !important;
    white-space: normal !important;
    text-align: center !important;
    word-break: break-word !important;
    max-width: 100% !important;
    display: block !important;
  }
  .occ-stage-badge,
  .occ-stage-step > span:nth-of-type(2) {
    font-size: 8px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    padding: 2px 4px !important;
    margin-top: 3px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    letter-spacing: -0.02em !important;
  }

  /* Modal Container on Mobile */
  #occ-manage-modal,
  .occ-modal-overlay {
    padding: 8px 4px !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  .occ-modal-box {
    width: 100% !important;
    max-width: calc(100vw - 12px) !important;
    padding: 14px 10px !important;
    border-radius: 16px !important;
    max-height: 92vh !important;
    max-height: 92dvh !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    margin: 0 auto !important;
  }
}
