/* ==========================================================================
   UNIDADES SECTION — B.E.M. ARCHITECTURE
   Inspired by Aman & Bourbon Editorial Carousel Showcase
   ========================================================================== */

.unidades-section {
  position: relative;
  z-index: 10;
  width: 100%;
  background-color: var(--color-primary, #f3eee7);
  padding: 7.5rem 0 8.5rem;
  overflow: hidden;
  scroll-margin-top: 5.5rem;
}

.unidades-section__container {
  width: 100%;
  max-width: 1540px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 3rem;
  padding-right: 3rem;
}

/* --------------------------------------------------------------------------
   Section Header & Nav Bar
   -------------------------------------------------------------------------- */
.unidades-section__header {
  margin-bottom: 3rem;
}

.unidades-section__title {
  font-family: var(--font-display);
  font-size: 3.25rem;
  font-weight: 300;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-charcoal);
  margin-bottom: 1.5rem;
}

.unidades-section__nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(49, 49, 49, 0.08);
  padding-top: 1.5rem;
}

/* Left Subtitle with Brown Dash Detail */
.unidades-section__subtitle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.unidades-section__dash {
  display: block;
  width: 36px;
  height: 2px;
  background-color: var(--color-brown, #6a4b35);
  border-radius: 1px;
}

.unidades-section__subtitle {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-charcoal);
  opacity: 0.85;
}

/* Right Navigation Arrows (Brown) */
.unidades-section__controls {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
}

.unidades-section__arrow {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brown, #6a4b35);
  transition: transform var(--transition-fast), opacity var(--transition-fast), color var(--transition-fast);
}

.unidades-section__arrow:hover:not(:disabled) {
  transform: scale(1.15);
  color: var(--color-copper, #bf721e);
}

.unidades-section__arrow:active:not(:disabled) {
  transform: scale(0.95);
}

.unidades-section__arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.unidades-section__arrow-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* --------------------------------------------------------------------------
   Cards Track & Carousel Viewport
   -------------------------------------------------------------------------- */
.unidades-section__track-wrapper {
  position: relative;
  width: 100%;
}

.unidades-section__track {
  display: flex;
  gap: 1.75rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1.5rem;
  scrollbar-width: none;
  /* Hide scrollbar for clean luxury look */
}

.unidades-section__track::-webkit-scrollbar {
  display: none;
}

/* --------------------------------------------------------------------------
   Individual Unit Card
   -------------------------------------------------------------------------- */
.unidades-card {
  flex: 0 0 calc(25% - 1.35rem);
  min-width: 310px;
  max-width: 380px;
  height: 520px;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  background-color: #1a1a1a;
}

.unidades-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.16);
}

/* Card Media / Background Picture */
.unidades-card__picture {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.unidades-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 1.2s var(--ease-luxury);
}

.unidades-card:hover .unidades-card__img {
  transform: scale(1.06);
}

/* Luxury Bottom Gradient Overlay */
.unidades-card__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg,
      rgba(0, 0, 0, 0) 45%,
      rgba(0, 0, 0, 0.45) 70%,
      rgba(0, 0, 0, 0.88) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Card Content (At Bottom) */
.unidades-card__content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem 1.75rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.unidades-card__title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1.25;
  color: #ffffff;
  letter-spacing: 0.03em;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* Buttons Container inside Card */
.unidades-card__buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

/* Card Action Buttons (Fazer Reserva, Conhecer, Fazer Delivery) */
.unidades-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none;
  border-radius: 0;
  cursor: pointer;
  box-sizing: border-box;
  text-align: center;
  transition: all var(--transition-fast);
}

/* Primary Button: #BF721E copper matching the logo */
.unidades-btn--primary {
  background-color: #BF721E;
  color: #ffffff;
  border: 1px solid #BF721E;
  box-shadow: 0 4px 14px rgba(191, 114, 30, 0.35);
}

.unidades-btn--primary:hover {
  background-color: #a85f14;
  border-color: #a85f14;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(191, 114, 30, 0.5);
}

