/* ============================================
   AURUM — Global Design System
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   DESIGN TOKENS (CSS Custom Properties)
   ============================================ */
:root {
  /* --- Color Palette --- */
  --color-bg:           #F9F6F0;
  --color-bg-warm:      #F5F2EC;
  --color-bg-dark:      #0A0A0A;
  --color-text:         #1A1A1A;
  --color-text-light:   #555555;
  --color-text-muted:   #B0B0B0;
  --color-gold:         #C9A96E;
  --color-gold-light:   #D4B97E;
  --color-gold-dark:    #A88A4E;
  --color-white:        #FFFFFF;
  --color-black:        #0A0A0A;
  --color-border:       #E0DCD4;
  --color-border-light: #EDE9E2;
  --color-success:      #2D7A3A;
  --color-error:        #B33A3A;
  --color-warning:      #C08B30;

  /* --- Typography --- */
  --font-heading:  'Cormorant Garamond', 'Georgia', serif;
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* --- Font Sizes (fluid) --- */
  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-md:    1.125rem;
  --text-lg:    1.25rem;
  --text-xl:    1.5rem;
  --text-2xl:   2rem;
  --text-3xl:   2.5rem;
  --text-4xl:   3rem;
  --text-5xl:   4rem;
  --text-6xl:   5rem;
  --text-7xl:   7rem;
  --text-hero:  clamp(4rem, 12vw, 14rem);

  /* --- Font Weights --- */
  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* --- Spacing Scale --- */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;
  --space-4xl:  6rem;
  --space-5xl:  8rem;
  --space-6xl:  12rem;

  /* --- Layout --- */
  --container-max:     1440px;
  --container-narrow:  960px;
  --container-wide:    1600px;
  --sidebar-width:     280px;
  --nav-height:        72px;
  --admin-sidebar:     260px;

  /* --- Border Radius --- */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 50%;

  /* --- Shadows --- */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 30px rgba(0,0,0,0.10);
  --shadow-xl:    0 16px 50px rgba(0,0,0,0.12);
  --shadow-gold:  0 4px 20px rgba(201,169,110,0.25);

  /* --- Transitions --- */
  --ease-smooth:  cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce:  cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-in-out:  cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast:   150ms;
  --duration-normal: 300ms;
  --duration-slow:   500ms;

  /* --- Z-Index Scale --- */
  --z-base:      1;
  --z-dropdown:  100;
  --z-sticky:    200;
  --z-overlay:   300;
  --z-modal:     400;
  --z-toast:     500;
  --z-max:       9999;
}

/* ============================================
   CSS RESET
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

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

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-regular);
  line-height: 1.1;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.heading-hero {
  font-family: var(--font-heading);
  font-size: var(--text-hero);
  font-weight: var(--weight-light);
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.heading-1 {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, var(--text-5xl));
  font-weight: var(--weight-light);
  line-height: 1.1;
}

.heading-2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, var(--text-4xl));
  font-weight: var(--weight-regular);
  line-height: 1.15;
}

.heading-3 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, var(--text-3xl));
  font-weight: var(--weight-regular);
  line-height: 1.2;
}

.heading-4 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-medium);
  line-height: 1.25;
}

.label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.label-gold {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-gold);
}

.body-lg {
  font-size: var(--text-lg);
  line-height: 1.7;
}

.body-sm {
  font-size: var(--text-sm);
  line-height: 1.6;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-gold {
  color: var(--color-gold);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-5xl) 0;
}

.section-sm {
  padding: var(--space-3xl) 0;
}

.section-lg {
  padding: var(--space-6xl) 0;
}

/* 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; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

/* Grid utilities */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Text alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Display */
.block { display: block; }
.hidden { display: none; }
.relative { position: relative; }

/* ============================================
   SELECTION
   ============================================ */
