/* ============================================================
   LYLA JEWELRY - GLOBAL STYLES
   Foundation layer: Reset, Variables, Fonts, Typography, Utilities
   ============================================================ */

/* ==================== MEDIA QUERY BREAKPOINTS ====================
   Mobile:        max-width: 480px
   Large Mobile:  481px - 767px  
   Tablet:        768px - 1024px
   Desktop:       1025px - 1439px
   Large Desktop: 1440px+
   ============================================================ */

/* ==================== CSS VARIABLES ==================== */
:root {
  /* ===== COLORS ===== */
  --color-black: #000000;
  --color-white: #FFFFFF;
  --color-footer-bg: #F7F7F7;
  --color-footer-icon-bg: #D8D8D8;
  --color-hover-blue: #9cd4ed;
  --color-border-dark: rgba(29, 29, 29, 0.677);
  --color-border-light: #eee;
  --color-text-muted: rgba(0, 0, 0, 0.6);
  --color-text-light: rgba(0, 0, 0, 0.7);
  --color-text-lighter: rgba(0, 0, 0, 0.5);
  --color-overlay: rgba(0, 0, 0, 0.1);
  --color-border-icon: #FFFFFF08;
  
  /* ===== TYPOGRAPHY ===== */
  --font-primary: 'Avenir', sans-serif;
  
  /* Font Sizes */
  --font-size-hero: 3.5rem;        /* 56px - section titles */
  --font-size-h1: 50px;            /* main headers */
  --font-size-h2: 40px;            /* product title */
  --font-size-h3: 30px;            /* price */
  --font-size-h4: 26px;            /* footer headings */
  --font-size-body: 17px;          /* main text */
  --font-size-body-sm: 16px;       /* smaller body */
  --font-size-small: 13px;         /* footer text */
  --font-size-xs: 0.9rem;          /* mobile nav */
  --font-size-xxs: 0.8rem;         /* uppercase labels */
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-book: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-heavy: 800;
  --font-weight-black: 900;
  
  /* Line Heights */
  --line-height-tight: 79%;
  --line-height-normal: 108%;
  --line-height-relaxed: 128%;
  --line-height-loose: 1.5;
  
  /* Letter Spacing */
  --letter-spacing-tight: -6%;
  --letter-spacing-normal: -5%;
  --letter-spacing-wide: 1.5px;
  
  /* ===== SPACING ===== */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 40px;
  --spacing-xl: 60px;
  --spacing-2xl: 80px;
  --spacing-3xl: 100px;
  
  /* ===== LAYOUT ===== */
  --max-width: 1400px;
  --nav-height: 70px;
  --border-radius: 4px;
  --border-radius-full: 50%;
  
  /* Gaps */
  --gap-xs: 7px;
  --gap-sm: 10px;
  --gap-md: 20px;
  --gap-lg: 30px;
  --gap-xl: 60px;
  
  /* ===== TRANSITIONS ===== */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.4s ease;
  --transition-slide: 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* ===== SHADOWS ===== */
  --shadow-light: 2px 0 10px rgba(0, 0, 0, 0.1);
  
  /* ===== Z-INDEX ===== */
  --z-nav: 9999;
  --z-modal: 10000;
  --z-header-sticky: 10;
}

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

/* Remove list styles */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

/* Set core body defaults */
body {
  text-rendering: optimizeSpeed;
  line-height: var(--line-height-loose);
}

/* A elements without class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture,
svg {
  max-width: 100%;
  display: block;
}

/* Reduce animations for people who prefer not to see them */
@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;
  }
}

/* ==================== FONT FACES ==================== */
@font-face {
  font-family: 'Avenir';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../assets/fonts/AvenirLTProLight.otf');
}

@font-face {
  font-family: 'Avenir';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/AvenirLTProBook.otf');
}

@font-face {
  font-family: 'Avenir';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/AvenirLTProRoman.otf');
}

@font-face {
  font-family: 'Avenir';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/AvenirLTProMedium.otf');
}

@font-face {
  font-family: 'Avenir';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../assets/fonts/AvenirLTProHeavy.otf');
}

@font-face {
  font-family: 'Avenir';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../assets/fonts/AvenirLTProBlack.otf');
}

