/**
 * MORRO — Unified Design System & Master Stylesheet
 * Minimalist, Editorial, Tactile Aesthetic
 */

/* ==========================================================================
   1. TYPOGRAPHY & WEBFONTS
   ========================================================================== */

/* Primary Body & Headings: Yekan Bakh FaNum (Variable & Independent Weights) */
@font-face {
  font-family: 'YekanBakh';
  src: url('/fonts/yekanbakh-fanum.woff2') format('woff2 supports variations'),
       url('/fonts/yekanbakh-fanum.woff2') format('woff2-variations'),
       url('/fonts/yekanbakh-fanum.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'YekanBakh';
  src: url('/fonts/YekanBakhFaNum-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'YekanBakh';
  src: url('/fonts/YekanBakhFaNum-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'YekanBakh';
  src: url('/fonts/YekanBakhFaNum-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'YekanBakh';
  src: url('/fonts/YekanBakhFaNum-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'YekanBakh';
  src: url('/fonts/YekanBakhFaNum-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'YekanBakh';
  src: url('/fonts/YekanBakhFaNum-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Brand Wordmark: TacOne */
@font-face {
  font-family: 'TacOne';
  src: url('/fonts/TacOne-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.font-logo, .logo-morro {
  font-family: 'TacOne', -apple-system, BlinkMacSystemFont, sans-serif !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   2. CORE RESETS & DESIGN TOKENS
   ========================================================================== */

:root {
  --ink: #171714;
  --paper: #f4f1eb;
  --sand: #ded7ca;
  --sand-dark: #d9d1c4;
  --border-subtle: rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  direction: rtl;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: 'YekanBakh', -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
}

button, input, select, textarea {
  font-family: inherit;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

/* Prevent iOS Safari automatic zoom on inputs */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */

.nav-blur {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(244, 241, 235, 0.94);
}

.nav-item {
  position: relative;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

/* ==========================================================================
   4. DRAWERS & OFF-CANVAS PANELS
   ========================================================================== */

.drawer-panel {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

[dir="rtl"] .drawer-right {
  transform: translateX(100%);
}
[dir="rtl"] .drawer-right.open {
  transform: translateX(0);
}

[dir="ltr"] .drawer-right {
  transform: translateX(100%);
}
[dir="ltr"] .drawer-right.open {
  transform: translateX(0);
}

/* Sticky Mobile Bar (Product Page CTA) */
.sticky-mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: rgba(244, 241, 235, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateY(105%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.sticky-mobile-bar.visible {
  transform: translateY(0);
}

/* ==========================================================================
   5. PRODUCT CARDS & MEDIA INTERACTIONS
   ========================================================================== */

.product-card img {
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.product-card:hover img {
  transform: scale(1.04);
}

.image-link img {
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.image-link:hover img {
  transform: scale(1.03);
}

/* Minimalist Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   6. FORM CONTROLS & MINIMAL INPUTS
   ========================================================================== */

.input-minimal {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink);
  padding: 10px 0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-minimal:focus {
  border-bottom-width: 2px;
}

/* Minimal Accordion */
details summary::-webkit-details-marker {
  display: none;
}
details summary {
  list-style: none;
}
details[open] summary span.icon {
  transform: rotate(45deg);
}

/* ==========================================================================
   7. TOAST NOTIFICATION SYSTEM
   ========================================================================== */

#toastContainer {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.morro-toast {
  pointer-events: auto;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: 2px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.morro-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   8. UTILITIES & DEVICE COMPATIBILITY
   ========================================================================== */

.hide-scroll::-webkit-scrollbar {
  display: none;
}
.hide-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pb-safe {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
