/* ============================================================
   RAYLOM - COMMON STYLESHEET
   Shared across all pages (Navbar, Footer, WhatsApp, Toast, etc.)
   ============================================================ */

/* ---------- ROOT VARIABLES ---------- */
:root {
  --navy: #0a1b30;
  --navy-dark: #061120;
  --navy-light: #12284c;
  --gold: #d4af37;
  --gold-light: #f3e5ab;
  --amber: #e68a00;
  --cream: #f8f9fa;
  --muted: #64748b;
  --dark: #0f172a;
  --radius: 20px;
  --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- BASE RESET ---------- */
* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--dark);
  background-color: var(--cream);
  overflow-x: hidden;
  position: relative;
  margin: 0;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-font {
  font-family: "Outfit", sans-serif;
  letter-spacing: -0.02em;
}

.serif-italic {
  font-family: "Playfair Display", serif;
  font-style: italic;
}

img {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- PARTICLES CANVAS ---------- */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

@media (max-width: 767.98px) {
  #particles-canvas {
    display: none;
  }
}

/* ---------- UTILITY ---------- */
.gold-text-gradient {
  background: linear-gradient(135deg, #fff0c2 0%, #d4af37 50%, #aa7c11 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- REVEAL ANIMATIONS ---------- */
.reveal-element {
  opacity: 0;
  transition:
    transform 0.85s var(--transition-smooth),
    opacity 0.85s var(--transition-smooth);
  will-change: transform, opacity;
}

.reveal-up {
  transform: translateY(50px);
}
.reveal-down {
  transform: translateY(-50px);
}
.reveal-left {
  transform: translateX(-50px);
}
.reveal-right {
  transform: translateX(50px);
}
.reveal-scale {
  transform: scale(0.9);
}

.reveal-element.active {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

.delay-1 {
  transition-delay: 0.08s;
}
.delay-2 {
  transition-delay: 0.16s;
}
.delay-3 {
  transition-delay: 0.24s;
}
.delay-4 {
  transition-delay: 0.32s;
}
.delay-5 {
  transition-delay: 0.4s;
}
.delay-6 {
  transition-delay: 0.48s;
}

/* ---------- ANNOUNCEMENT BAR ---------- */
.announcement-bar {
  background-color: var(--navy-dark);
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 9px 0;
  letter-spacing: 0.4px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  position: relative;
  z-index: 1040;
}

.announcement-bar i {
  color: var(--gold);
}

@media (max-width: 575.98px) {
  .announcement-bar {
    font-size: 0.68rem;
    padding: 7px 0;
  }
}

/* ---------- NAVBAR ---------- */
.navbar-main {
  padding: 14px 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 1030;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  box-shadow: 0 4px 20px rgba(10, 27, 48, 0.04);
}

.brand-logo {
  display: inline-block;
  text-decoration: none;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
}

.nav-link {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--navy) !important;
  padding: 0.5rem 0.9rem !important;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 2px;
  left: 50%;
  background: linear-gradient(90deg, var(--gold), var(--amber));
  transition: 0.3s;
  transform: translateX(-50%);
  border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 70%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--amber) !important;
}

.nav-currency-btn {
  background: rgba(10, 27, 48, 0.04);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  color: var(--navy);
  padding: 6px 14px;
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s;
}

.nav-currency-btn:hover {
  background: var(--navy);
  color: var(--gold);
  border-color: var(--gold);
}

.currency-dropdown-menu {
  background: var(--navy-dark);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 14px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  padding: 8px;
  min-width: 220px;
  z-index: 1050;
}

.currency-dropdown-item {
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.currency-dropdown-item:hover,
.currency-dropdown-item.active {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-light);
}

.price-updating {
  opacity: 0.3;
  transform: translateY(-2px);
  transition: all 0.15s;
}

.action-icon-btn {
  position: relative;
  background: transparent;
  border: 1px solid rgba(10, 27, 48, 0.1);
  color: var(--navy);
  font-size: 1.1rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
}

.action-icon-btn:hover {
  background: var(--navy);
  color: var(--gold);
  transform: translateY(-3px);
  border-color: var(--navy);
}

.badge-count {
  position: absolute;
  top: -3px;
  right: -3px;
  background: linear-gradient(135deg, var(--amber), var(--gold));
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 40px;
  min-width: 18px;
  text-align: center;
}

.user-profile-btn {
  background: linear-gradient(135deg, var(--gold), var(--amber));
  color: var(--navy-dark);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.25s;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.user-profile-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.5);
  color: var(--navy-dark);
}