/* ==================== BASE STYLES ==================== */
* {
  box-sizing: border-box;
  margin: 0px;
  font-family: var(--font-primary);
  letter-spacing: -0.03em;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-white);
  color: var(--color-black);
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ==================== UTILITY CLASSES ==================== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==================== LOADING STATES ==================== */

/* Desktop (default) */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl) var(--spacing-md);
  min-height: unset;
}

/* ============================================================
   Global page loader — full-screen white overlay with the
   centred loading video. Shown for at least 1.5 s on every
   page load, then fades out.
   ============================================================ */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
.page-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.page-loader-video {
  width: 300px;
  height: 300px;
  max-width: 300px;
  max-height: 300px;
  object-fit: contain;
  display: block;
}
html.loader-locked,
html.loader-locked body {
  overflow: hidden;
}

.spinner {
  width: 100px;
  height: 100px;

  background: url("/images/loading.gif");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.loading p {
  margin-top: var(--spacing-sm);
  font-size: 14px;
  color: #666;
}

/* Tablet: 768px - 1024px */
@media (min-width: 768px) and (max-width: 1024px) {
  .loading {
    padding: var(--spacing-xl) var(--spacing-md);
  }
  
  .spinner {
    width: 80px;
    height: 80px;
  }
  
  .loading p {
    font-size: 14px;
  }
}

/* Large Mobile: 481px - 767px */
@media (min-width: 481px) and (max-width: 767px) {
  .loading {
    padding: var(--spacing-lg) var(--spacing-sm);
  }
  
  .spinner {
    width: 80px;
    height: 80px;
  }
  
  .loading p {
    font-size: 13px;
  }
}

/* Mobile: <=480px */
@media (max-width: 480px) {
  .loading {
    padding: var(--spacing-lg) var(--spacing-sm);
  }
  
  .spinner {
    width: 80px;
    height: 80px;
  }
  
  .loading p {
    font-size: 13px;
  }
}

/* Large Desktop: 1440px+ */
@media (min-width: 1440px) {
  .loading {
    padding: var(--spacing-xl) var(--spacing-md);
  }
  
  .spinner {
    width: 120px;
    height: 120px;
  }
  
  .loading p {
    font-size: 14px;
  }
}

/* ==================== ERROR STATES ==================== */

/* Desktop (default) */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl) var(--spacing-md);
  text-align: center;
  min-height: unset;
}

.error-state h2 {
  font-size: 24px;
  font-weight: var(--font-weight-medium);
  margin-bottom: 12px;
  color: var(--color-black);
}

.error-state p {
  font-size: var(--font-size-body-sm);
  color: #666;
  margin-bottom: var(--spacing-md);
  max-width: unset;
}

.error-state a {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--color-black);
  color: var(--color-white);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: background-color var(--transition-fast);
  border: unset;
  border-radius: unset;
}

.error-state a:hover {
  background-color: #333;
}

/* Tablet: 768px - 1024px */
@media (min-width: 768px) and (max-width: 1024px) {
  .error-state {
    padding: var(--spacing-xl) var(--spacing-md);
  }
  
  .error-state h2 {
    font-size: 24px;
  }
  
  .error-state p {
    font-size: var(--font-size-body-sm);
  }
  
  .error-state a {
    padding: 12px 24px;
  }
}

/* Large Mobile: 481px - 767px */
@media (min-width: 481px) and (max-width: 767px) {
  .error-state {
    padding: var(--spacing-lg) var(--spacing-sm);
  }
  
  .error-state h2 {
    font-size: 22px;
  }
  
  .error-state p {
    font-size: 15px;
    max-width: 90%;
  }
  
  .error-state a {
    padding: 10px 20px;
  }
}

/* Mobile: <=480px */
@media (max-width: 480px) {
  .error-state {
    padding: var(--spacing-lg) var(--spacing-sm);
  }
  
  .error-state h2 {
    font-size: 20px;
  }
  
  .error-state p {
    font-size: 14px;
    max-width: 90%;
  }
  
  .error-state a {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* Large Desktop: 1440px+ */
@media (min-width: 1440px) {
  .error-state {
    padding: var(--spacing-xl) var(--spacing-md);
  }
  
  .error-state h2 {
    font-size: 28px;
  }
  
  .error-state p {
    font-size: var(--font-size-body);
    max-width: 600px;
  }
  
  .error-state a {
    padding: 14px 28px;
    font-size: var(--font-size-body-sm);
  }
}
