/* ============================================================
   main.css – Globalne style, zmienne CSS, reset, utility classes
   Premier Motors v2.0
   ============================================================ */

/* ── CSS Custom Properties (Design Tokens) ── */
:root {
  /* Kolory – schemat biały/czarny/czerwony (Premier Motors) */
  --color-bg:          #ffffff;
  --color-bg-secondary:#f5f5f5;
  --color-bg-card:     #ffffff;
  --color-bg-card-hover:#fafafa;
  --color-gold:        #dc0000;
  --color-gold-light:  #ff2222;
  --color-gold-dim:    rgba(220, 0, 0, 0.06);
  --color-gold-glow:   rgba(220, 0, 0, 0.22);
  --color-white:       #1a1a1a;
  --color-white-dim:   rgba(26, 26, 26, 0.65);
  --color-white-muted: rgba(26, 26, 26, 0.4);
  --color-border:      rgba(220, 0, 0, 0.12);
  --color-border-subtle: rgba(0, 0, 0, 0.1);
  --color-error:       #c0392b;
  --color-success:     #27ae60;

  /* Typografia */
  --font-heading: 'Montserrat', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Rozmiary czcionek */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

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

  /* Border radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Cienie */
  --shadow-card:  0 2px 16px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 16px 48px rgba(220, 0, 0, 0.12);
  --shadow-gold:  0 0 30px rgba(220, 0, 0, 0.25);
  --shadow-glow:  0 0 60px rgba(220, 0, 0, 0.08);

  /* Przejścia */
  --transition-fast:   0.15s ease;
  --transition-base:   0.3s ease;
  --transition-slow:   0.5s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Układ */
  --nav-height:    80px;
  --max-width:     1280px;
  --section-gap:   var(--space-24);
}

/* ── Dark-context overrides (ciemne sekcje: nav, hero, footer, loader) ── */
/* Resetuje zmienne tekstowe do białych dla elementów na ciemnym tle */
.site-nav,
.hero,
.page-hero,
#page-loader,
.site-footer,
#cookie-banner,
.admin-body,
.admin-page,
.admin-login-page {
  --color-white: #f5f5f5;
  --color-white-dim: rgba(245, 245, 245, 0.7);
  --color-white-muted: rgba(245, 245, 245, 0.4);
  --color-border-subtle: rgba(255, 255, 255, 0.1);
  --color-bg-card: rgba(255, 255, 255, 0.06);
}

/* ── Normalizer / Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

/* Wyłącz animacje dla użytkowników preferujących zredukowany ruch */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

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

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-white);
}

h1 { font-size: clamp(2.5rem, 6vw, var(--text-7xl)); font-weight: 900; }
h2 { font-size: clamp(1.75rem, 4vw, var(--text-5xl)); font-weight: 800; }
h3 { font-size: clamp(1.25rem, 2.5vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }

p {
  color: var(--color-white-dim);
  line-height: 1.75;
}

/* ── Layout Helpers ── */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section {
  padding-block: var(--section-gap);
}

.section--tight {
  padding-block: var(--space-16);
}

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

.section-header .label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-3);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  max-width: 600px;
  margin-inline: auto;
  font-size: var(--text-lg);
}

/* Złota linia dekoracyjna pod nagłówkiem sekcji */
.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
  margin: var(--space-4) auto 0;
  border-radius: var(--radius-full);
}

/* ── Przyciski ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

/* Przycisk główny (czerwony) */
.btn--primary {
  background: linear-gradient(135deg, var(--color-gold), #b30000);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(220, 0, 0, 0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

/* Efekt pulsującego glow na przycisku CTA */
.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn--primary:hover::after {
  opacity: 1;
}

.btn--primary span {
  position: relative;
  z-index: 1;
}

/* Przycisk outline */
.btn--outline {
  background: transparent;
  color: var(--color-white);
  border: 1px solid var(--color-white-muted);
}

.btn--outline:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
  background: var(--color-gold-dim);
}

/* Przycisk czerwony outline */
.btn--gold-outline {
  background: transparent;
  color: var(--color-gold);
  border: 1px solid var(--color-gold);
}

.btn--gold-outline:hover {
  background: var(--color-gold);
  color: #ffffff;
  box-shadow: var(--shadow-gold);
}

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

.btn--lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-base);
}

/* ── Karty ofert – style bazowe ── */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
  position: relative;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-border);
}