/* Mobile navbar fixes */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    margin-top: 12px;
    box-shadow: 0 10px 30px rgba(10, 27, 48, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.15);
  }

  .navbar-nav {
    gap: 0 !important;
  }

  .nav-link {
    padding: 0.7rem 0.9rem !important;
  }
}

@media (max-width: 575.98px) {
  .brand-logo-img {
    height: 38px;
  }

  .action-icon-btn,
  .user-profile-btn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .nav-currency-btn {
    padding: 5px 10px;
    font-size: 0.7rem;
  }
}

/* ---------- FOOTER ---------- */
footer {
  background: var(--navy-dark);
  color: #fff;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  position: relative;
  z-index: 2;
}

footer a.text-secondary {
  color: #94a3b8 !important;
  transition: 0.2s;
}

footer a.text-secondary:hover {
  color: var(--gold) !important;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-size: 1.1rem;
  transition: 0.3s;
  text-decoration: none;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.social-link:hover {
  background: var(--gold);
  color: var(--navy-dark);
  transform: translateY(-4px) scale(1.05);
}

.social-link.noon-link {
  background: #feee00;
  color: #000;
  border-color: #feee00;
  font-weight: 800;
  font-size: 0.68rem;
  width: auto;
  padding: 0 14px;
  border-radius: 40px;
}

.social-link.noon-link:hover {
  background: #e6d600;
  color: #000;
}

@media (max-width: 575.98px) {
  .social-link {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .social-link.noon-link {
    font-size: 0.6rem;
    padding: 0 10px;
    height: 36px;
  }
}

/* ---------- CART ITEM IMAGE (shared) ---------- */
.cart-item-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 6px;
}

@media (max-width: 575.98px) {
  .cart-item-img {
    width: 48px;
    height: 48px;
  }
}

/* ---------- TOAST ---------- */
.custom-toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 1090;
  background: var(--navy-dark);
  border: 1px solid var(--gold);
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  font-size: 0.85rem;
  max-width: 340px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.custom-toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 575.98px) {
  .custom-toast {
    bottom: 90px;
    right: 12px;
    left: 12px;
    max-width: none;
    font-size: 0.78rem;
  }
}

/* ---------- BACK TO TOP ---------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 1020;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--gold);
  color: var(--navy);
  transform: translateY(-4px);
}

@media (max-width: 575.98px) {
  .back-to-top {
    bottom: 90px;
    left: 16px;
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }
}

/* ============================================================
   WHATSAPP CHAT SYSTEM (shared across all pages)
   ============================================================ */
.wa-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1094;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  pointer-events: none;
}

.wa-launcher > * {
  pointer-events: auto;
}

.wa-teaser {
  background: #fff;
  border-radius: 16px 16px 4px 16px;
  padding: 14px 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  max-width: 260px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: all 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: bottom right;
}

.wa-teaser.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.wa-teaser-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.wa-teaser-title {
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-teaser-title i {
  color: #25d366;
  font-size: 1rem;
}

.wa-teaser-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
}

.wa-teaser-body {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.wa-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(145deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.5);
  transition: all 0.35s;
  animation: waFabPulse 2.6s infinite;
  position: relative;
}

.wa-fab:hover {
  transform: scale(1.08) rotate(6deg);
}

.wa-fab::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.4);
  animation: waFabRing 2.6s infinite;
}

.wa-fab .wa-online-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 13px;
  height: 13px;
  background: #25d366;
  border: 2.5px solid #fff;
  border-radius: 50%;
}

