/* =============================================
   HEARTHWOOD CABINETRY — Hero Carousel
   ============================================= */

.hero-section {
  margin-top: var(--nav-h);
  position: relative;
}

.hero-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--navy);
  /* Minimum height so it never collapses */
  min-height: 480px;
}

/* ---- Track & Slides ---- */
.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
  position: relative; /* keep track height */
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 480px;
  max-height: 700px;
}

/* Overlay for text readability */
.carousel-caption-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(28,43,74,0.15) 0%,
    rgba(28,43,74,0.05) 40%,
    rgba(28,43,74,0.55) 100%
  );
  pointer-events: none;
}

/* Placeholder (no images loaded) */
.carousel-no-image {
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #2e4270 100%);
}

.carousel-placeholder-content {
  text-align: center;
  color: rgba(255,255,255,0.5);
  padding: 2rem;
}

.carousel-placeholder-content i {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
  color: var(--gold);
  opacity: 0.5;
}

.carousel-placeholder-content p {
  font-size: 0.875rem;
  max-width: 340px;
}

.carousel-placeholder-content code {
  background: rgba(255,255,255,0.1);
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 0.8em;
}

/* ---- Hero Text Content (over carousel) ---- */
.carousel-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 3rem 0 3.5rem;
  background: linear-gradient(to top, rgba(20,35,65,0.85) 0%, transparent 100%);
}

.carousel-hero-content .container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.carousel-hero-tagline {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.carousel-hero-content h1 {
  color: #fff;
  max-width: 620px;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.carousel-hero-content p {
  color: rgba(255,255,255,0.82);
  font-size: 1.1rem;
  font-weight: 300;
  max-width: 500px;
  margin-bottom: 2rem;
}

.carousel-hero-ctas {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---- Navigation Arrows ---- */
.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  -webkit-appearance: none;
}

.carousel-prev:hover,
.carousel-next:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}

.carousel-prev { left: 1.25rem; }
.carousel-next { right: 1.25rem; }

/* ---- Dots ---- */
.carousel-dots {
  position: absolute;
  bottom: 1.25rem;
  right: 1.5rem;
  z-index: 20;
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.carousel-dot.active {
  background: var(--gold);
  width: 20px;
  border-radius: 4px;
}

.carousel-dot:hover { background: rgba(255,255,255,0.7); }

/* ---- Counter ---- */
.carousel-counter {
  position: absolute;
  bottom: 1.35rem;
  left: 1.5rem;
  z-index: 20;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.55);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero-carousel { min-height: 360px; }
  .carousel-slide img { min-height: 360px; }
  .carousel-hero-content h1 { font-size: clamp(1.5rem, 5vw, 2.2rem); }
  .carousel-hero-content p { font-size: 0.95rem; }
  .carousel-prev, .carousel-next { width: 36px; height: 36px; font-size: 0.85rem; }
  .carousel-hero-content { padding: 2rem 0 2.5rem; }
}

@media (max-width: 480px) {
  .hero-carousel { min-height: 300px; }
  .carousel-slide img { min-height: 300px; }
  .carousel-hero-ctas .btn { padding: 0.6rem 1.2rem; font-size: 0.75rem; }
  .carousel-prev { left: 0.75rem; }
  .carousel-next { right: 0.75rem; }
}