/* ── Badge / Label ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge--gold {
  background: var(--color-gold-dim);
  color: var(--color-gold);
  border: 1px solid var(--color-border);
}

.badge--green {
  background: rgba(82, 201, 126, 0.1);
  color: #52c97e;
  border: 1px solid rgba(82, 201, 126, 0.3);
}

.badge--blue {
  background: rgba(82, 152, 201, 0.1);
  color: #5298c9;
  border: 1px solid rgba(82, 152, 201, 0.3);
}

.badge--gray {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-white-dim);
  border: 1px solid var(--color-border-subtle);
}

/* ── Formularze ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-white-dim);
  letter-spacing: 0.02em;
}

.form-input,
.form-select,
.form-textarea {
  background: #f9f9f9;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  color: #1a1a1a;
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px var(--color-gold-dim);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23dc0000' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

.form-select option {
  background: #ffffff;
  color: #1a1a1a;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--color-gold);
  margin-top: 2px;
  cursor: pointer;
}

.form-checkbox span {
  font-size: var(--text-sm);
  color: var(--color-white-dim);
  line-height: 1.5;
}

.form-checkbox a {
  color: var(--color-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-error);
}

/* ── Divider ── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--color-border-subtle);
}

/* ── Loader overlay (pierwsze wejście) ── */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-4);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.loader-logo span {
  color: var(--color-gold);
}

.loader-bar {
  width: 200px;
  height: 2px;
  background: var(--color-border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loader-bar::after {
  content: '';
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
  animation: loaderProgress 1.2s ease forwards;
  border-radius: var(--radius-full);
}

@keyframes loaderProgress {
  from { width: 0; }
  to   { width: 100%; }
}

/* ── Page transition ── */
body.page-exit {
  animation: pageExit 0.3s ease forwards;
}

@keyframes pageExit {
  to { opacity: 0; transform: translateY(-10px); }
}

/* ── Scroll to top button ── */
#scroll-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  z-index: 100;
  width: 48px;
  height: 48px;
  background: var(--color-gold);
  color: #ffffff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-gold);
}

#scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scroll-top:hover {
  background: var(--color-gold-light);
  transform: translateY(-3px);
}

/* ── Cookie Banner ── */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(17, 17, 17, 0.98);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-6);
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

#cookie-banner.visible {
  transform: translateY(0);
}

.cookie-inner {
  max-width: var(--max-width);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.cookie-text {
  font-size: var(--text-sm);
  color: var(--color-white-dim);
}

.cookie-text a {
  color: var(--color-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* ── Utility classes ── */
.text-gold    { color: var(--color-gold); }
.text-center  { text-align: center; }
.text-sm      { font-size: var(--text-sm); }
.font-heading { font-family: var(--font-heading); }
.font-bold    { font-weight: 700; }
.uppercase    { text-transform: uppercase; letter-spacing: 0.1em; }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.gap-2        { gap: var(--space-2); }
.gap-4        { gap: var(--space-4); }
.gap-6        { gap: var(--space-6); }
.gap-8        { gap: var(--space-8); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-8  { margin-top: var(--space-8); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-8  { margin-bottom: var(--space-8); }

.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.w-full   { width: 100%; }

/* Dekoracyjna linia złota */
.gold-line {
  display: block;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold), transparent);
  border-radius: var(--radius-full);
  margin-block: var(--space-4);
}

/* Separator sekcji – subtelny gradient */
.section-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin-inline: var(--space-6);
}

/* ── Subpage Hero Banner ── */
.page-hero {
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--space-16);
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #141414 0%, #0a0a0a 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 0%, rgba(220, 0, 0, 0.08) 0%, transparent 70%);
}

.page-hero .container {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--nav-height) + var(--space-16));
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
}

.page-hero .breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-white-muted);
  margin-bottom: var(--space-4);
}

.page-hero .breadcrumb a:hover {
  color: var(--color-gold);
}

.page-hero .breadcrumb span {
  color: var(--color-gold);
}

/* ── Stopka – style bazowe ── */
.site-footer {
  background: #080808;
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-16);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  padding-bottom: var(--space-12);
}

.footer-brand .logo {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
  display: inline-block;
}

.footer-brand .logo span {
  color: var(--color-gold);
}

.footer-brand p {
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: var(--space-3);
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  color: var(--color-white-dim);
}

.footer-social a:hover {
  background: var(--color-gold-dim);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.footer-col h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-white);
  margin-bottom: var(--space-6);
}

.footer-col ul li {
  margin-bottom: var(--space-3);
}

.footer-col ul li a {
  font-size: var(--text-sm);
  color: var(--color-white-dim);
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-col ul li a:hover {
  color: var(--color-gold);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.footer-contact-item .icon {
  color: var(--color-gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-contact-item span {
  font-size: var(--text-sm);
  color: var(--color-white-dim);
  line-height: 1.5;
}

.footer-contact-item a {
  color: var(--color-white-dim);
  transition: color var(--transition-fast);
}

.footer-contact-item a:hover {
  color: var(--color-gold);
}

.footer-bottom {
  border-top: 1px solid var(--color-border-subtle);
  padding-block: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer-bottom p {
  font-size: var(--text-sm);
  color: var(--color-white-muted);
}

.footer-bottom a {
  color: var(--color-white-muted);
  transition: color var(--transition-fast);
  font-size: var(--text-sm);
}

.footer-bottom a:hover {
  color: var(--color-gold);
}

/* ── Responsywność – breakpoints ── */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --section-gap: var(--space-16);
  }
  .container {
    padding-inline: var(--space-4);
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --nav-height: 64px;
  }
  .btn--lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
  }
}