@keyframes waFabPulse {
  0%,
  100% {
    box-shadow:
      0 10px 30px rgba(37, 211, 102, 0.5),
      0 0 0 0 rgba(37, 211, 102, 0.5);
  }
  50% {
    box-shadow:
      0 10px 30px rgba(37, 211, 102, 0.5),
      0 0 0 14px rgba(37, 211, 102, 0);
  }
}

@keyframes waFabRing {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.wa-fab.hidden {
  transform: scale(0.4) rotate(-45deg);
  opacity: 0;
  pointer-events: none;
  animation: none;
}

.wa-window {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 600px;
  max-height: calc(100vh - 60px);
  background: #fff;
  border-radius: 20px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(212, 175, 55, 0.15);
  z-index: 1096;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.94);
  transform-origin: bottom right;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wa-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.wa-header {
  background: linear-gradient(135deg, #075e54 0%, #128c7e 55%, #25d366 130%);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.wa-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff 0%, #e8f5e9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #128c7e;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.wa-header-info {
  flex-grow: 1;
  min-width: 0;
}

.wa-header-info h6 {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.wa-header-info span {
  font-size: 0.7rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
}

.wa-header-info span::before {
  content: "";
  width: 7px;
  height: 7px;
  background: #a7f3d0;
  border-radius: 50%;
}

.wa-header-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
}

.wa-header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.wa-body {
  background: #ece5dd;
  padding: 16px 14px;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-date-divider {
  align-self: center;
  background: #fff;
  color: #667781;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.wa-msg {
  max-width: 82%;
  padding: 9px 13px 7px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: waMsgIn 0.35s;
  word-wrap: break-word;
}

@keyframes waMsgIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wa-msg.received {
  background: #fff;
  color: #1f2937;
  align-self: flex-start;
  border-top-left-radius: 3px;
}

.wa-msg.sent {
  background: #dcf8c6;
  color: #1f2937;
  align-self: flex-end;
  border-top-right-radius: 3px;
}

.wa-msg .wa-msg-time {
  display: flex;
  font-size: 0.6rem;
  color: #667781;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 3px;
}

.wa-msg .wa-ticks {
  color: #34b7f1;
  font-size: 0.7rem;
}

.wa-typing {
  align-self: flex-start;
  background: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  display: flex;
  gap: 5px;
}

.wa-typing span {
  width: 7px;
  height: 7px;
  background: #909aa0;
  border-radius: 50%;
  animation: waTyping 1.4s infinite;
}

.wa-typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.wa-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes waTyping {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.wa-quick-replies {
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.wa-quick-replies::-webkit-scrollbar {
  display: none;
}

.wa-qr-btn {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.wa-qr-btn:hover {
  background: #dcf8c6;
  border-color: #25d366;
  color: #075e54;
}

.wa-footer {
  background: #f0f2f5;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.wa-input-wrap {
  flex-grow: 1;
  position: relative;
}

.wa-input {
  width: 100%;
  border: none;
  border-radius: 24px;
  padding: 11px 42px 11px 16px;
  font-size: 0.85rem;
  outline: none;
  background: #fff;
}

.wa-emoji-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #8696a0;
  font-size: 1.05rem;
  cursor: pointer;
}

.wa-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, #25d366 0%, #128c7e 100%);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.wa-send:hover {
  transform: scale(1.06);
}

.wa-send:disabled {
  opacity: 0.5;
}

.wa-continue-cta {
  align-self: center;
  margin: 6px 0;
}

.wa-continue-cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(145deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.wa-continue-cta a:hover {
  transform: translateY(-2px);
  color: #fff;
}

@media (max-width: 575.98px) {
  .wa-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    bottom: 16px;
    right: 10px;
    border-radius: 16px;
  }

  .wa-launcher {
    bottom: 20px;
    right: 20px;
  }

  .wa-fab {
    width: 56px;
    height: 56px;
    font-size: 1.6rem;
  }

  .wa-teaser {
    max-width: 220px;
    padding: 12px 14px;
  }
}

/* ---------- SKELETON LOADING ---------- */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
