/**
 * La Villa Hermosa — Shared Components
 * Buttons, Badges, Cards (Home / Amenity / Info / Listing)
 */

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 15px 28px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 500;
  line-height: 1.2;
  border: 1.5px solid transparent;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
  white-space: nowrap;
}
.btn--primary {
  background: var(--brand-primary);
  color: var(--text-on-brand);
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}
.btn--primary:hover {
  background: var(--brand-primary-hover);
}

.btn--secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}
.btn--secondary:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn--on-dark {
  background: var(--text-on-dark);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}
.btn--on-dark:hover {
  border-color: var(--text-on-dark-muted);
  background: var(--text-on-dark-muted);
}

.btn--sm {
  padding: 12px 20px;
  font-size: var(--text-label-sm);
}
.btn--block {
  width: 100%;
}

/* ================= Badge ================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-badge);
  line-height: var(--lh-badge);
  letter-spacing: var(--ls-badge);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-on-brand);
  background: var(--brand-primary);
}
.badge--available {
  background: var(--status-available);
}
.badge--pre-order {
  background: var(--status-gold);
}
.badge--new {
  background: var(--brand-secondary);
}

/* ================= Home Card (used on Inventory grid) ================= */
.home-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}
.home-card__image {
  position: relative;
  aspect-ratio: 380 / 230;
  background: var(--bg-sand) center/cover no-repeat;
}
.home-card__image .badge {
  position: absolute;
  left: 16px;
  top: 16px;
}
.home-card__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}
.home-card__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.home-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-h4);
  line-height: var(--lh-h4);
  color: var(--text-primary);
}
.home-card__lot {
  font-size: var(--text-caption);
  color: var(--text-muted);
  white-space: nowrap;
}
.home-card__desc {
  font-size: var(--text-body-xs);
  line-height: var(--lh-body-xs);
  color: var(--text-secondary);
}
.home-card__specs {
  display: flex;
  align-items: center;
}
.home-card__spec {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-card__spec-value {
  font-weight: 700;
  font-size: var(--text-h5);
  color: var(--text-primary);
}
.home-card__spec-label {
  font-size: var(--text-caption-sm);
  color: var(--text-muted);
}
.home-card__spec-divider {
  width: 1px;
  height: 28px;
  background: var(--border-default);
  margin-inline: var(--space-4);
}
.home-card__link {
  font-weight: 500;
  font-size: var(--text-body-xs);
  color: var(--text-brand);
}

/* ================= Amenity Card ================= */
.amenity-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 440px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--brand-secondary-dark) center/cover no-repeat;
}
.amenity-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(31, 29, 25, 0) 40%,
    rgba(31, 29, 25, 0.55) 100%
  );
}
.amenity-card__caption {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-7);
}
.amenity-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-h3);
  line-height: var(--lh-h3);
  color: var(--text-on-dark);
}
.amenity-card__desc {
  font-size: var(--text-body-sm);
  line-height: var(--lh-body-sm);
  color: var(--text-on-dark);
  max-width: 320px;
}

/* ================= Info Card ================= */
.info-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 36px 32px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}
.info-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.info-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-h4);
  line-height: var(--lh-h4);
}
.info-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 45px;
  border-radius: var(--radius-full);
  background: var(--brand-tint);
  border: 1.5px solid var(--brand-primary);
  overflow: visible;
  flex-shrink: 0;
  box-sizing: border-box;
}
.info-card__icon img {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
}
.info-card__desc {
  font-size: var(--text-body-sm);
  line-height: var(--lh-body-sm);
  color: var(--text-secondary);
}
.info-card__link {
  font-weight: 500;
  font-size: var(--text-body-xs);
  color: var(--text-brand);
}

/* ================= Listing Card (Home Detail / Inventory highlight) ================= */
.listing-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}
.listing-card__image {
  position: relative;
  aspect-ratio: 411 / 250;
  background: var(--bg-sand) center/cover no-repeat;
}
.listing-card__image .badge {
  position: absolute;
  left: 16px;
  top: 16px;
}
.listing-card__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 22px 24px 24px;
}
.listing-card__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.listing-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-h4);
}
.listing-card__lot {
  font-size: var(--text-caption);
  color: var(--text-muted);
}
.listing-card__builder {
  font-weight: 500;
  font-size: var(--text-body-xs);
  color: var(--text-brand);
}
.listing-card__desc {
  font-size: var(--text-body-sm);
  line-height: var(--lh-body-sm);
  color: var(--text-secondary);
}
.listing-card__specs {
  display: flex;
  align-items: center;
}
.listing-card__price {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-h3);
}
.listing-card__btns {
  display: flex;
  gap: var(--space-3);
}
.listing-card__btns .btn {
  flex: 1;
}

/* ================= Cards grid ================= */
.card-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}
