/* ============================================
   Web Design Agency - Stylesheet (wersja 2)
   Poprawione menu mobilne - kompatybilne z Firefox
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1A237E;
  --accent: #FF6F00;
  --light-bg: #F5F5F5;
  --text-dark: #212121;
  --text-gray: #666666;
  --border-color: #E0E0E0;
  --white: #FFFFFF;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.fade-in {
  animation: fadeInUp 0.8s ease-out forwards;
}

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

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

/* Animacja rozwijania menu mobilnego (z góry w dół) */
@keyframes menuDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   BASE STYLES
   ============================================ */

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background-color: var(--white);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2.5rem;
  color: var(--primary);
}

h3 {
  font-size: 1.5rem;
  color: var(--primary);
}

p {
  margin-bottom: 1rem;
  color: var(--text-gray);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
}

.btn-primary:hover {
  background-color: #E55A00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 111, 0, 0.3);
}

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

.btn-secondary:hover {
  background-color: var(--primary);
  color: white;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

header {
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  position: relative; /* kotwica dla menu rozwijanego (top: 100%) */
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background-color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Nawigacja desktopowa - wiersz */
nav {
  display: flex;
  gap: 30px;
  align-items: center;
}

nav a {
  color: var(--text-dark);
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
  color: var(--accent);
}

/* --------------------------------------------
   PRZYCISK HAMBURGER (trzy kreski)
   Widoczny TYLKO na urządzeniach mobilnych
   -------------------------------------------- */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 210;
  padding: 0;
  touch-action: manipulation;
}

.mobile-menu-btn span {
  display: block;
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background-color: var(--primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Po otwarciu menu kreski zamieniają się w "X" */
.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #283593 100%);
  color: white;
  padding: 100px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  transform: translate(100px, -100px);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  color: white;
  margin-bottom: 20px;
  font-size: 3.5rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  margin-bottom: 30px;
}

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   SECTIONS
   ============================================ */

section {
  padding: 80px 0;
}

section.light-bg {
  background-color: var(--light-bg);
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.section-title p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid {
  display: grid;
  gap: 30px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: white;
  border-radius: 8px;
  padding: 30px;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-5px);
}

.card-image {
  width: 100%;
  height: 200px;
  background-color: var(--light-bg);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card h3 {
  margin-bottom: 15px;
}

.card p {
  margin-bottom: 20px;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  background-color: var(--light-bg);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h4 {
  color: var(--primary);
  margin-bottom: 20px;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: var(--text-gray);
}

.footer-section a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 30px;
  text-align: center;
  color: var(--text-gray);
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--primary);
}

input,
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 111, 0, 0.1);
}

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

/* ============================================
   RESPONSIVE DESIGN - MENU MOBILNE
   Poniżej 991px nawigacja chowa się za
   hamburgerem i rozwija PIONOWO pod nagłówkiem.
   Proste, w pełni wspierane w Firefox właściwości:
   position absolute + display flex + max-height vh.
   ============================================ */

@media (max-width: 991px) {
  /* Pokaż przycisk hamburger */
  .mobile-menu-btn {
    display: flex;
  }

  /* Domyślnie menu jest UKRYTE.
     Selektor #main-nav (ID) ma wyższą specyficzność
     niż "nav", więc na pewno nadpisze display:flex
     z desktopa - tak samo w Chrome i Firefox. */
  #main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.12);
    padding: 8px 20px 20px;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 190;
  }

  /* Po kliknięciu w hamburger - menu widoczne, PIONOWO */
  #main-nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    animation: menuDown 0.25s ease-out;
	width: 100%;        /* przywróć pełną szerokość */
  box-sizing: border-box;
  }

  /* Każdy link w osobnym wierszu */
  #main-nav.open a {
    display: block;
    width: 100%;
    padding: 0.1px 2px;
    font-size: 1rem;
    border-bottom: none;
  }

  /* Przycisk CTA na całą szerokość, na dole listy */
  #main-nav.open a.btn {
    margin-top: 14px;
    border-bottom: none;
    text-align: center;
    color: white;
  }
}

/* ============================================
   RESPONSIVE DESIGN - RESZTA
   ============================================ */

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  section {
    padding: 50px 0;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
    text-align: center;
  }

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

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  section {
    padding: 40px 0;
  }

  .card {
    padding: 20px;
  }

  .logo span {
    font-size: 1.15rem;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

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

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

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

.mt-20 {
  margin-top: 20px;
}

.mt-40 {
  margin-top: 40px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mb-40 {
  margin-bottom: 40px;
}

.opacity-0 {
  opacity: 0;
}

.hidden {
  display: none;
}
