/* ============================================
   O.N.D. - Clean Responsive Stylesheet
   Mobile-First Approach
   ============================================ */

/* === RESET & BASE === */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  padding-top: 60px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: rgba(220, 240, 255, 0.95);
  color: white;
  font-weight: bold;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background image using pseudo-element for better mobile support */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('your-image.png') no-repeat center center;
  background-size: cover;
  background-color: rgba(220, 240, 255, 0.95);
  background-attachment: scroll;
  z-index: -2;
  pointer-events: none;
  /* Fix for iOS Safari - use transform for better performance */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  will-change: transform;
  /* Fix for iOS Safari */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* Prevent background from disappearing on scroll */
  -webkit-perspective: 1000;
  perspective: 1000;
}

/* Overlay for better text readability */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.1);
  z-index: -1;
  pointer-events: none;
}

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

main {
  flex: 1;
  width: 100%;
  padding-bottom: 20px;
  overflow-x: hidden;
}

/* === HEADER === */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(26, 103, 143, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  width: 100%;
  overflow: visible;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  position: relative;
  min-height: 50px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-icon {
  height: 22px;
  width: 22px;
  flex-shrink: 0;
}

/* Navigation - Hidden on mobile by default */
.top-bar nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(26, 103, 143, 0.98);
  flex-direction: column;
  padding: 12px 16px;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  z-index: 1002;
}

.top-bar .menu-checkbox:checked ~ nav {
  display: flex;
}

.menu-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.top-bar nav a {
  padding: 10px 8px;
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.top-bar nav a:last-child {
  border-bottom: none;
}

.top-bar nav a:hover {
  color: #ffd700;
}

/* Menu Toggle Button */
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 18px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  min-width: 40px;
  min-height: 40px;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  position: relative;
  z-index: 1001;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
}

.menu-toggle:active {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.menu-checkbox:checked + .menu-toggle {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Language Switcher */
.language-switcher {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.lang-btn {
  font-size: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  min-width: 36px;
  min-height: 36px;
  transition: transform 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.lang-btn:active {
  opacity: 0.7;
  transform: scale(0.95);
}

/* === FOOTER === */
footer {
  margin-top: auto;
  text-align: center;
  padding: 16px 12px;
  font-size: 0.85rem;
  background-color: rgba(26, 103, 143, 0.85);
  line-height: 1.4;
}

/* === HERO SECTION === */
.hero-section {
  padding: 27px 16px 30px;
  text-align: center;
}

.hero-text {
  font-size: clamp(2rem, 10vw, 5rem);
  line-height: 1.2;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  color: rgba(1, 86, 106, 0.95);
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.6);
}

/* === INTRO SECTION === */
.intro {
  text-align: center;
  max-width: 800px;
  margin: 16px auto;
  padding: 12px 16px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  backdrop-filter: blur(2px);
}

.intro h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  margin: 0 0 8px;
  color: #000;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.intro p {
  color: #000;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  line-height: 1.5;
  margin: 0;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* === CARDS === */
.contact-card,
.product-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  text-align: center;
  color: #333;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px 12px;
  aspect-ratio: 1 / 1;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-height: 0;
  overflow: hidden;
}

.contact-card:active,
.product-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.contact-card img,
.product-card img {
  width: 70%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin-bottom: 8px;
  flex-shrink: 1;
  min-height: 0;
}

.contact-card h3,
.product-card h3 {
  margin: 4px 0 2px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
}

.contact-card p,
.product-card p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #01566a;
  line-height: 1.2;
}

/* === GRIDS === */
.contact-grid,
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px 12px;
  max-width: 1200px;
  margin: 0 auto 30px;
}

