/* ================================================
   BASE STYLES - Shared between Arabic and English
   ================================================ */

/* ===========================
   CSS VARIABLES
   =========================== */
:root {
  /* Colors */
  --bg: #0b0b0b;
  --fg: #f7f7f5;
  --muted: rgba(255, 255, 255, .65);
  --primary: #C8A96A;
  --primary-hover: #D4B575;
  --card: rgba(255, 255, 255, .06);
  --card-hover: rgba(255, 255, 255, .10);
  --border: rgba(255, 255, 255, .15);
  --border-hover: rgba(255, 255, 255, .25);
  
  /* Shadows */
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-hover: 0 15px 40px rgba(0, 0, 0, .45);
  
  /* Border Radius */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 20px;
  
  /* Spacing */
  --pad: clamp(12px, 1.2vw, 20px);
  
  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--fg);
  background:
    radial-gradient(ellipse 1200px 600px at 50% 20%, rgba(200, 169, 106, .08), transparent),
    radial-gradient(ellipse 800px 400px at 50% 60%, rgba(255, 255, 255, .04), transparent),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "liga" 1, "kern" 1, "calt" 1;
  text-rendering: optimizeLegibility;
}

/* ===========================
   TYPOGRAPHY
   =========================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin: 0;
}

h1 {
  font-size: clamp(32px, 4vw, 48px);
  margin-bottom: 16px;
}

h2 {
  font-size: clamp(20px, 3.5vw, 28px);
  margin-bottom: 12px;
}

h3 {
  font-size: clamp(18px, 3vw, 22px);
  margin-bottom: 8px;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===========================
   UTILITY CLASSES
   =========================== */
.muted {
  color: var(--muted);
}

.visually-hidden {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  padding: 0 !important;
  border: 0 !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden;
  white-space: nowrap;
}

.visually-hidden:focus {
  clip: auto;
  height: auto !important;
  width: auto !important;
  position: fixed;
  z-index: 10000;
  background: #000;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
}

/* ===========================
   LAYOUT
   =========================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px var(--pad);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px var(--pad);
}

section {
  margin-block: 32px;
  margin-top: 10px !important;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

section::before {
  content: "";
  position: absolute;
  top: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent);
}

section:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.section-head {
  margin-bottom: 20px;
}

/* ===========================
   GRID SYSTEM
   =========================== */
.grid {
  display: grid;
  gap: 20px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ===========================
   HEADER & NAVIGATION
   =========================== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 11, 11, .85);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

@supports (backdrop-filter: blur(12px)) {
  header {
    backdrop-filter: saturate(1.2) blur(12px);
    background: linear-gradient(180deg, rgba(11, 11, 11, .90), rgba(11, 11, 11, .70));
  }
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: var(--fg);
  transition: var(--transition);
}

.brand:hover {
  color: var(--primary);
  text-decoration: none;
}

.logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .25), transparent 60%),
    linear-gradient(135deg, var(--primary), rgba(200, 169, 106, .20));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    0 4px 12px rgba(200, 169, 106, .25);
  transition: var(--transition);
}

.brand:hover .logo {
  transform: scale(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .4),
    0 6px 16px rgba(200, 169, 106, .35);
}

/* Mobile Menu Toggle */
.menu-toggle {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
}

.menu-toggle:hover {
  background: var(--card-hover);
  border-color: var(--border-hover);
}

.menu-toggle span {
  position: relative;
  width: 22px;
  height: 2px;
  background: var(--fg);
  display: block;
  border-radius: 2px;
  transition: var(--transition);
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: var(--transition);
}

.menu-toggle span::before {
  top: -7px;
}

.menu-toggle span::after {
  top: 7px;
}

/* Menu animation states */
.nav-open .menu-toggle span {
  background: transparent;
}

.nav-open .menu-toggle span::before {
  transform: rotate(45deg);
  top: 0;
}

.nav-open .menu-toggle span::after {
  transform: rotate(-45deg);
  top: 0;
}

/* Primary Navigation */
.primary-nav {
  position: relative;
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.primary-nav .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--fg);
  font-weight: 500;
  transition: var(--transition);
  min-height: 44px;
  text-decoration: none;
  position: relative;
}

