/* ═══════════════════════════════════════════
   MASALLA PALACE — Custom Styles
   Royal Heritage Theme
═══════════════════════════════════════════ */

/* ── Root Variables ── */
:root {
  --royal-red: #8b1a1a;
  --royal-gold: #c9973a;
  --gold-light: #e8b94a;
  --dark-brown: #2c1a0e;
  --warm-black: #1a0a00;
  --cream: #fdf6e3;
  --text-light: #f5e6c8;
  --text-muted: #c8a96e;
}

/* ── Scrollbar Styling ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--warm-black);
}
::-webkit-scrollbar-thumb {
  background: var(--royal-gold);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}

/* ── Selection Color ── */
::selection {
  background: var(--royal-gold);
  color: var(--warm-black);
}

/* ── Base Smooth Scroll ── */
html {
  scroll-behavior: smooth;
}
* {
  box-sizing: border-box;
}

/* ── Radial Gold Gradient ── */
.bg-gradient-radial-gold {
  background: radial-gradient(
    ellipse at center,
    rgba(201, 151, 58, 0.08) 0%,
    transparent 70%
  );
}

/* ── Navbar ── */
#navbar {
  background: transparent;
  backdrop-filter: none;
}

#navbar.scrolled {
  background: rgba(26, 10, 0, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 2px 32px rgba(201, 151, 58, 0.08);
  border-bottom: 1px solid rgba(201, 151, 58, 0.15);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* ── Mobile Menu ── */
#mobile-menu {
  background: #1a0a00;
  transition: opacity 0.35s ease;
}
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

/* Hamburger → X animation */
#menu-toggle.open .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#menu-toggle.open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#menu-toggle.open .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  width: 24px;
}

/* ── Butterfly Logo Hover ── */
.butterfly-logo {
  transition: transform 0.4s ease;
}
.butterfly-logo:hover {
  transform: scale(1.1) rotate(5deg);
}

/* ── Hero Butterfly Float Animation ── */
.butterfly-float {
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(201, 151, 58, 0.4));
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(-2deg);
  }
  33% {
    transform: translateY(-12px) rotate(2deg);
  }
  66% {
    transform: translateY(-6px) rotate(-1deg);
  }
}

/* ── Hero Butterfly Wings Shimmer ── */
.hero-butterfly {
  animation: heroFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 0 16px rgba(201, 151, 58, 0.6));
}

@keyframes heroFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.03);
  }
}

/* ── Section Gold Divider ── */
.section-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--royal-gold),
    transparent
  );
  opacity: 0.4;
}

/* ── Product Cards ── */
.product-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

/* ── Promise Cards ── */
.promise-card {
  transition: all 0.35s ease;
}
.promise-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(201, 151, 58, 0.15);
}

/* ── Blog Cards ── */
.blog-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

/* ── Buttons ── */
.btn-primary,
.btn-secondary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after,
.btn-secondary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary:hover::after,
.btn-secondary:hover::after {
  opacity: 1;
}

/* ── Gold Shimmer Text Animation ── */
.shimmer-text {
  background: linear-gradient(
    90deg,
    #c9973a 0%,
    #e8b94a 40%,
    #c9973a 60%,
    #e8b94a 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: 200% center;
  }
}

/* ── Video Overlay ── */
#video-overlay {
  transition: background 0.3s ease;
}
#video-overlay.playing {
  background: transparent;
}
#video-overlay.playing #play-btn {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}
#video-overlay.playing:hover {
  background: rgba(26, 10, 0, 0.3);
}
#video-overlay.playing:hover #play-btn {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}

/* ── Testimonial Dots ── */
.slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(201, 151, 58, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  padding: 0;
}
.slide-dot.active {
  background: var(--royal-gold);
  width: 24px;
}

/* ── Form Focus Glow ── */
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(201, 151, 58, 0.15);
}

/* ── Gold Corner Frame ── */
.gold-frame {
  position: relative;
}
.gold-frame::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(201, 151, 58, 0.25);
  border-radius: 1.5rem;
  pointer-events: none;
}

/* ── Spice Particle BG (decorative dots) ── */
.spice-dots {
  background-image: radial-gradient(
    circle at 2px 2px,
    rgba(201, 151, 58, 0.06) 1px,
    transparent 0
  );
  background-size: 28px 28px;
}

/* ── Toast Notification ── */
#toast {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 100;
  background: var(--dark-brown);
  border: 1px solid var(--royal-gold);
  color: var(--text-light);
  padding: 12px 20px;
  border-radius: 12px;
  font-family: "Noto Sans Bengali", sans-serif;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(201, 151, 58, 0.2);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
#toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ── Blog Modal Scrollbar ── */
#blog-modal > div:last-child::-webkit-scrollbar {
  width: 4px;
}
#blog-modal > div:last-child::-webkit-scrollbar-thumb {
  background: var(--royal-gold);
}

/* ── Active Nav Link ── */
.nav-link.active {
  color: var(--royal-gold);
}

/* ── Responsive image ratio helpers ── */
.aspect-square {
  aspect-ratio: 1 / 1;
}
.aspect-video {
  aspect-ratio: 16 / 9;
}

/* ── AOS Overrides for performance ── */
[data-aos] {
  will-change: transform, opacity;
}

/* ── Print hide heavy elements ── */
@media print {
  video,
  #float-whatsapp,
  #navbar {
    display: none;
  }
}

/* ── Prevent iOS auto-zoom on input focus (font must be ≥16px) ── */
input,
select,
textarea {
  font-size: 16px;
}

/* ── Min touch target size for all interactive elements ── */
a,
button,
[role="button"] {
  min-height: 44px;
}
nav a,
footer a {
  min-height: unset; /* nav/footer links can be smaller — they're not primary CTA */
}

/* ── Reduced motion support ── */
@media (prefers-reduced-motion: reduce) {
  .butterfly-float,
  .hero-butterfly,
  .shimmer-text {
    animation: none;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

/* ── Mobile-specific improvements ── */

/* Aspect ratio fallback for older Safari */
.aspect-video {
  aspect-ratio: 16 / 9;
}
.aspect-square {
  aspect-ratio: 1 / 1;
}

/* Better tap highlight on mobile */
a,
button {
  -webkit-tap-highlight-color: rgba(201, 151, 58, 0.15);
}

/* Prevent text overflow in small cards */
.product-card h3,
.blog-card h3 {
  word-break: break-word;
}

/* Toast: higher position on very small screens to avoid nav */
@media (max-width: 480px) {
  #toast {
    bottom: 90px;
    left: 16px;
    right: 16px;
    text-align: center;
  }
}

/* ── Line clamp for mobile card titles ── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Smoother scrolling on iOS ── */
body {
  -webkit-overflow-scrolling: touch;
}

/* ── Floating WhatsApp: better position on mobile ── */
@media (max-width: 639px) {
  #float-whatsapp {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }
}

/* ── Form compact on mobile ── */
@media (max-width: 639px) {
  #order-form {
    padding: 1rem;
    border-radius: 1rem;
  }
  #order-form h3 {
    font-size: 1.25rem;
  }
  #order-form input,
  #order-form select,
  #order-form textarea {
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
  }
}

/* ── No hover lift on touch devices (prevents sticky hover) ── */
@media (hover: none) {
  .promise-card:hover,
  .product-card:hover,
  .blog-card:hover {
    transform: none;
  }
}

/* ── Tiny screens (320-360px) ── */
@media (max-width: 360px) {
  .text-xl {
    font-size: 1.15rem;
  }
}
