/* =========================
   RESET
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  /* Lighter gradient transition */
  background: radial-gradient(circle at top, #5a8bec 0%, #29479c 45%, #1a2754 100%);
  color: #e9e9f5;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 10%, rgba(0, 161, 226, 0.18), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* =========================
   LAYOUT
========================= */

.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
}

/* =========================
   HEADER
========================= */

.header-top {
  position: sticky;
  top: 0;
  z-index: 1000;

  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 0;

  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.header-top.scrolled {
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.header-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 14px;
}

.header-grid .item {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.95;
}

.header-grid img {
  width: 16px;
  height: 16px;
}

.header-grid a {
  color: #fff;
  text-decoration: none;
  transition: 0.2s ease;
}

.header-grid a:hover {
  color: #00a1e2;
}

/* =========================
   LOGO
========================= */

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 35px 0 15px;
}

.logo-container img {
  max-width: 260px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.5));
}

/* =========================
   HERO
========================= */

.hero {
  display: flex;
  justify-content: center;
  text-align: center;
  padding: 55px 0 40px;
}

.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero img {
  max-width: 360px;
  width: 100%;
  height: auto;
}

.hero p {
  max-width: 820px;
  font-size: 17px;
  opacity: 0.92;
  line-height: 1.7;
}

/* =========================
   NAVIGATION (MOBILE SWIPE)
========================= */
.product-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 5px 20px 20px;
  /* Added bottom padding to accommodate the new scrollbar */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;

  /* The Magic: Elegant scrollbar for Firefox */
  scrollbar-width: thin;
  scrollbar-color: #00a1e2 rgba(255, 255, 255, 0.05);
}

/* The Magic: Elegant scrollbar for Chrome/Safari/Edge */
.product-list::-webkit-scrollbar {
  height: 6px;
}

.product-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.product-list::-webkit-scrollbar-thumb {
  background: #00a1e2;
  border-radius: 10px;
}

.product-list a {
  flex: 0 0 auto;
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.product-list a:hover {
  background: #00a1e2;
  border-color: #00a1e2;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 161, 226, 0.25);
}

/* =========================
   PRODUCT GALLERY (GRID & UNIFORM CARDS)
========================= */
main.product-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 20px 0 60px;
}

.product-section {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Pushes text down uniformly */
  height: 100%;
  padding: 25px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  /* Semi-transparent dark background for contrast */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* The new universal image container */
.img-wrap {
  width: 100%;
  height: 240px;
  background: #ffffff;
  /* Solid white background so all images match */
  border-radius: 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  /* Adds breathing room around the product */
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
  /* Subtle inner depth */
}

/* Forces the image to behave perfectly inside the wrapper */
.product-section img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0;
  /* Removes old margin */
  border-radius: 0;
  /* Border radius is now handled by img-wrap */
}

.product-section h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #fff;
}

.product-section p {
  font-size: 14px;
  opacity: 0.85;
}

/* =========================
   FOOTER
========================= */

.footer {
  margin-top: 60px;
  padding: 28px 0;
  text-align: center;
  background: rgba(0, 0, 0, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.footer a {
  color: #00a1e2;
  text-decoration: none;
}

/* =========================
   WHATSAPP BUTTON
========================= */

.whatsapp-float {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 9999;
  transition: all 0.25s ease;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.whatsapp-float:active {
  transform: scale(0.95);
}

.whatsapp-float svg {
  width: 30px;
  height: 30px;
  fill: white;
}

/* =========================
   MICRO POLISH
========================= */

a,
img {
  transition: all 0.2s ease;
}

img {
  display: block;
}

/* =========================
   MAP SECTION
========================= */
.map-wrap {
  position: relative;
  width: 92%;
  max-width: 1200px;
  margin: 0 auto 40px;
  margin-top: 25px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  background: rgba(255, 255, 255, 0.05);
  /* Blends with your new lighter theme */
}

.footer-map {
  width: 100%;
  height: 350px;
  border: none;
  display: block;
}

/* Intercepts touches so the user can scroll past it on mobile without zooming */
.map-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 10;
  cursor: pointer;
}

.map-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  background: #00a1e2;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 20;
  display: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* =========================
   MAP EXPANDED STATE (MODAL)
========================= */
.map-wrap.expanded {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95vw;
  height: 85vh;
  max-width: none;
  z-index: 10000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.map-wrap.expanded .footer-map {
  height: 100% !important;
}

.map-wrap.expanded .map-overlay {
  display: none;
}

.map-wrap.expanded .map-close {
  display: block;
}

@media (max-width: 768px) {

  /* Resets map for mobile viewing natively */
  .map-wrap {
    width: 90%;
    position: relative !important;
    top: auto !important;
    transform: none !important;
    z-index: 1;
  }

  .map-wrap.expanded {
    position: relative;
    /* Disables modal pop-out on mobile to keep it native */
    width: 90%;
    height: 300px;
  }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {

  /* Header adjustments for mobile */
  .header-grid {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero {
    padding: 40px 0 30px;
  }

  /* Scale down the WhatsApp button for mobile */
  .whatsapp-float {
    width: 52px;
    height: 52px;
    bottom: 18px;
    right: 18px;
  }

  .whatsapp-float svg {
    width: 24px;
    height: 24px;
  }

  /* =========================
     MOBILE MAP LOGIC
  ========================= */

  /* Base state: normal inline map using :not() to prevent !important clashes */
  .map-wrap:not(.expanded) {
    width: 90%;
    position: relative !important;
    top: auto !important;
    transform: none !important;
    z-index: 1;
  }

  .map-wrap:not(.expanded) .footer-map {
    height: 300px;
  }

  /* Expanded state: True fullscreen modal for mobile devices */
  .map-wrap.expanded {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    border-radius: 0;
    /* Removes rounded corners for flush screen edges */
    z-index: 10000 !important;
  }

  .map-wrap.expanded .map-close {
    top: 25px;
    right: 25px;
    width: 44px;
    /* Larger tap target for thumbs */
    height: 44px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {

  /* Keeps the swipeable navigation pills compact on very small screens */
  .product-list a {
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* =========================
   SCROLL ANIMATIONS
========================= */

.product-section,
.hero,
.products {
  opacity: 0;
  transform: translateY(25px);
  animation: fadeUp 0.8s ease forwards;
}

.hero {
  animation-delay: 0.1s;
}

.products {
  animation-delay: 0.2s;
}

.product-section:nth-of-type(odd) {
  animation-delay: 0.25s;
}

.product-section:nth-of-type(even) {
  animation-delay: 0.35s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}