.primary-nav .nav-link:hover {
  background: var(--card);
  border-color: var(--border);
  color: var(--primary);
  text-decoration: none;
}

.primary-nav .nav-link.active {
  background: rgba(200, 169, 106, .15);
  color: var(--primary);
  border-color: rgba(200, 169, 106, .3);
}

/* Language Switch */
.lang-switch {
  display: flex;
  gap: 4px;
  background: var(--card);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.lang-switch a {
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  min-width: 44px;
  text-align: center;
}

.lang-switch [aria-pressed="true"] {
  background: var(--primary);
  color: #1a1611;
}

/* Language Flags (Footer) */
.lang-flags {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  justify-content: flex-end;
}

.lang-flags .flag {
  width: 28px;
  height: 20px;
  display: inline-flex;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  filter: grayscale(.05) saturate(1.05);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.lang-flags .flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lang-flags .flag:hover {
  transform: translateY(-1px);
  filter: none;
}

.lang-flags .flag.is-active {
  box-shadow: 0 0 0 2px var(--primary) inset;
}

/* ===========================
   COMPONENTS - BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: .8rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  color: var(--fg);
  box-shadow: var(--shadow);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  min-height: 44px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .08));
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow);
}

.btn.primary {
  background: linear-gradient(180deg, var(--primary), rgba(200, 169, 106, .85));
  color: #1a1611;
  border-color: var(--primary);
}

.btn.primary:hover {
  background: linear-gradient(180deg, var(--primary-hover), var(--primary));
}

.btn.ghost {
  background: transparent;
  box-shadow: none;
}

.btn.ghost:hover {
  background: var(--card);
}

/* ===========================
   COMPONENTS - CARDS
   =========================== */
.product-card {
  position: relative;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: var(--transition);
  overflow: hidden;
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.product-visual {
  aspect-ratio: 1/1.1;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .08), transparent 60%),
    rgba(255, 255, 255, .03);
  margin-bottom: 16px;
  transition: var(--transition);
}

.product-card:hover .product-visual {
  border-color: var(--primary);
  background:
    radial-gradient(circle at 30% 30%, rgba(200, 169, 106, .15), transparent 60%),
    rgba(255, 255, 255, .05);
}

.product-visual .bottle {
  width: 65%;
  height: 65%;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(200, 169, 106, .65), rgba(200, 169, 106, .15));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    0 8px 24px rgba(200, 169, 106, .25);
  transition: var(--transition);
}

.product-card:hover .bottle {
  transform: scale(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .4),
    0 12px 32px rgba(200, 169, 106, .35);
}

.card-head {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.product-card h3 {
  min-height: 2.2em;
  font-size: 18px;
  line-height: 1.4;
}

.product-card .muted {
  min-height: 2.8em;
  font-size: 14px;
  line-height: 1.5;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Favorite Button */
.fav {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(11, 11, 11, .90);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 2;
}

.fav:hover {
  background: rgba(11, 11, 11, .95);
  border-color: var(--primary);
  transform: scale(1.05);
}

.fav.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #1a1611;
}

.fav svg {
  width: 20px;
  height: 20px;
  transition: var(--transition);
}

/* ===========================
   COMPONENTS - BADGES & META
   =========================== */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, .06);
  transition: var(--transition);
}

.badge:hover {
  background: rgba(255, 255, 255, .10);
  border-color: var(--border-hover);
}

.badge.premium {
  background: linear-gradient(135deg, rgba(200, 169, 106, .2), rgba(200, 169, 106, .1));
  border-color: rgba(200, 169, 106, .4);
  color: var(--primary);
}

.price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.product-card .price {
  color: var(--primary);
  font-size: 18px;
}

/* ===========================
   COMPONENTS - FORMS
   =========================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--fg);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .04);
  color: var(--fg);
  font-family: inherit;
  font-size: 16px;
  transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200, 169, 106, .2);
  background: rgba(255, 255, 255, .06);
}

/* Contact Form Specific */
#contactForm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  align-items: start;
}

#contactForm label {
  display: block;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 6px;
}

#contactForm input,
#contactForm textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  color: var(--fg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

