@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

/* --------------------
   Global Reset & Base
-------------------- */
/* Base tokens for quick theme tuning */
:root {
  --arrow-size: 48px; /* button diameter */
  --arrow-bg: rgba(20, 20, 20, 0.55); /* button background */
  --arrow-bg-hover: rgba(20, 20, 20, 0.75);
  --arrow-ring: rgba(255, 255, 255, 0.85);
  --arrow-icon: #ffffff;
  --arrow-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --arrow-shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  font-family: "Montserrat", sans-serif !important;
}

/* Ensure form controls also inherit Montserrat */
input,
textarea,
select,
button {
  font-family: "Montserrat", sans-serif !important;
}

body {
  margin: 0;
  background: #fdfdfd;
  line-height: 1.5;
  color: #333;
}

h2 {
  margin-bottom: 1rem;
}
p {
  line-height: 1.5;
  font-weight: 500;
}

/* --------------------
   Header
-------------------- */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: #fff;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 2rem;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #333;
  font-weight: bold;
  font-size: 1.2rem;
  font-family: "Montserrat", sans-serif;
}
.logo img {
  height: 60px;
  margin-right: 0.5rem;
}

nav {
  display: flex;
  gap: 1.5rem;
}
nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-family: "Montserrat", sans-serif;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.3s ease, color 0.3s ease;
}
nav a:hover {
  color: #00704a;
  background: rgba(0, 112, 74, 0.1);
}

/* --------------------
   Language Toggle
-------------------- */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  user-select: none;
}

.lang-toggle input {
  display: none;
}

.lang-toggle label {
  position: relative;
  width: 50px;
  height: 24px;
  background: #e0e0e0; /* нейтральний фон */
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s;
}

.lang-toggle label::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s;
}

.lang-toggle input:checked + label::after {
  transform: translateX(26px);
}

.flag img {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 4px;
  object-fit: cover;
}

/* --------------------
   Hamburger Menu
-------------------- */
/* Hamburger button */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  z-index: 1100;
  margin-left: auto;
}

.hamburger span {
  display: block;
  height: 3px;
  background: #333;
  border-radius: 2px;
  transition: 0.3s;
}

/* Animation for open state */
.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --------------------
   Responsive Header
-------------------- */
/* Mobile menu fullscreen */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    display: none;
    z-index: 999;
  }

  nav.active {
    display: flex;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    flex-grow: 1;
    justify-content: center;
  }

  nav a {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
  }

  nav a:hover {
    color: #00704a;
  }

  /* Language toggle at bottom of menu */
  .mobile-lang {
    margin-top: auto;
    margin-bottom: 2rem;
  }

  .desktop-lang {
    display: none;
  }
}

/* Desktop: keep language toggle in header */
@media (min-width: 769px) {
  .mobile-lang {
    display: none;
  }
  .desktop-lang {
    display: flex;
  }
}

