/* assets/css/styles.css
   Purpose: Global styles for the smartphone reseller site. Edit CSS variables below to adjust brand colors, spacing, and breakpoints.
   How to change core values:
   - Update :root custom properties for colors, typography scale, spacing, and breakpoints
   - Primary CTA uses --brand; Accent uses --accent
*/

:root {
  /* Colors */
  --brand: #0b84ff; /* Primary brand color */
  --brand-600: #066ad1;
  --accent: #ff6b6b; /* Secondary accent */
  --muted: #6b7280; /* Muted text */
  --bg: #ffffff; /* Page background */
  --surface: #f7f8fb; /* Cards and surfaces */
  --ink: #111827; /* Primary text */
  --ink-2: #1f2937; /* Secondary headings */
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --border: #e5e7eb;

  /* Typography */
  --font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --fs-300: 0.875rem; /* 14px */
  --fs-400: 1rem;     /* 16px */
  --fs-500: 1.125rem; /* 18px */
  --fs-600: 1.25rem;  /* 20px */
  --fs-700: 1.5rem;   /* 24px */
  --fs-800: 1.875rem; /* 30px */
  --fs-900: 2.25rem;  /* 36px */

  /* Spacing */
  --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;

  /* Radii */
  --radius-2: 6px;
  --radius-3: 10px;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.08);

  /* Breakpoints */
  --bp-sm: 600px;
  --bp-md: 900px;
}

/* Base reset & typography */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--fs-400);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
svg { display: inline-block; vertical-align: middle; }

/* Accessibility */
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  left: 1rem; top: 1rem; width: auto; height: auto; padding: var(--space-2) var(--space-4);
  background: #fff; color: #000; border: 2px solid var(--brand); border-radius: var(--radius-2);
}
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* Layout */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 var(--space-4); }
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.9); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; }
.brand { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--ink); }
.brand__logo { width: 28px; height: 28px; }
.brand__name { font-weight: 700; font-size: var(--fs-600); }

.nav { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; padding: var(--space-2) var(--space-3); border-radius: var(--radius-2); }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface); }

/* Removed large search bar; optional small search styles kept for future */
.header__search { display: none; }

.footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: var(--space-12); }
.footer__grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); padding: var(--space-10) 0; }
.footer a { color: var(--ink); text-decoration: none; }
.footer small { color: var(--muted); }
.newsletter { display: flex; gap: var(--space-2); }
.newsletter input[type="email"] { flex: 1; padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-2); }

.main { display: block; }

/* Add spacing under sticky header on pages with immediate content */
body[data-page="smartphones"] .main,
body[data-page="accessories"] .main { padding-top: var(--space-6); }

/* Hero */
.hero { padding: var(--space-10) 0 var(--space-8); background: linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%); border-bottom: 1px solid var(--border); }
.hero__title { font-size: var(--fs-800); line-height: 1.2; margin: 0 0 var(--space-3); }
.hero__subtitle { color: var(--muted); margin: 0 0 var(--space-6); }
.hero__ctas { display: flex; gap: var(--space-3); flex-wrap: wrap; }

