html {
  scroll-behavior: smooth;
}

body {
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  font-family: "Inter", sans-serif;
}

#nav-bar {
  width: 100%;
  top: 0px;
  left: 0px;
  height: 90px;
  background-color: #fff;
  display: flex;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: fixed;
  font-weight: 600;
  z-index: 1;
}

#nav-bar ul {
  list-style: none;
}

#container {
  display: flex;
  width: 100%;
  padding: 0 20px;
  align-items: center;
  position: relative;
}

#container a,
#nav-links a {
  text-decoration: none;
}

.logo {
  position: absolute;
  color: #2c3e50;
}

.header-phone {
  position: absolute;
  right: 20px;
  font-weight: 600;
}

.header-phone a {
  color: #f39c12;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  transition: color 0.3s ease;
}

.header-phone a:hover {
  color: #e67e22;
}

.header-phone i {
  font-size: 18px;
}

#nav-links {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 90px;
  font-size: 18px;
}

#nav-links ul,
#products ul {
  list-style: none;
}

#nav-links a {
  color: #4a5568;
  position: relative;
  transition: color 0.3s ease;
}

#nav-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #f39c12;
  transition: width 0.3s ease;
}

#nav-links a:hover {
  color: #f39c12;
}

#nav-links a:hover::after {
  width: 100%;
}

#home {
  min-height: 100vh;
  width: 100%;
  display: flex;
  background-image: url("images/background.avif");
  background-repeat: no-repeat; /* stops tiling */
  background-position: center; /* centers the image */
  background-size: cover;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* vertical centering */
  padding-top: 90px; /* offset for navbar */
  padding-bottom: 40px;
  margin-top: 0;
  margin-bottom: 0;
  text-align: center;
  opacity: 0;
  animation: fadeInUp 0.5s ease-in forwards;
  scroll-margin-top: 90px;
}

#home-description {
  width: 50%;
}

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

.cta-button,
#products a,
.item-description input[type="button"] {
  text-decoration: none;
  background-color: #f39c12;
  color: #fff;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.cta-button {
  padding: 12px 24px;
}

.cta-button:hover,
#products a:hover,
.item-description input[type="button"]:hover {
  background-color: #e67e22;
}

#products {
  margin-top: 50px;
  width: 100%;
  justify-content: center;
  align-items: center;
  display: flex;
  flex-direction: column;
  scroll-margin-top: 110px;
  margin-bottom: 0px;
}

#products ul {
  display: flex;
  gap: 90px;
}

#products a {
  border-radius: 20px;
  padding: 12px 24px;
}

#smart-curtains {
  padding-top: 50px;
  width: 100%;
  align-items: center;
  display: flex;
  flex-direction: column;
  scroll-margin-top: 50px; /* Adjust this value to match your navbar height */
}

.description {
  width: 100%;
  max-width: 800px;
  text-align: center;
  margin: 0 auto;
}

.listings {
  padding-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, 400px);
  gap: 20px;
  text-align: center;
  align-items: stretch; /* Add this */
}

/* Hide hamburger by default, show on mobile */
#nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  position: absolute;
  right: 30px;
  top: 25px;
  z-index: 2;
}

#contact p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 12px;
}

#contact a {
  color: #f39c12;
  font-weight: 600;
  text-decoration: none;
  font-size: 1.15rem;
  transition: color 0.2s;
  border-bottom: 1px dashed #f39c12;
  padding-bottom: 2px;
}