::selection {
  background-color: var(--color-gold);
  color: var(--color-white);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-text-muted);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-light);
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

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

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

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Animation utility classes */
.animate-fade-in     { animation: fadeIn var(--duration-slow) var(--ease-smooth) forwards; }
.animate-fade-in-up  { animation: fadeInUp var(--duration-slow) var(--ease-smooth) forwards; }
.animate-slide-left  { animation: slideInLeft var(--duration-slow) var(--ease-smooth) forwards; }
.animate-slide-right { animation: slideInRight var(--duration-slow) var(--ease-smooth) forwards; }
.animate-scale-in    { animation: scaleIn var(--duration-normal) var(--ease-smooth) forwards; }

/* Stagger delays */
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }
.delay-5 { animation-delay: 500ms; }

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-border-light) 25%,
    var(--color-bg) 50%,
    var(--color-border-light) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
  border-radius: var(--radius-sm);
}

.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-text.w-25 { width: 25%; }

.skeleton-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ============================================
   VISUALLY HIDDEN (Accessibility)
   ============================================ */
.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;
}

/* ============================================
   PAGE TRANSITION
   ============================================ */
.page-transition {
  animation: fadeIn var(--duration-normal) var(--ease-smooth);
}

/* ============================================
   RULED LINES (Editorial)
   ============================================ */
.ruled-top {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-lg);
}

.ruled-bottom {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-lg);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --nav-height: 64px;
  }

  .container,
  .container-narrow,
  .container-wide,
  .container-fluid {
    padding: 0 var(--space-lg);
  }

  .section {
    padding: var(--space-4xl) 0;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hide-tablet { display: none !important; }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  .container,
  .container-narrow,
  .container-wide,
  .container-fluid {
    padding: 0 var(--space-md);
  }

  .section {
    padding: var(--space-3xl) 0;
  }

  .section-lg {
    padding: var(--space-4xl) 0;
  }

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

  .heading-hero {
    font-size: clamp(3rem, 15vw, 6rem);
  }

  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
}

/* Small mobile */
@media (max-width: 375px) {
  html {
    font-size: 14px;
  }
}

/* ============================================
   TOUCH & MOBILE ENHANCEMENTS
   ============================================ */

/* Eliminate 300ms tap delay on all interactive elements */
a,
button,
input,
select,
textarea,
label,
[role="button"],
.btn,
.hamburger,
.product-card__wishlist,
.filter-group__title,
.variant-option,
.gallery__thumb,
.qty-stepper__btn,
.checkout-step,
.payment-method,
.tab,
.toast__close,
.filter-option,
.admin-sidebar__link,
.mobile-drawer__link {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS zoom on input focus — all inputs min 16px */
@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: max(16px, 1rem) !important;
  }
}

/* Touch device class — interactive enhancements */
body.touch-device .product-card__wishlist {
  opacity: 1;
  transform: translateY(0);
}

body.touch-device .product-card__actions {
  transform: translateY(0);
}

/* Focus-visible for keyboard accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.variant-option:focus-visible,
.gallery__thumb:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* Minimum 48px tap targets on mobile */
@media (max-width: 768px) {
  .navbar__icon-btn {
    width: 48px;
    height: 48px;
  }

  .hamburger {
    width: 48px;
    height: 48px;
    padding: 10px;
  }

  .footer__social-link {
    width: 48px;
    height: 48px;
  }

  .gallery__thumb {
    min-width: 48px;
    min-height: 48px;
  }

  .filter-option {
    min-height: 48px;
    padding: var(--space-sm) 0;
  }

  .variant-option {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .payment-method {
    min-height: 56px;
  }

  .breadcrumb a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .mobile-drawer__link {
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .tab {
    min-height: 48px;
    display: flex;
    align-items: center;
  }
}

/* Bottom sheet slide-up animation */
@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes slideDownSheet {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}

/* Checkout dots-only on very small screens */
@media (max-width: 480px) {
  .checkout-step span:not(.checkout-step__number) {
    display: none;
  }
  .checkout-step {
    padding: var(--space-sm);
  }
  .checkout-step__separator {
    width: 20px;
  }
}