/* --------------------
   Cloud Section Base
-------------------- */
.cloud-section {
  min-height: 50vh;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.cloud-section .content {
  max-width: 800px;
  z-index: 2;
  position: relative;
  overflow: hidden;
}

.clouds {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.cloud {
  background: #fff;
  border-radius: 100px;
  position: absolute;
  width: 200px;
  height: 60px;
  opacity: 0.9;
  z-index: 0;
}

.cloud:before,
.cloud:after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 100px;
}
.cloud:before {
  width: 100px;
  height: 100px;
  top: -30px;
  left: 10px;
}
.cloud:after {
  width: 120px;
  height: 120px;
  top: -40px;
  right: 15px;
}

/* Cloud animation */
@keyframes moveclouds {
  0% {
    transform: translateX(-50px);
  }
  100% {
    transform: translateX(calc(100vw + 100px));
  }
}
.x1 {
  top: 20%;
  left: -50px;
  animation: moveclouds 25s linear infinite;
}
.x2 {
  top: 40%;
  left: -50px;
  animation: moveclouds 30s linear infinite;
}
.x3 {
  top: 60%;
  left: -50px;
  animation: moveclouds 35s linear infinite;
}
.x4 {
  top: 30%;
  left: -50px;
  animation: moveclouds 40s linear infinite;
}
.x5 {
  top: 50%;
  left: -50px;
  animation: moveclouds 45s linear infinite;
}

/* Intro block gradient */
.intro-block {
  background: linear-gradient(
    to bottom,
    #cce5ff 0%,
    #fdfdfd 70%,
    transparent 100%
  );
  margin-top: 76px;
  overflow: hidden;
}

/* Pre-footer block gradient */
.pre-footer {
  background: linear-gradient(to bottom, #fdfdfd 0%, #eaeaea 70%, #222 100%);
  padding: 2rem 1rem 4rem;
}
.pre-footer h2 {
  font-size: 2rem;
  color: #333;
}
.pre-footer p {
  color: #444;
  line-height: 1.6;
}

/* --------------------
   Hero Section
-------------------- */
.hero {
  position: relative;
  height: 300vh; /* scroll space */
}

.hero-sticky {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  width: 100%;
}

.hero-sticky model-viewer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 1;
}

.hero-sticky .overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
  pointer-events: none;
}

.content-block {
  max-width: 40%;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.6s ease;
  position: absolute;
}
.content-block.active {
  opacity: 1;
}
.content-block.fixed-first {
  position: fixed;
  top: 50%;
  left: 5%;
  transform: translate(0, -36%);
}
.left {
  left: 5%;
}
.right {
  right: 5%;
}

@media (max-width: 900px) {
  .content-block {
    max-width: 85%;
  }
  .left {
    left: 7.5%;
  }
  .right {
    right: 7.5%;
  }
}

/* Model toggle: default green, checked black */
.model-toggle {
  --track-w: 56px;
  --track-h: 28px;
  --knob: 20px;
  --gap: 12px;
  display: inline-flex;
  align-items: center;
  gap: var(--gap);
  user-select: none;
  touch-action: manipulation;
  position: relative;
  z-index: 1200;
  font-weight: 600;
  color: #222;
}

/* text labels */
.model-toggle .label {
  font-size: 0.95rem;
  line-height: 1;
  color: #333;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

/* visually hide the checkbox but keep it interactive */
.model-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
}

/* visible track (the label element acts as the track) */
.model-toggle > label {
  display: inline-block;
  width: var(--track-w);
  height: var(--track-h);
  background: linear-gradient(180deg, #4caf50 0%, #3b9b3b 100%); /* default green */
  border-radius: 999px;
  position: relative;
  transition: background 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.06);
  flex: 0 0 auto;
}

/* knob */
.model-toggle > label::after {
  content: "";
  position: absolute;
  top: calc((var(--track-h) - var(--knob)) / 2);
  left: 4px;
  width: var(--knob);
  height: var(--knob);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  transition: transform 0.22s cubic-bezier(.2,.9,.2,1), box-shadow 0.18s;
  transform: translateX(0);
  will-change: transform;
}

/* checked state: track becomes black, knob moves right */
.model-toggle input:checked + label {
  background: linear-gradient(180deg, #111 0%, #000 100%); /* black when enabled */
  box-shadow: inset 0 -2px 0 rgba(255,255,255,0.03);
}
.model-toggle input:checked + label::after {
  transform: translateX(calc(var(--track-w) - var(--knob) - 8px));
}

/* focus-visible for keyboard accessibility */
.model-toggle input:focus-visible + label {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0,0,0,0.12), inset 0 -2px 0 rgba(0,0,0,0.06);
}

/* smaller on very small screens */
@media (max-width: 420px) {
  .model-toggle {
    --track-w: 48px;
    --track-h: 24px;
    --knob: 18px;
    --gap: 8px;
    font-size: 0.9rem;
  }
  .model-toggle .label {
    font-size: 0.9rem;
  }
}