@media (max-width: 1240px) {
  .listings {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  #nav-toggle {
    display: block;
  }
  .item-description h2 {
    font-size: 5px;
  }
  .header-phone {
    display: none; /* Hide header phone on mobile to save space */
  }
  #nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    top: 90px;
    right: 0;
    width: 100vw;
    background: #fff;
    gap: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    pointer-events: none;
  }
  #nav-links.open {
    max-height: 300px;
    opacity: 1;
    pointer-events: auto;
  }
  #nav-links ul {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 0;
  }
  #nav-links li {
    width: 100%;
    text-align: center;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
  }
  #nav-links a {
    display: block;
    width: 100%;
    text-align: center;
  }
  .listings {
    grid-template-columns: 1fr;
    padding: 0 12px; /* Add horizontal padding to the listings grid */
  }
  .item {
    padding: 16px 10px; /* Add padding inside each item */
    box-sizing: border-box;
  }
  #products ul {
    flex-direction: column;
    gap: 20px;
    align-items: center; /* Center the buttons horizontally */
    width: 100%;
    padding: 0;
    margin: 0;
  }
  #products ul li {
    width: 100%;
    display: flex;
    justify-content: center; /* Center the button inside the li */
    padding: 0;
    margin: 0;
  }
  #products a {
    display: block;
    width: 80%; /* Make the button not full width, but centered */
    max-width: 320px;
    text-align: center;
    font-size: 18px;
    padding: 16px 0;
    margin: 0 auto;
    box-sizing: border-box;
  }
  /* Sticky button mobile adjustments */
  #sticky-contact {
    bottom: 20px;
    right: 20px;
  }
  .sticky-btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  #contact p {
    font-size: 11px;
  }

  #contact a {
    font-size: 11px;
  }
}

#manual-curtains {
  padding-top: 50px;
  width: 100%;
  align-items: center;
  display: flex;
  flex-direction: column;
  scroll-margin-top: 50px; /* Adjust this value to match your navbar height */
}

.item {
  border: 1px solid #ddd;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 600px;
  height: 100%; /* Add this */
}

.item h2 {
  text-align: center;
  font-size: 15px;
  padding: 15px;
}

.item p {
  padding: 0 20px;
  font-size: 14px;
}

.item img {
  width: 100%;
  height: 450px; /* Set a fixed height */
  object-fit: cover; /* Ensures images fill the area and are cropped if needed */
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.item-description {
  background-color: #fff;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  margin-top: 50px;
  min-height: 120px; /* Ensures all descriptions are at least this tall */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
}

.image-container {
  width: 100%;
  height: 450px; /* Set a fixed height */
  max-height: 400px;
  overflow: hidden;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures images fill the area and are cropped if needed */
}

.buy-button {
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  margin-bottom: 10px;
}

.color-info {
  color: #f39c12;
  font-weight: 600;
  font-style: italic;
  font-size: 13px;
  margin: 8px 20px 12px 20px;
}

/* Sticky Contact Button */
#sticky-contact {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
}

.sticky-btn {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  padding: 15px 25px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(243, 156, 18, 0.4);
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

.sticky-btn:hover {
  background: linear-gradient(135deg, #e67e22, #d35400);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(243, 156, 18, 0.6);
  color: white;
  text-decoration: none;
}

.sticky-btn i {
  font-size: 18px;
}

@keyframes pulse {
  0% {
    box-shadow: 0 4px 20px rgba(243, 156, 18, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(243, 156, 18, 0.7);
  }
  100% {
    box-shadow: 0 4px 20px rgba(243, 156, 18, 0.4);
  }
}

.gallery-button {
  position: absolute;
  background-color: #f39c12;
  color: white;
  margin-top: 30px;
  width: 100px;
  height: 45px;
  padding: 10px 0px;
  border-radius: 30px;
  cursor: pointer;
}

.gallery-button:hover {
  transition: background-color 0.3s,
    transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1.07);
}

#contact {
  margin-top: 0px;
  margin-bottom: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(44, 62, 80, 0.1);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  padding: 48px 32px 40px 32px;
  text-align: center;
  scroll-margin-top: 35vh; /* Adjusts scroll position for anchor links */
}

#contact h2 {
  font-size: 2.1rem;
  color: #2c3e50;
  margin-bottom: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

#contact a:hover {
  color: #e67e22;
  border-bottom: 1px solid #e67e22;
  text-decoration: none;
}

#contact .contact-message {
  background: none;
  box-shadow: none;
  color: #2c3e50;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 32px;
  padding: 0 0 10px 0;
  text-align: center;
}

#contact .contact-info {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(44, 62, 80, 0.1);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  padding: 32px 32px 28px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-divider {
  border: none;
  border-top: 3px dotted #f39c12;
  margin: 60px auto;
  width: 80%;
  opacity: 0.7;
}
