/* =========================
   Home Page – Full CSS
   ========================= */

/* --- Guard kecil agar tidak ada overflow horizontal --- */
html, body {
  width: 100%;
  overflow-x: hidden;
}

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

/* =========================
   HERO SECTION (Full-bleed)
   ========================= */

/* Section hero dibuat full-bleed sampai tepi viewport */
.hero {
  position: relative;
  width: 100vw;                           /* penuh selebar viewport */
  max-width: 100vw;
  margin-left: calc(50% - 50vw);          /* tarik ke kiri */
  margin-right: calc(50% - 50vw);         /* tarik ke kanan */
  overflow: hidden;                       /* potong elemen yang keluar */
}

/* Container utama Swiper (tanpa absolute & tanpa fixed height) */
.hero-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;                   /* jaga rasio 1920x720 */
  min-height: 50vh;
  max-height: 80vh;
  margin: 0;
  overflow: hidden;                       /* cegah ‘bleeding’ sub-pixel */
}

.hero-slider .swiper-wrapper { will-change: transform; }

.hero-slider .swiper-slide {
  position: relative;
  overflow: hidden;
  backface-visibility: hidden;            /* hilangkan garis sub-pixel */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hero-slider .swiper-slide .hero-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;                      /* isi penuh, crop rapi */
  z-index: 0;
}

/* Caption (opsional) */
.hero-slider .hero-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 1.2rem;
  text-align: center;
  max-width: 80%;
  z-index: 2;
}

/* Navigasi panah */
.hero-slider .swiper-button-next,
.hero-slider .swiper-button-prev {
  color: #fff;
  --swiper-navigation-size: 30px;
  z-index: 3;
}
.hero-slider .swiper-button-next { right: 16px; }
.hero-slider .swiper-button-prev { left: 16px; }

/* Pagination (bullets) */
.hero-pagination.swiper-pagination-bullets {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  z-index: 3;
}
.hero-pagination .swiper-pagination-bullet {
  background: #fff;
  opacity: .6;
}
.hero-pagination .swiper-pagination-bullet-active { opacity: 1; }

/* =========================
   THUMBNAIL SWIPER
   ========================= */
.hero-thumbs-slider {
  height: 80px;
  padding: 10px 0;
  width: 100%;
  max-width: 100vw;
  margin: 0 auto;
  overflow: hidden;                       /* jangan ‘mencuat’ */
}
.hero-thumbs-slider .swiper-wrapper { transform: translate3d(0,0,0); }
.hero-thumbs-slider .swiper-slide {
  width: 25%;
  height: 100%;
  opacity: .4;
}
.hero-thumbs-slider .swiper-slide-thumb-active { opacity: 1; }
.hero-thumbs-slider .swiper-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================
   CONTENT SECTIONS (umum)
   ========================= */
.content-section {
  padding: 100px 20px;
  text-align: center;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}
.content-section.visible {
  opacity: 1;
  transform: translateY(0);
}
.content-section h2 {
  font-size: 3rem;
  font-weight: 600;
  margin-bottom: 80px;
}

/* =========================
   FEATURED PRODUCTS
   ========================= */
.featured-products { background: var(--background-grey); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}

.product-card {
  background: var(--background-light);
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 0 4px 4px rgba(0,0,0,.25);
  transition: transform .3s ease, box-shadow .3s ease;
}
.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 15px rgba(0,0,0,.1);
}
.product-image-wrapper {
  width: 100%;
  height: 200px; /* Fixed height for uniformity of the card image area */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* Hide overflowing parts of the image */
  border-radius: 25px 25px 0 0; /* Apply border-radius to top corners */
  background-color: #f8f8f8; /* Light background for consistency */
}

.product-card .product-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Ensures the image fits within its content box while maintaining its aspect ratio */
  border-radius: 0; /* Remove border-radius from the image itself */
  transition: transform 0.3s ease;
}
.product-card-content { padding: 20px; }
.product-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.product-card p {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.product-card .brand-logo {
  height: 100px; /* Increased height */
  max-width: 150px; /* Added max-width */
  width: auto;
  object-fit: contain;
  margin-top: 10px; /* Add some margin for spacing */
  margin-bottom: 10px; /* Add some margin for spacing */
}

.product-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center; /* Center horizontally */
  flex-grow: 1; /* Allow content to grow and take available space */
  text-align: center; /* Ensure text is centered */
}

.explore-button {
  background: var(--primary-color);
  color: var(--text-light);
  font-size: 1.5rem;
  margin-top: 80px;
}

/* =========================
   CTA SECTION
   ========================= */
