/* ========================================================
   ALARICKA CO. - Luxury Furniture & Homeware
   Custom Design System & Styling
   ======================================================== */

:root {
  /* Alaricka Brand Colors */
  --color-crimson: #b82e46;
  --color-crimson-dark: #8c1e32;
  --color-crimson-light: #d64761;
  --color-crimson-soft: #fdf2f4;
  --color-gold: #c5a880;
  --color-gold-dark: #9a7d53;
  --color-gold-light: #e5d4be;
  --color-charcoal: #18191c;
  --color-charcoal-light: #2c2e35;
  --color-cream: #faf7f2;
  --color-cream-card: #f3efe8;
  --color-cream-border: #e8e1d5;
  --color-white: #ffffff;
}

/* Base resets & smooth scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  overflow-x: hidden;
}

body {
  background-color: var(--color-cream);
  color: var(--color-charcoal);
  font-family: 'Cairo', 'Tajawal', sans-serif;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

/* Type Hierarchy — establish explicit size steps (≥ 1.25× ratio)
   so the cascade has real contrast even before Tailwind utilities load. */
h1 { font-size: 2.5rem;  } /* 40px */
h2 { font-size: 2rem;    } /* 32px */
h3 { font-size: 1.6rem;  } /* 25.6px — 1.25× step from h4 */
h4 { font-size: 1.25rem; } /* 20px */
h5 { font-size: 1rem;    } /* 16px */

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: var(--color-cream);
}
::-webkit-scrollbar-thumb {
  background: #d8cebe;
  border-radius: 6px;
  border: 2px solid var(--color-cream);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-crimson);
}

/* Selection Color */
::selection {
  background-color: rgba(184, 46, 70, 0.2);
  color: var(--color-crimson-dark);
}

/* Transitions */
.transition-smooth {
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Glassmorphism Styles */
.alaricka-glass {
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(197, 168, 128, 0.25);
}

.alaricka-glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 225, 213, 0.8);
}

.alaricka-glass-dark {
  background: rgba(24, 25, 28, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(197, 168, 128, 0.2);
}

/* Hero Badge Glow */
.badge-crimson-glow {
  background: linear-gradient(135deg, rgba(184, 46, 70, 0.1) 0%, rgba(197, 168, 128, 0.15) 100%);
  border: 1px solid rgba(184, 46, 70, 0.25);
}

/* Hero Gradient Overlay */
.hero-gradient-overlay {
  background: linear-gradient(180deg, rgba(24, 25, 28, 0.45) 0%, rgba(24, 25, 28, 0.7) 100%);
}

.hero-card-pattern {
  background-image: radial-gradient(rgba(184, 46, 70, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Button Crimson Gradient */
.btn-crimson {
  background: linear-gradient(135deg, #b82e46 0%, #9e1b32 100%);
  box-shadow: 0 4px 18px rgba(184, 46, 70, 0.3);
  transition: all 0.3s ease;
}
.btn-crimson:hover {
  background: linear-gradient(135deg, #cf405a 0%, #b82e46 100%);
  box-shadow: 0 8px 25px rgba(184, 46, 70, 0.45);
  transform: translateY(-2px);
}

.btn-outline-gold {
  border: 1.5px solid var(--color-gold);
  color: var(--color-charcoal);
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}
.btn-outline-gold:hover {
  background: var(--color-gold);
  color: #fff;
  box-shadow: 0 4px 15px rgba(197, 168, 128, 0.35);
  transform: translateY(-2px);
}

/* Interactive Card Effects */
.furniture-card {
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
}
.furniture-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 35px -10px rgba(24, 25, 28, 0.12), 0 0 1px 1px rgba(184, 46, 70, 0.15);
}

.image-zoom-container {
  overflow: hidden;
}
.image-zoom-container img {
  transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.furniture-card:hover .image-zoom-container img {
  transform: scale(1.08);
}

/* Category Pill & Filter Tabs */
.filter-btn {
  transition: all 0.3s ease;
}
.filter-btn.active {
  background-color: var(--color-crimson);
  color: #ffffff;
  border-color: var(--color-crimson);
  box-shadow: 0 4px 14px rgba(184, 46, 70, 0.3);
}

/* Scroll Reveal States */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Floating animation */
@keyframes floatGentle {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}
.animate-float {
  animation: floatGentle 4s ease-in-out infinite;
}

/* Pulsing Badge */
@keyframes pulseCrimson {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(184, 46, 70, 0.6);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(184, 46, 70, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(184, 46, 70, 0);
  }
}
.pulse-badge {
  animation: pulseCrimson 2.5s infinite;
}

/* Decorative Gold Ribbon */
.gold-accent-line {
  height: 3px;
  width: 54px;
  background: linear-gradient(90deg, var(--color-crimson), var(--color-gold));
  border-radius: 2px;
}

/* Lightbox Modal */
.modal-backdrop {
  background: rgba(15, 16, 19, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Leaflet Map Custom Marker */
.custom-leaflet-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-crimson);
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(184, 46, 70, 0.5);
  font-size: 18px;
}

/* Floating Contact & Social Pill */
.floating-contact-pill {
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.floating-contact-pill:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5);
}

/* RTL / LTR tweaks */
[dir="rtl"] .flip-rtl {
  transform: scaleX(-1);
}

/* Custom Grid Card Badge */
.category-badge-chip {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(197, 168, 128, 0.35);
}

/* Accessibility Focus Rings (Impeccable craft floor standard) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-crimson);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Mobile & Touch Adaptations */
.floating-contact-pill {
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

#back-to-top {
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 480px) {
  /* Prevent overlap on very narrow phones */
  .floating-contact-pill {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.35rem;
  }
  
  #back-to-top {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 0.8rem;
  }

  /* Ensure touch targets meet 44px minimum */
  .gallery-filter-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Touch input adaptations */
@media (pointer: coarse) {
  .mobile-nav-link {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

footer {
  padding-bottom: max(3rem, calc(2.5rem + env(safe-area-inset-bottom, 0px)));
}

/* Image Aspect Ratio Defaults for Zero CLS */
.image-zoom-container img,
.furniture-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Payment Methods Card */
.payment-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.payment-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

/* Form Status Toast Card */
.form-toast-card {
  animation: slideFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
