/* ============================================
   Thai Best Deal — Image Slider Styles
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  font-family: 'Calibri', 'Segoe UI', sans-serif;
  font-size: 1.2rem;
  background: #ffffff;
}

.slider {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 380px;
  overflow: hidden;
  background: #111;
}

/* ---------- Slides Track ---------- */
.slides-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  transform: scale(1);
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Dark gradient overlay so white text is always readable */
.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.05) 35%,
    rgba(0, 0, 0, 0.15) 60%,
    rgba(0, 0, 0, 0.55) 100%
  );
  z-index: 2;
}

/* ---------- Active Slide State ---------- */
.slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 3;
}

/* ============================================
   RANDOM TRANSITION EFFECTS
   JS toggles one of these classes on the
   incoming / outgoing slide.
   ============================================ */

/* Fade */
.slide.fade-in {
  animation: fadeIn 1s ease forwards;
}
.slide.fade-out {
  animation: fadeOut 1s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Slide from right */
.slide.slide-in-right {
  animation: slideInRight 0.9s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 1; }
  to   { transform: translateX(0); opacity: 1; }
}

/* Slide from left */
.slide.slide-in-left {
  animation: slideInLeft 0.9s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 1; }
  to   { transform: translateX(0); opacity: 1; }
}

/* Zoom in */
.slide.zoom-in {
  animation: zoomIn 1s ease forwards;
}
@keyframes zoomIn {
  from { opacity: 0; transform: scale(1.25); }
  to   { opacity: 1; transform: scale(1); }
}

/* Zoom out (Ken Burns style entrance) */
.slide.zoom-out {
  animation: zoomOut 1s ease forwards;
}
@keyframes zoomOut {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* Vertical drop */
.slide.drop-in {
  animation: dropIn 0.9s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-15%); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Rise up */
.slide.rise-in {
  animation: riseIn 0.9s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(15%); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Captions ---------- */
.caption {
  position: absolute;
  z-index: 4;
  max-width: 90%;
  width: min(560px, 88%);
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.caption .tagline {
  font-family: 'Calibri', 'Segoe UI', sans-serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(13px, 1.6vw, 18px);
  letter-spacing: 0.5px;
  color: #ffffff;
  text-transform:capitalize;
}

.caption .headline {
  font-family: 'Impact', 'Anton', 'Arial Narrow Bold', sans-serif;
  font-weight: 200;
  font-size: clamp(28px, 1.5vw, 68px);
  line-height: 0.95;
  letter-spacing: 1px;
  color: #ffffff;
  text-transform: uppercase;
}

/* Random placements around the banner */

/* Bottom-left */
.caption-1 {
  left: 5%;
  bottom: 12%;
  text-align: center;
  align-items: flex-start;
}

/* Top-right */
.caption-2 {
  right: 5%;
  top: 12%;
  text-align: right;
  align-items: flex-end;
}

/* Center */
.caption-3 {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  align-items: center;
}

/* Top-left */
.caption-4 {
  left: 5%;
  top: 40%;
  text-align: center;
  align-items: flex-start;
}

/* Bottom-right */
.caption-5 {
  right: 1%;
  bottom: 25%;
  text-align: center;
  align-items:center;
}

/* Fade the caption in a beat after the slide */
.slide .caption {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease 0.35s, transform 0.7s ease 0.35s;
}
.caption-3 {
  transform: translate(-50%, calc(-50% + 20px));
}
.slide.active .caption {
  opacity: 1;
  transform: translateY(0);
}
.slide.active.caption-3-active .caption-3,
.slide.active .caption-3 {
  transform: translate(-50%, -50%);
}

/* ---------- Arrow Navigation ---------- */
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.7);
  color: #ffffff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.arrow:hover {
  background: rgba(211, 47, 47, 0.85);
  border-color: #ffffff;
}

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

.arrow-prev {
  left: 20px;
}

.arrow-next {
  right: 20px;
}

/* ---------- Bullet Navigation ---------- */
.bullets {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90%;
}

.bullet {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d32f2f; /* red default */
  border: 2px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
  padding: 0;
}

.bullet:hover {
  background: #ffffff;
  transform: scale(1.15);
}

.bullet.active {
  background: #ffffff;
  border-color: #ffffff;
  transform: scale(1.2);
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

@media (max-width: 768px) {
  .slider {
    height: 70vh;
    min-height: 320px;
  }

  .arrow {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .arrow-prev { left: 10px; }
  .arrow-next { right: 10px; }

  .caption {
    width: 90%;
  }

  .caption .headline {
    font-size: clamp(24px, 3vw, 40px);
  }

  .caption .tagline {
    font-size: clamp(12px, 3vw, 15px);
  }
  .caption-4 {
    left: 50%;
    right: auto;
    top: 13%;                    /* adjust to taste for "top center" */
    transform: translateX(-50%);
    text-align: center;
    align-items: center;        /* was flex-start — center it too on mobile */
  }

  .caption-5 {
    left: 50%;
    right: auto;
    bottom: 5%;                 /* adjust to taste for "bottom center" */
    transform: translateX(-50%);
    text-align: center;
    align-items: center;
  }
  .bullets {
    bottom: 6px;
    gap: 3px;
  }

  .bullet {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 480px) {
  .slider {
    height: 60vh;
    min-height: 280px;
  }

  .caption-1, .caption-2, .caption-4, .caption-5 {
    left: 5%;
    right: 5%;
    text-align: center;
    align-items: center;
    width: 90%;
  } 
}