/* optional: center inside hero */
.hero .model-toggle {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

model-viewer::part(default-progress-bar) {
  display: none;
}

/* --------------------
   Product Top Section
-------------------- */
/* Layout */
.product-section {
  background: #fff;
  padding: 5rem 1rem 3rem;
}
.product-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr; /* two columns like AlfaPack */
  gap: 2rem;
}

/* Gallery */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Gallery viewport: keep it as your block frame */
.gallery-main {
  position: relative;
  width: 100%;
  height: 520px; /* you can keep or change */
  border: none; /* remove border if you want true full-bleed */
  border-radius: 10px; /* optional */
  background: #000; /* helps avoid white edges during cover cropping */
  overflow: hidden;
}

/* Track stays as a horizontal strip */
.gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s ease;
}

/* Make each image fill the block completely */
.gallery-track img {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  object-fit: cover; /* fills the block */
  object-position: center; /* keep focus centered; adjust if needed */
  display: block;
}

/* Arrows */
/* Positioning stays the same */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--arrow-size);
  height: var(--arrow-size);
  border: none;
  border-radius: 50%;
  background: var(--arrow-bg);
  box-shadow: var(--arrow-shadow);
  cursor: pointer;
  z-index: 3;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, box-shadow 0.25s ease, transform 0.15s ease;
  outline: none;
  /* Smooth overlay on busy backgrounds */
  backdrop-filter: blur(6px);
}

/* Ring border */
.gallery-arrow::before {
  content: "";
  position: absolute;
  inset: -2px; /* creates a ring slightly outside */
  border-radius: 50%;
  border: 2px solid var(--arrow-ring);
  opacity: 0.9;
  pointer-events: none;
}

/* Inner highlight for subtle depth */
.gallery-arrow::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(transparent 40%, rgba(255, 255, 255, 0.15) 100%);
  pointer-events: none;
}

/* Chevron icon via SVG mask for crisp edges */
.gallery-arrow span {
  width: 40%;
  height: 40%;
  background-color: var(--arrow-icon);
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  display: block;
}

/* Right chevron */
.gallery-arrow.next span {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M9 18l6-6-6-6"/></svg>');
}

/* Left chevron */
.gallery-arrow.prev span {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M15 6l-6 6 6 6"/></svg>');
}

/* Hover/active/focus states */
.gallery-arrow:hover {
  background: var(--arrow-bg-hover);
  box-shadow: var(--arrow-shadow-hover);
}

.gallery-arrow:active {
  transform: translateY(-50%) scale(0.98);
}

/* Keyboard focus ring */
.gallery-arrow:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 112, 74, 0.4), var(--arrow-shadow-hover);
}

/* Placement */
.gallery-arrow.prev {
  left: 14px;
}
.gallery-arrow.next {
  right: 14px;
}

/* Responsive sizing for mobile */
@media (max-width: 600px) {
  :root {
    --arrow-size: 42px;
  }
  .gallery-arrow.prev {
    left: 10px;
  }
  .gallery-arrow.next {
    right: 10px;
  }
}

/* Thumbnails strip */
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}
.thumb {
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.thumb.is-active {
  border-color: #00704a;
  box-shadow: 0 0 0 2px rgba(0, 112, 74, 0.15);
}
.thumb img {
  display: block;
  width: 100%;
  height: 76px;
  object-fit: cover;
  border-radius: 6px;
}

/* Info side */
.product-info h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 0.5rem;
}
.product-info .meta {
  display: flex;
  gap: 1rem;
  color: #666;
  font-weight: 500;
  margin-bottom: 1rem;
}
.product-info p {
  font-size: 1.05rem;
  color: #444;
  margin: 0 0 1.2rem;
}
/* Keep existing product-section and product-inner as defined earlier */

/* Ensure clean spacing after removing CTA bar */
.product-info .info-panels {
  margin-top: 1rem;
}

