/* ============================================
   U.B.Max s.r.o. - Dark & Premium Theme
   Archivo + DM Sans | Charcoal + Amber
   ============================================ */

:root {
  --primary: #d4920a;
  --secondary: #1a1a1a;
  --accent: #e8a820;
  --dark: #0d0d0d;
  --light: #f5f1eb;
  --text: #e0dcd5;
  --text-light: #8a8580;
  --text-dark: #2a2520;
}

/* ---- Base ---- */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

/* Contain slide animations that push elements outside bounds */
#about_1,
#services_1,
#features_1,
#contact_1,
#gallery_1 {
  overflow-x: hidden;
}

::selection {
  background: var(--primary);
  color: var(--dark);
}

/* ---- Navigation ---- */
.nav-inner {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-scrolled {
  background: rgba(13, 13, 13, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(212, 146, 10, 0.12);
}

.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--primary);
}

/* ---- Hero ---- */
.hero-overlay {
  background: linear-gradient(180deg, rgba(13,13,13,0.6) 0%, rgba(13,13,13,0.4) 40%, rgba(13,13,13,0.7) 100%);
}

.hero-accent-line {
  width: 60px;
  height: 3px;
  background: var(--primary);
}

/* ---- Section Label ---- */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--primary);
  font-family: 'Archivo', sans-serif;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--primary);
  margin-right: 12px;
  vertical-align: middle;
}

/* ---- Stats Bar ---- */
.stats-bar {
  background: var(--secondary);
  border-top: 1px solid rgba(212, 146, 10, 0.15);
  border-bottom: 1px solid rgba(212, 146, 10, 0.15);
}

.stat-item {
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 40px;
  background: rgba(212, 146, 10, 0.2);
}

/* ---- About Section ---- */
.about-image-wrapper {
  position: relative;
}

.about-image-wrapper::before {
  content: '';
  position: absolute;
  top: -12px;
  left: -12px;
  right: 12px;
  bottom: 12px;
  border: 2px solid var(--primary);
  border-radius: 12px;
  z-index: 0;
  opacity: 0.3;
}