.trust-bar { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: center; color: var(--muted); padding: var(--space-4) 0; }
.trust-bar__item { display: flex; align-items: center; gap: var(--space-2); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); border: 1px solid transparent; border-radius: var(--radius-2); padding: 0.75rem 1rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-600); }
.btn--secondary { background: #fff; color: var(--ink); border-color: var(--border); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--block { width: 100%; }
.badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: var(--fs-300); background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
.badge--gradeA { background: #e6f4ff; border-color: #cde8ff; color: #0356a6; }
.badge--gradeB { background: #fff7e6; border-color: #ffe8b3; color: #8a5800; }
.badge--gradeC { background: #fff0f0; border-color: #ffc8c8; color: #7a1a1a; }

/* Cards & grids */
.section { padding: var(--space-10) 0; }
.section__title { font-size: var(--fs-700); margin-bottom: var(--space-4); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.grid--3 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-3); box-shadow: var(--shadow-1); overflow: hidden; display: flex; flex-direction: column; }
.card__media { aspect-ratio: 1/1; background: #eef2ff; display: flex; align-items: center; justify-content: center; }
.card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.card__title { margin: 0; font-size: var(--fs-500); }
.card__meta { color: var(--muted); font-size: var(--fs-300); }
.card__price { display: flex; align-items: baseline; gap: var(--space-2); font-weight: 700; }
.card__price del { color: var(--muted); font-weight: 400; }
.card__usp { color: var(--muted); font-size: var(--fs-300); }
.card__actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.card__flags { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; }
.card__scarcity { color: var(--danger); font-size: var(--fs-300); }

/* Filters / controls */
.controls { display: grid; gap: var(--space-3); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-3); padding: var(--space-4); }
.controls__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.controls label { font-weight: 600; font-size: var(--fs-300); }
.controls input, .controls select { width: 100%; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-2); }
.range { display: flex; align-items: center; gap: var(--space-2); }

/* Catalog layout (prevents overlap of sticky filters) */
.catalog { display: grid; gap: var(--space-4); grid-template-columns: 1fr; align-items: start; }

/* Contact form card */
.contact-card { max-width: 900px; margin: 0 auto; }

/* Modals & overlays */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(17,24,39,0.6); z-index: 100; padding: var(--space-4); }
.modal[open] { display: flex; }
.modal__dialog { background: #fff; border-radius: var(--radius-3); width: min(720px, 100%); box-shadow: var(--shadow-2); overflow: hidden; }
.modal__header, .modal__footer { padding: var(--space-4); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal__footer { border-bottom: 0; border-top: 1px solid var(--border); }
.modal__body { padding: var(--space-4); display: grid; gap: var(--space-4); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); background: #111827; color: #fff; padding: 0.75rem 1rem; border-radius: var(--radius-2); box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 120; }
.toast--show { opacity: 1; transform: translateX(-50%) translateY(-6px); pointer-events: auto; }

/* Banners / notices */
.notice { background: #fff; border: 1px dashed var(--border); border-radius: var(--radius-2); padding: var(--space-4); color: var(--muted); }

/* Testimonials */
.testimonials { display: grid; gap: var(--space-4); }
.testimonial { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-3); padding: var(--space-4); }
.stars { color: #fbbf24; }

/* Forms */
.form { display: grid; gap: var(--space-3); }
.form__row { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
.form label { font-weight: 600; font-size: var(--fs-300); }
.form input, .form select, .form textarea { width: 100%; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-2); font: inherit; }
.form textarea { min-height: 120px; resize: vertical; }
.form .hint { color: var(--muted); font-size: var(--fs-300); }
.input-error { border-color: var(--danger) !important; }
.error-text { color: var(--danger); font-size: var(--fs-300); }

/* Utilities */
.muted { color: var(--muted); }
.hidden { display: none !important; }
.center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.badge--pill { border-radius: 999px; }
.sticky-cta { position: sticky; bottom: 0; background: rgba(255,255,255,0.98); border-top: 1px solid var(--border); padding: var(--space-3); display: none; }

/* Pretty filters bar */
.filters { background: linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%); border: 1px solid var(--border); border-radius: var(--radius-3); padding: var(--space-4); box-shadow: var(--shadow-1); }
.filters__grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
.filters__field label, .filters__field span { display: block; font-weight: 600; font-size: var(--fs-300); margin-bottom: var(--space-2); }
.filters__field input[type="number"],
.filters__field input[type="range"],
.filters__field select { width: 100%; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-2); background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chips .badge { cursor: pointer; user-select: none; background: #fff; border-color: var(--border); transition: all .15s ease; display: inline-flex; align-items: center; }
/* Disable hover effects on filter chips */
.chips .badge:hover { transform: none; box-shadow: none; border-color: var(--border); }
/* Neutralize active chip blue styling */
.chips .badge.is-active { background: #fff; color: var(--ink); border-color: var(--border); }
.chips .badge input { margin-right: .35rem; }
@media (min-width: 600px) { .filters__grid { grid-template-columns: repeat(3, 1fr); } }

/* Filters 3-column split with centered content and clean separators */
.filters { padding: var(--space-2) var(--space-3); }
.filters__inline { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; gap: var(--space-2); }
.filters__inline::before, .filters__inline::after { content: ""; position: absolute; top: 4px; bottom: 4px; width: 1px; background: var(--border); }
.filters__inline::before { left: 33.333%; }
.filters__inline::after { left: 66.666%; }
.filters__inline .filters__field { display: flex; flex-direction: column; align-items: center; justify-content: center; padding-right: 0; margin-right: 0; }
.filters__inline .filters__field:not(:last-child)::after { display: none; }
.filters__field label { font-size: 0.75rem; margin-bottom: .2rem; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); font-weight: 700; }
#price-min, #price-max { width: 80px; padding: .3rem .45rem; }
.chips { gap: .25rem; justify-content: center; }
.chips .badge { padding: .2rem .5rem; font-size: 0.75rem; }