/* === PRODUCT PAGE === */
.product-page {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.product-media {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.product-media img {
  width: 100%;
  max-width: 300px;
  height: auto;
  object-fit: contain;
}

.product-info {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 24px;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: #01566a;
  margin: 0 0 16px;
}

.product-desc {
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 24px;
  color: #555;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.product-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  min-height: 50px;
  transition: transform 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
  border: none;
  cursor: pointer;
}

.product-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.product-btn.primary {
  background: #ff9900;
  color: #111;
}

.product-btn:not(.primary) {
  background: rgba(1, 86, 106, 0.95);
  color: #fff;
}

/* === VIDEO SECTION === */
.video-section {
  padding: 20px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-video {
  width: 100%;
  max-width: 1000px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

/* === GALLERY === */
.gallery-section {
  padding: 40px 16px;
}

.image-container {
  max-width: 600px;
  margin: 0 auto;
  opacity: 0;
  transform: translateX(-100px);
  transition: all 1s ease-out;
}

.image-container.visible {
  opacity: 1;
  transform: translateX(0);
}

.image-container img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ============================================
   TABLET & DESKTOP STYLES
   ============================================ */

@media (min-width: 768px) {
  body {
    padding-top: 70px;
  }

  .top-bar {
    padding: 15px 20px;
    gap: 20px;
  }

  .logo {
    font-size: 1.4rem;
  }

  .logo-icon {
    height: 28px;
    width: 28px;
  }

  /* Show navigation on desktop */
  .menu-toggle {
    display: none;
  }

  .top-bar nav {
    display: flex;
    position: static;
    background: transparent;
    flex-direction: row;
    padding: 0;
    gap: 22px;
    box-shadow: none;
    border-top: none;
  }

  .top-bar nav a {
    padding: 4px 6px;
    border-bottom: none;
    font-size: 1rem;
  }

  .language-switcher {
    margin-left: 20px;
  }

  .lang-btn:hover {
    transform: scale(1.1);
  }

  .hero-section {
    padding: 33px 20px 40px;
  }

  .intro {
    padding: 0 20px;
    margin: 30px auto;
  }

  .contact-grid,
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 30px 20px;
  }

  .contact-card,
  .product-card {
    padding: 25px;
  }

  .contact-card:hover,
  .product-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  }

  .product-page {
    grid-template-columns: 1fr 1fr;
    gap: 35px;
    padding: 0 20px;
  }

  .product-media img {
    max-width: 420px;
  }

  .product-actions {
    flex-direction: row;
  }

  .product-btn {
    flex: 1;
  }

  .product-btn:hover {
    transform: translateY(-2px);
  }

  footer {
    padding: 20px;
  }
}

@media (min-width: 1024px) {
  .contact-grid,
  .products-grid {
    gap: 35px;
    max-width: 1400px;
    grid-template-columns: repeat(4, 1fr);
  }
}

/* === MOBILE BACKGROUND FIX === */
:root {
  --body-height: 100vh;
}

@media (max-width: 768px) {
  /* Fix background image on mobile devices - use absolute instead of fixed */
  body::before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    /* Use CSS variable set by JavaScript to match actual body height */
    height: var(--body-height, 100vh);
    min-height: 100vh;
    /* Ensure background covers all content */
    background-attachment: scroll;
    /* Remove transform that might cause issues */
    -webkit-transform: none;
    transform: none;
    /* Fix for iOS - prevent background from disappearing */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Ensure background stays visible */
    will-change: auto;
  }

  body::after {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: var(--body-height, 100vh);
    min-height: 100vh;
    /* Fix for iOS */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  body {
    background-attachment: scroll;
    /* Ensure body expands with content */
    min-height: 100vh;
    position: relative;
    /* Make body expand to fit all content */
    height: auto;
    /* Better scrolling on iOS */
    -webkit-overflow-scrolling: touch;
  }

  /* Make sure main content pushes body height */
  main {
    position: relative;
    z-index: 1;
  }
  
  /* Ensure html also expands */
  html {
    height: auto;
    min-height: 100vh;
  }
}

/* === MOBILE OPTIMIZATION (up to 480px) === */
@media (max-width: 480px) {
  .contact-grid,
  .products-grid {
    gap: 10px;
    padding: 14px 10px;
  }

  .contact-card,
  .product-card {
    padding: 14px 10px;
  }

  .contact-card img,
  .product-card img {
    width: 68%;
    margin-bottom: 7px;
  }

  .contact-card h3,
  .product-card h3 {
    font-size: 0.9rem;
  }

  .contact-card p,
  .product-card p {
    font-size: 0.85rem;
  }
}

/* === LANDSCAPE ORIENTATION === */
@media (max-width: 768px) and (orientation: landscape) {
  body {
    padding-top: 55px;
  }

  .hero-text {
    font-size: clamp(1.5rem, 6vw, 3rem);
  }

  .contact-grid,
  .products-grid {
    gap: 10px;
    padding: 12px 10px;
  }

  .contact-card,
  .product-card {
    padding: 12px 8px;
  }

  .intro {
    margin: 12px auto;
  }
}

/* === VERY SMALL SCREENS === */
@media (max-width: 360px) {
  body {
    padding-top: 55px;
  }

  .top-bar {
    padding: 8px 10px;
    gap: 6px;
  }

  .logo {
    font-size: 1rem;
    gap: 4px;
  }

  .logo-icon {
    height: 20px;
    width: 20px;
  }

  .menu-toggle {
    min-width: 36px;
    min-height: 36px;
    padding: 5px 8px;
    font-size: 16px;
  }

  .lang-btn {
    min-width: 32px;
    min-height: 32px;
    font-size: 16px;
    padding: 2px 4px;
  }

  .contact-grid,
  .products-grid {
    gap: 10px;
    padding: 12px 10px;
  }

  .contact-card,
  .product-card {
    padding: 12px 8px;
  }

  .contact-card img,
  .product-card img {
    width: 65%;
    margin-bottom: 6px;
  }

  .contact-card h3,
  .product-card h3 {
    font-size: 0.85rem;
    margin: 2px 0 1px;
  }

  .contact-card p,
  .product-card p {
    font-size: 0.8rem;
  }

  .intro {
    margin: 12px auto;
    padding: 0 12px;
  }

  .intro h1 {
    font-size: 1.3rem;
    margin: 0 0 6px;
  }

  .intro p {
    font-size: 0.8rem;
  }

  .product-page {
    padding: 0 10px;
  }

  footer {
    padding: 12px 10px;
    font-size: 0.8rem;
  }
}