/* ---- Services Zigzag ---- */
.service-card {
  background: rgba(26, 26, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.4s ease;
}

.service-card:hover {
  border-color: rgba(212, 146, 10, 0.25);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(212, 146, 10, 0.08);
}

.service-number {
  font-family: 'Archivo', sans-serif;
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(212, 146, 10, 0.08);
  position: absolute;
  top: -10px;
  left: -5px;
  z-index: 0;
  pointer-events: none;
}

.service-image {
  overflow: hidden;
  border-radius: 12px;
}

.service-image img {
  transition: transform 0.6s ease;
}

.service-card:hover .service-image img {
  transform: scale(1.08);
}

/* ---- Gallery Masonry ---- */
.gallery-item {
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(13, 13, 13, 0.8) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
  opacity: 1;
}

.gallery-item img {
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.gallery-item:hover .gallery-caption {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Features Grid ---- */
.feature-card {
  background: rgba(26, 26, 26, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--primary);
  transition: all 0.3s ease;
}

.feature-card:hover {
  background: rgba(26, 26, 26, 0.8);
  transform: translateX(8px);
  box-shadow: 0 8px 32px rgba(212, 146, 10, 0.06);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(212, 146, 10, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
  background: var(--primary);
  color: var(--dark);
}

/* ---- CTA Banner ---- */
.cta-overlay {
  background: linear-gradient(135deg, rgba(13,13,13,0.55) 0%, rgba(13,13,13,0.35) 100%);
}

/* ---- Contact Section ---- */
.contact-form input,
.contact-form textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 10px;
  padding: 14px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  width: 100%;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(212, 146, 10, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-light);
}

.contact-info-card {
  background: rgba(212, 146, 10, 0.06);
  border: 1px solid rgba(212, 146, 10, 0.12);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.contact-info-card:hover {
  background: rgba(212, 146, 10, 0.1);
  transform: translateY(-2px);
}

/* ---- Buttons ---- */
.btn-primary {
  background: var(--primary);
  color: var(--dark);
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-family: 'Archivo', sans-serif;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(212, 146, 10, 0.2);
}

.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  padding: 14px 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-family: 'Archivo', sans-serif;
  font-weight: 500;
  text-decoration: none;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

/* ---- Footer ---- */
.footer-section {
  background: var(--secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-link {
  color: var(--text-light);
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--primary);
}

.footer-social-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: all 0.3s ease;
}

.footer-social-icon:hover {
  background: var(--primary);
  color: var(--dark);
  transform: translateY(-3px);
}

/* ---- Scroll Top ---- */
#scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Mobile Menu ---- */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 13, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu a {
  font-family: 'Archivo', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* ---- Hamburger ---- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 101;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
  }

  .stat-item:not(:last-child)::after {
    display: none;
  }

  .service-number {
    position: relative;
    top: auto;
    left: auto;
    font-size: 2.5rem;
    display: block;
    margin-bottom: -8px;
    color: rgba(212, 146, 10, 0.15);
  }

  .service-card .grid {
    gap: 1rem;
  }
}

/* ---- Map ---- */
.map-container {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.map-container iframe {
  width: 100%;
  height: 280px;
  border: 0;
  filter: grayscale(0.6) brightness(0.7) contrast(1.1);
  transition: filter 0.3s ease;
}

.map-container:hover iframe {
  filter: grayscale(0.2) brightness(0.85) contrast(1.05);
}

/* ---- Decorative Background Pattern ---- */
.bg-dot-pattern {
  background-image: radial-gradient(rgba(212, 146, 10, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ---- Scroll Animations ---- */
.anim-fade-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.anim-fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.anim-slide-left {
  opacity: 0;
  transform: translateX(-70px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.anim-slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.anim-slide-right {
  opacity: 0;
  transform: translateX(70px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.anim-slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.anim-scale-in {
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.anim-scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children */
.anim-stagger-parent > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.anim-stagger-parent.visible > * {
  opacity: 1;
  transform: translateY(0);
}
.anim-stagger-parent.visible > *:nth-child(1) { transition-delay: 0.05s; }
.anim-stagger-parent.visible > *:nth-child(2) { transition-delay: 0.1s; }
.anim-stagger-parent.visible > *:nth-child(3) { transition-delay: 0.15s; }
.anim-stagger-parent.visible > *:nth-child(4) { transition-delay: 0.2s; }
.anim-stagger-parent.visible > *:nth-child(5) { transition-delay: 0.25s; }
.anim-stagger-parent.visible > *:nth-child(6) { transition-delay: 0.3s; }
.anim-stagger-parent.visible > *:nth-child(7) { transition-delay: 0.35s; }
.anim-stagger-parent.visible > *:nth-child(8) { transition-delay: 0.4s; }

/* ---- Reduced Motion ---- */
@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;
  }

  .anim-fade-up, .anim-slide-left, .anim-slide-right,
  .anim-scale-in, .anim-stagger-parent > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---- Gallery Masonry Grid ---- */
.masonry-grid {
  columns: 3;
  column-gap: 16px;
}

.masonry-grid .gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
}

@media (max-width: 1024px) {
  .masonry-grid {
    columns: 2;
  }
}

@media (max-width: 640px) {
  .masonry-grid {
    columns: 1;
  }
}

/* ---- Form Success/Error ---- */
.form-message {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.form-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* ============================================
   RESPONSIVE FIXES
   ============================================ */

/* ---- Tablets & Small Laptops (max-width: 768px) ---- */
@media (max-width: 768px) {
  /* Stats bar: 2x2 grid */
  .stats-bar .max-w-6xl {
    flex-wrap: wrap;
  }

  .stat-item {
    flex: 0 0 50%;
    padding: 16px 12px;
  }

  /* About image decorator */
  .about-image-wrapper::before {
    top: -8px;
    left: -8px;
    right: 8px;
    bottom: 8px;
  }

  /* Buttons: reduce padding */
  .btn-primary,
  .btn-outline {
    padding: 12px 24px;
    font-size: 0.9rem;
  }

  /* Contact info cards */
  .contact-info-card {
    padding: 16px;
  }

  /* Map */
  .map-container iframe {
    height: 220px;
  }

  /* Footer grid */
  .footer-section .grid {
    gap: 2rem;
  }
}

/* ---- Small Phones (max-width: 480px) ---- */
@media (max-width: 480px) {
  /* Stats bar: tighter */
  .stat-item {
    padding: 14px 8px;
  }

  .stat-item .font-heading {
    font-size: 1.5rem;
  }

  .stat-item .text-text-muted {
    font-size: 0.7rem;
  }

  /* Service cards: tighter padding */
  .service-card {
    padding: 16px;
  }

  .service-number {
    font-size: 2rem;
    margin-bottom: -6px;
  }

  /* Feature cards */
  .feature-card {
    padding: 16px;
  }

  .feature-icon {
    width: 40px;
    height: 40px;
  }

  /* Gallery */
  .gallery-caption {
    padding: 10px 14px;
  }

  /* Scroll-to-top button */
  #scroll-top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
}

/* ---- Very Small Screens (max-width: 350px) ---- */
@media (max-width: 350px) {
  /* All containers: reduce side padding */
  .max-w-7xl,
  .max-w-6xl,
  .max-w-5xl,
  .max-w-4xl {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Nav: compact */
  .nav-inner {
    padding: 8px 12px;
  }

  .nav-inner .font-heading {
    font-size: 1rem;
  }

  .nav-inner img {
    width: 32px;
    height: 32px;
  }

  /* Hero: scale down */
  #hero_1 h1 {
    font-size: 1.75rem !important;
    line-height: 1.2;
  }

  #hero_1 p {
    font-size: 0.9rem !important;
  }

  /* Hero CTA: stack full width */
  #hero_1 .flex {
    flex-direction: column !important;
    width: 100%;
  }

  #hero_1 .flex a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Stats bar: single column */
  .stat-item {
    flex: 0 0 100%;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .stat-item:not(:last-child)::after {
    display: none;
  }

  .stat-item:not(:first-child) {
    border-top: 1px solid rgba(212, 146, 10, 0.1);
  }

  .stat-item .font-heading {
    font-size: 1.3rem;
    margin-bottom: 0;
  }

  .stat-item .text-text-muted {
    font-size: 0.65rem;
  }

  /* Section headings */
  .section-header h2 {
    font-size: 1.5rem !important;
  }

  /* Service cards */
  .service-card {
    padding: 12px;
  }

  .service-card h3 {
    font-size: 1rem;
  }

  .service-number {
    font-size: 1.75rem;
    margin-bottom: -4px;
  }

  /* About image: clamp size */
  #about_1 img {
    max-height: 240px;
  }

  .about-image-wrapper::before {
    display: none;
  }

  /* Contact: tighter padding, break long values */
  .contact-info-card {
    padding: 12px;
    word-break: break-all;
  }

  .contact-info-card .font-heading {
    font-size: 0.85rem;
  }

  /* CTA banner heading */
  .cta-heading {
    font-size: 1.4rem !important;
  }

  .cta-text {
    font-size: 0.85rem !important;
  }

  /* Buttons: smaller */
  .btn-primary,
  .btn-outline {
    padding: 10px 18px;
    font-size: 0.8rem;
  }

  /* Map */
  .map-container iframe {
    height: 180px;
  }

  /* Scroll-to-top: closer to edge */
  #scroll-top {
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}