/* Secondary Button: Frosted Outline with #BF721E hover */
.unidades-btn--secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.unidades-btn--secondary:hover {
  background-color: #BF721E;
  color: #ffffff;
  border-color: #BF721E;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(191, 114, 30, 0.45);
}

/* Full Width Single Button Modifier */
.unidades-btn--full {
  flex: 0 0 100%;
  width: 100%;
  padding: 0.82rem 1.25rem;
}

/* Stacked Two-Tier Button Container Modifier */
.unidades-card__buttons--stacked {
  flex-direction: column;
  gap: 0.6rem;
}

.unidades-card__buttons-row {
  display: flex;
  gap: 0.6rem;
  width: 100%;
}

.unidades-card__buttons-row .unidades-btn {
  flex: 1;
  padding: 0.65rem 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.unidades-card__buttons--stacked .unidades-btn--full {
  padding: 0.75rem 1rem;
}

/* --------------------------------------------------------------------------
   Timeline Progress Indicator (#BF721E)
   Expands or contracts as the user advances through the units carousel
   -------------------------------------------------------------------------- */
.unidades-section__timeline {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 2.75rem;
}

.unidades-section__timeline-track {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 2px;
  background-color: rgba(49, 49, 49, 0.12);
  border-radius: 0;
  cursor: pointer;
  overflow: hidden;
  transition: height 250ms var(--ease-luxury), background-color 250ms var(--ease-luxury);
}

.unidades-section__timeline-track:hover {
  height: 3px;
  background-color: rgba(49, 49, 49, 0.2);
}

.unidades-section__timeline-line {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 20%;
  background-color: #BF721E;
  box-shadow: 0 0 10px rgba(191, 114, 30, 0.4);
  transition: width 350ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: width;
}

/* ==========================================================================
   RESPONSIVE ADAPTATIONS (TABLET & MOBILE)
   ========================================================================== */

/* Tablet (Portrait & Landscape: 768px - 1024px) */
@media (max-width: 1024px) {
  .unidades-section {
    padding: 6rem 0 7rem;
  }

  .unidades-section__container {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .unidades-section__title {
    font-size: 2.6rem;
    margin-bottom: 1.25rem;
  }

  .unidades-card {
    flex: 0 0 calc(45% - 1rem);
    min-width: 290px;
    height: 480px;
  }

  .unidades-card__title {
    font-size: 1.4rem;
  }

  .unidades-section__subtitle {
    font-size: 0.82rem;
  }

  .unidades-section__timeline {
    margin-top: 2.25rem;
  }

  .unidades-section__timeline-track {
    max-width: 440px;
  }
}

/* Mobile Devices (<= 767px) */
@media (max-width: 767px) {
  .unidades-section {
    padding: 4.5rem 0 5.5rem;
  }

  .unidades-section__container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .unidades-section__header {
    margin-bottom: 2rem;
  }

  .unidades-section__title {
    font-size: 2rem;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
  }

  .unidades-section__nav-bar {
    padding-top: 1.2rem;
  }

  .unidades-section__subtitle-wrap {
    gap: 0.75rem;
  }

  .unidades-section__dash {
    width: 24px;
  }

  .unidades-section__subtitle {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
  }

  .unidades-section__controls {
    gap: 0.75rem;
  }

  .unidades-section__arrow-icon {
    width: 20px;
    height: 20px;
  }

  .unidades-section__track {
    gap: 1.15rem;
    padding-bottom: 1.2rem;
  }

  .unidades-card {
    flex: 0 0 82%;
    min-width: 260px;
    max-width: 320px;
    height: 440px;
  }

  .unidades-card__content {
    padding: 1.5rem 1.25rem;
    gap: 1rem;
  }

  .unidades-card__title {
    font-size: 1.6rem;
    font-weight: 900;
  }

  .unidades-btn {
    padding: 0.7rem 0.75rem;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }

  .unidades-section__timeline {
    margin-top: 1.75rem;
  }

  .unidades-section__timeline-track {
    max-width: 280px;
  }
}