#contactForm textarea {
  resize: vertical;
  min-height: 120px;
}

#contactForm input::placeholder,
#contactForm textarea::placeholder {
  color: rgba(255, 255, 255, .45);
}

#contactForm input:focus,
#contactForm textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: transparent;
}

#contactForm label[for="name"],
#contactForm #name {
  grid-column: 1;
}

#contactForm label[for="phone"],
#contactForm #phone {
  grid-column: 2;
}

#contactForm label[for="message"],
#contactForm #message {
  grid-column: 1 / -1;
}

#contactForm .helper {
  grid-column: 1;
  color: var(--muted);
  align-self: center;
}

#contactForm .btn {
  grid-column: 2;
  justify-self: end;
}

#contact {
  padding-bottom: 18px;
}

/* ===========================
   COMPONENTS - HERO
   =========================== */
.hero h1 {
  margin: 0 0 16px 0;
  background: linear-gradient(135deg, var(--fg), var(--muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* ===========================
   BACK TO TOP
   =========================== */
.to-top {
  position: fixed;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: rgba(11, 11, 11, .90);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  cursor: pointer;
  z-index: 100;
}

.to-top:hover {
  background: var(--primary);
  color: #1a1611;
  border-color: var(--primary);
  transform: translateY(0) scale(1.05);
}

.to-top.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ===========================
   ANIMATIONS
   =========================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all .6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===========================
   MEDIA QUERIES - RESPONSIVE
   =========================== */

/* Tablet */
@media (max-width: 1199.98px) {
  .grid.cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile - Large */
@media (max-width: 991.98px) {
  .menu-toggle {
    display: inline-flex;
  }
  
  /* Mobile Menu Overlay */
  html.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .70);
    z-index: 9998;
  }
  
  .primary-nav {
    position: fixed !important;
    z-index: 9999;
    inset: calc(56px + env(safe-area-inset-top, 0px)) 12px 12px 12px;
    background: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity .18s ease, transform .18s ease;
    max-height: calc(100vh - 68px - env(safe-area-inset-top, 0px));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  html.nav-open .primary-nav {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  
  .primary-nav ul {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch;
    gap: 10px;
    margin: 0;
    padding: 12px;
  }
  
  .primary-nav li {
    list-style: none;
  }
  
  .primary-nav a {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 12px;
    background: #151515;
    color: #f7f7f5;
    text-decoration: none;
  }
  
  .primary-nav a:hover {
    border-color: rgba(255, 255, 255, .18);
    background: #171717;
  }
  
  .primary-nav a.active {
    border-color: #C8A96A;
    box-shadow: 0 0 0 2px rgba(200, 169, 106, .35) inset;
    background: #191919;
  }
  
  body.lock {
    overflow: hidden;
  }
}

/* Mobile - Small */
@media (max-width: 767.98px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }
  
  .grid {
    gap: 16px;
  }
  
  .card-actions {
    flex-direction: column;
  }
  
  .card-actions .btn {
    width: 100%;
  }
  
  #contactForm {
    grid-template-columns: 1fr;
  }
  
  #contactForm .helper {
    grid-column: 1;
  }
  
  #contactForm .btn {
    grid-column: 1;
    width: 100%;
  }
}

/* Mobile - Extra Small */
@media (max-width: 575.98px) {
  .hero .actions {
    flex-direction: column;
  }
  
  .hero .actions .btn {
    width: 100%;
  }
  
  .to-top {
    width: 44px;
    height: 44px;
    bottom: 16px;
  }
  
  .lang-flags {
    justify-content: flex-end;
  }
}

/* ===========================
   ACCESSIBILITY
   =========================== */

/* Focus styles applied globally */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --border: rgba(255, 255, 255, .4);
    --card: rgba(255, 255, 255, .1);
    --muted: rgba(255, 255, 255, .8);
  }
}

/* ===========================
   PRINT STYLES
   =========================== */
@media print {
  * {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
  }
  
  .menu-toggle,
  .to-top,
  .fav {
    display: none !important;
  }
  
  .product-card {
    break-inside: avoid;
    margin-bottom: 20px;
  }
}