/* ===================================================================
   MARKHOR PROPERTIES — Global Design System
   A premium, responsive, mobile-first CSS foundation.
   =================================================================== */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Colors */
  --color-primary: #1e3b8a;
  --color-primary-dark: #152e6e;
  --color-primary-light: #2a4faa;
  --color-accent: #b8912e;
  --color-accent-dark: #9a7824;
  --color-accent-light: #d4a83a;

  --color-bg: #f6f6f8;
  --color-bg-dark: #121620;
  --color-surface: #ffffff;
  --color-surface-dark: #0f172a;
  --color-surface-alt: #f1f5f9;

  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-text-inverse: #ffffff;

  --color-border: #e2e8f0;
  --color-border-dark: #1e293b;

  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-whatsapp: #25D366;

  /* Typography */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-primary: 0 10px 30px -5px rgba(30, 59, 138, 0.3);
  --shadow-accent: 0 10px 30px -5px rgba(184, 145, 46, 0.3);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.22, 1, 0.36, 1);

  /* Z-Index Scale */
  --z-dropdown: 40;
  --z-sticky: 50;
  --z-overlay: 60;
  --z-modal: 70;
  --z-toast: 80;

  /* Layout */
  --max-width: 1280px;
  --header-height: 72px;
}

/* --- CSS Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--font-display);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

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

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
}

::selection {
  background-color: var(--color-primary);
  color: white;
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 640px) {
  .container { padding: 0 var(--space-6); }
}
@media (min-width: 1024px) {
  .container { padding: 0 var(--space-8); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus,
.sr-only:focus-visible {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 9999;
  width: auto;
  height: auto;
  padding: var(--space-3) var(--space-6);
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--color-primary);
  color: white;
  font-weight: 700;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  line-height: 1.4;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
}

.btn-accent {
  background-color: var(--color-accent);
  color: white;
  box-shadow: var(--shadow-accent);
}
.btn-accent:hover {
  background-color: var(--color-accent-dark);
  transform: translateY(-1px);
}

.btn-whatsapp {
  background-color: var(--color-whatsapp);
  color: white;
  box-shadow: 0 10px 30px -5px rgba(37, 211, 102, 0.3);
}
.btn-whatsapp:hover {
  background-color: #20ba5a;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-border);
  color: var(--color-text);
}
.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 0.75rem;
}

/* --- Card Component --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  transition: all var(--transition-base);
}
.card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

/* --- Badge Component --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius-full);
}

.badge-primary {
  background: rgba(30, 59, 138, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(30, 59, 138, 0.2);
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

/* --- Form Elements --- */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 59, 138, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-muted);
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

/* --- Material Symbols --- */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

.icon-sm { font-size: 18px; }
.icon-lg { font-size: 32px; }
.icon-xl { font-size: 48px; }

.icon-filled {
  font-variation-settings: 'FILL' 1;
}

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s var(--transition-spring);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-md);
}

/* --- Section Spacing --- */
.section {
  padding: var(--space-16) 0;
}

@media (min-width: 768px) {
  .section { padding: var(--space-20) 0; }
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header h2 {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 640px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .section-header h2 { font-size: 2.25rem; }
}

/* --- Responsive Grid --- */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- Flex Utilities --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* --- Text Utilities --- */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-white { color: white; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-wider { letter-spacing: 0.1em; }
.tracking-widest { letter-spacing: 0.2em; }
.leading-tight { line-height: 1.2; }
.leading-relaxed { line-height: 1.75; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Visibility Utilities --- */
.hidden-mobile  { display: none; }

@media (min-width: 768px) {
  .hidden-mobile  { display: block; }
}
/* For select elements */
@media (min-width: 768px) {
  select.hidden-mobile { display: block; }
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-10) 0 var(--space-4);
  flex-wrap: wrap;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(30, 59, 138, 0.05);
}

.page-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-primary);
  cursor: default;
}

.page-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.page-ellipsis {
  color: var(--color-text-muted);
  font-weight: 700;
  padding: 0 var(--space-1);
  user-select: none;
}

/* --- Contact Success Card --- */
.contact-success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  gap: var(--space-4);
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-2xl);
  animation: fadeUp 0.5s var(--transition-spring) both;
}

.contact-success-icon {
  font-size: 56px;
  color: var(--color-success);
  font-variation-settings: 'FILL' 1;
}

.contact-success-card h3 {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-text);
}

.contact-success-card p {
  color: var(--color-text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

/* --- Floating Buttons --- */
.floating-cta {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: 1000;
  pointer-events: none;
}
.floating-cta > * { pointer-events: auto; }

.floating-btn, .floating-cta-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transition: all var(--transition-base);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.1);
}
.floating-btn:hover, .floating-cta-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}
.floating-btn .material-symbols-outlined, .floating-cta-btn .material-symbols-outlined {
  font-size: 24px;
  font-variation-settings: 'FILL' 0;
}

.call-btn { background: var(--color-primary); }
.wa-btn, #admin-support-btn { background: var(--color-whatsapp); }

@media (min-width: 768px) {
  .floating-cta { bottom: var(--space-8); right: var(--space-8); }
}

/* --- Glassmorphism --- */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- Respect prefers-reduced-motion (WCAG 2.1 SC 2.3.3) --- */
@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;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