/* Optional: slightly tighter thumbnails on mobile */
@media (max-width: 600px) {
  .gallery-thumbs {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Specs list */
.product-specs {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr; /* two-column specs like reference */
  gap: 0.5rem 1rem;
}
.product-specs li {
  position: relative;
  padding-left: 1rem;
  color: #333;
  font-weight: 500;
}
.product-specs li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #00704a;
  font-weight: 700;
}

/* CTA bar */
.cta-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  margin-bottom: 1rem;
}
.price .label {
  color: #666;
  font-weight: 600;
  margin-right: 0.5rem;
}
.price .value {
  color: #222;
  font-weight: 700;
}

.qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.qty select {
  padding: 0.5rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #222;
}

/* Buttons similar tone */
.btn {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.btn.primary {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: #fff;
}
.btn.secondary {
  background: #fff;
  color: #2e7d32;
  border: 2px solid #2e7d32;
}

/* Info panels (delivery/payment) */
.info-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.info-panels .panel {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 1rem;
  background: #fafafa;
}
.info-panels .panel h3 {
  font-size: 1.1rem;
  color: #333;
  margin: 0 0 0.4rem;
}
.info-panels .panel p {
  margin: 0;
  color: #555;
}

@media (max-width: 900px) {
  .product-specs {
    grid-template-columns: 1fr;
  }
  .info-panels {
    grid-template-columns: 1fr;
  }
  .cta-bar {
    grid-template-columns: 1fr;
  }
}

/* Responsive product layout: stack on small screens */
@media (max-width: 900px) {
  .product-inner {
    grid-template-columns: 1fr; /* stack gallery above info */
    gap: 1rem;
  }

  .gallery-main {
    height: 360px; /* smaller on mobile */
  }

  /* Make gallery-track slides always match container width */
  .gallery-track img {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
  }

  /* Thumbs become a horizontal scrollable strip */
  .gallery-thumbs {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 6px;
  }
  .gallery-thumbs .thumb {
    min-width: 84px;
    flex: 0 0 auto;
  }
}

/* Improve gallery responsiveness on very large screens */
@media (min-width: 1200px) {
  .gallery-main {
    height: 620px;
  }
}

/* --------------------
   Video
-------------------- */

.video-section {
  background: #f9f9f9;
  padding: 3rem 1rem;
  text-align: center;
}

.video-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #333;
}

.video-grid {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.video-item {
  max-width: 400px;
  flex: 1 1 300px;
}

.video-item video {
  width: 100%;
  aspect-ratio: 9 / 16; /* пропорція як у телефону */
  height: auto;
  object-fit: cover; /* запобігає викривленню */
  border-radius: 8px;
}

.video-item p {
  font-weight: 500;
  color: #444;
}

/* --------------------
   Footer
-------------------- */
footer {
  background: #222;
  color: #fff;
  text-align: center;
  padding: 5rem 1rem 2rem;
}

/* --------------------
   Footer Form Modern Inverted Styles
-------------------- */
footer form {
  max-width: 500px;
  margin: 0 auto 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  text-align: left;
}

footer input,
footer textarea {
  padding: 0.9rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff; /* light background */
  color: #222; /* dark text */
  transition: all 0.3s ease;
}

footer input::placeholder,
footer textarea::placeholder {
  color: #666;
  font-weight: 400;
}

footer input:focus,
footer textarea:focus {
  outline: none;
  border-color: #4caf50; /* accent color */
  background: #f9f9f9;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

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

footer button {
  padding: 0.9rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

footer button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

footer button:active {
  transform: translateY(0);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Form message (appears above the form) */
.form-message {
  max-width: 500px;
  margin: 0 auto 1rem auto;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  text-align: left;
  display: none; /* hidden by default */
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* States */
.form-message.info {
  background: #fff8e6;
  color: #6a4b00;
  border: 1px solid #f0dca8;
}
.form-message.success {
  background: #e9f7ef;
  color: #0b6b3a;
  border: 1px solid #bfe6c9;
}
.form-message.error {
  background: #fdecea;
  color: #7a1f1f;
  border: 1px solid #f5c2c2;
}

/* Small helper for inline errors under inputs (optional) */
.field-error {
  color: #7a1f1f;
  font-size: 0.9rem;
  margin-top: 0.35rem;
  display: none;
}