.cta-section {
  background: url(../images/homes/backgrounds/cta-background.png) center/cover no-repeat;
}
.cta-content {
  background: rgba(255,255,255,.9);
  border-radius: 25px;
  padding: 60px;
  max-width: 1427px;
  margin: 0 auto;
  border: 1px solid var(--text-dark);
  box-shadow: 0 4px 4px rgba(0,0,0,.25);
}
.cta-content h2 {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 30px;
}
.cta-content p {
  font-size: 1.25rem;
  font-weight: 300;
  margin-bottom: 40px;
}
.contact-button {
  background: var(--secondary-color);
  color: var(--text-light);
  font-size: 1.5rem;
}

/* =========================
   ABOUT US SECTION
   ========================= */
.about-us-section {
  background: url(../images/homes/backgrounds/about-background.png) center/cover no-repeat;
}
.about-us-section {
  position: relative; /* Needed for absolute positioning of pseudo-element */
  background: url(../images/homes/backgrounds/about-background.png) center/cover no-repeat;
  overflow: hidden; /* Ensure pseudo-element doesn't overflow */
}

.about-us-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5); /* Dark, semi-transparent background */
  z-index: 1; /* Place it above the background image but below content */
}

.about-us-content {
  position: relative; /* Position above the pseudo-element */
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px; /* Add some padding for visual separation */
  border-radius: 25px; /* Optional: adds rounded corners */
}
.about-us-content p {
  font-size: 1.25rem;
  margin-bottom: 40px;
  color: var(--text-light);
  text-shadow: 1px 1px 2px rgba(0,0,0,.5);
}
.about-us-button {
  background: var(--primary-color);
  color: var(--text-light);
  font-size: 1.5rem;
  font-weight: 700;
}

/* =========================
   CERTIFICATIONS
   ========================= */
.certification-section { background: var(--background-light); }
.certification-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}
.certification-grid img {
  max-width: 150px;
  height: auto;
  object-fit: contain;
  transition: transform .3s ease;
}
.certification-grid img:hover { transform: scale(1.1); }

/* =========================
   BRANDS
   ========================= */
.brands-section { background: var(--background-grey); }
.brands-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}
.brands-grid img {
  max-width: 150px;
  height: auto;
  object-fit: contain;
  transition: transform .3s ease;
}
.brands-grid img:hover { transform: scale(1.1); }

/* =========================
   MARKETPLACE
   ========================= */
.marketplace-section { background: var(--background-light); }
.marketplace-section h2 { margin-bottom: 20px; }
.marketplace-description {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 60px;
}
.marketplace-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
}
.marketplace-grid img {
  max-width: 150px;
  height: auto;
  object-fit: contain;
  transition: transform .3s ease;
}
.marketplace-grid img:hover { transform: scale(1.1); }

/* =========================
   Animations (utility)
   ========================= */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1200px) {
  .hero-text h1 { font-size: 2rem; }
  .hero-text h2 { font-size: 3rem; }
  .hero-image img { width: 350px; }
  .cta-content h2 { font-size: 2rem; }
  .cta-content p  { font-size: 1rem; }
}

@media (max-width: 992px) {
  .hero-content { flex-direction: column-reverse; padding: 0 20px; }
  .hero-image { margin-bottom: 40px; }
  .hero-image img { width: 300px; }
  .product-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .cta-content { padding: 40px; }
  .about-us-content p { font-size: 1rem; }
  .hero-slider { min-height: clamp(200px, 25vw, 400px); }
}

@media (max-width: 768px) {
  .hero-text h1 { font-size: 1.8rem; }
  .hero-text h2 { font-size: 2.5rem; }
  .content-section h2 { font-size: 2.5rem; }
  .cta-content h2 { font-size: 1.8rem; }
  .cta-content p  { font-size: 1rem; }
  .product-grid { grid-template-columns: 1fr; gap: 30px; }
  .brands-grid, .marketplace-grid, .certification-grid { gap: 30px; }
  .brands-grid img, .marketplace-grid img, .certification-grid img { max-width: 120px; }
  .hero-thumbs-slider { height: 64px; }
  .hero-slider { min-height: clamp(150px, 25vw, 300px); }
}

@media (max-width: 480px) {
  .hero-text h1 { font-size: 1.5rem; }
  .hero-text h2 { font-size: 2rem; }
  .hero-image img { width: 250px; }
  .content-section h2 { font-size: 2rem; }
  .button { font-size: 1.2rem; padding: 12px 30px; }
}

@media (max-width: 768px) {
  .hero-slider .hero-caption {
    max-width: 90%;
    padding: 8px 15px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-slider .hero-caption {
    max-width: 95%;
    padding: 5px 10px;
    font-size: 0.8rem;
  }
}
