/* These styles are generated from project.scss. */

.alert-debug {
  color: black;
  background-color: white;
  border-color: #d6e9c6;
}

.alert-error {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #eed3d7;
}

/* ==========================================================================
   VehiclesLanka marketplace — mobile-first styles
   ========================================================================== */

:root {
  --vl-radius: 0.75rem;
}

html,
body {
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f6f8fb;
}

.app-main {
  flex: 1 0 auto;
}

/* Leave room for the mobile bottom navigation. */
@media (max-width: 991.98px) {
  body {
    padding-bottom: 4rem;
  }
}

/* ---- Hero / search ---- */
.hero {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 60%, #084298 100%);
}

.hero-search .form-control,
.hero-search .input-group-text {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.hero-search .input-group {
  border-radius: var(--vl-radius);
  overflow: hidden;
}

.bg-white-25 {
  background-color: rgba(255, 255, 255, 0.15) !important;
}

/* ---- Listing cards ---- */
.listing-card {
  border-radius: var(--vl-radius);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.listing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.12) !important;
}

.listing-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #e9eef5;
  overflow: hidden;
}

.listing-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #adb5bd;
}

.listing-card__badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
}

.listing-card__condition {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  font-weight: 500;
  opacity: 0.9;
}

.listing-card__title {
  line-height: 1.2;
}

.listing-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.listing-card__specs li {
  white-space: nowrap;
}

/* ---- Favorite button ---- */
.favorite-fab {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  color: #dc3545;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.favorite-fab.is-active {
  background: #dc3545;
  color: #fff;
}

/* ---- Browse / filters ---- */
.results-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4rem;
  background: rgba(246, 248, 251, 0.6);
  z-index: 5;
}

.htmx-indicator {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Detail gallery ---- */
.listing-gallery__img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e9eef5;
}

.listing-gallery__placeholder {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #adb5bd;
  background: #e9eef5;
}

.listing-thumbs__item img {
  width: 84px;
  height: 64px;
  object-fit: cover;
  border-radius: 0.4rem;
  border: 2px solid transparent;
}

.listing-thumbs__item:hover img,
.listing-thumbs__item:focus img {
  border-color: #0d6efd;
}

/* ---- Spec grid ---- */
.spec-grid .spec-label {
  display: block;
  font-size: 0.78rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.spec-grid .spec-value {
  display: block;
  font-weight: 600;
}

/* Sticky sidebar on the detail page (desktop only). */
@media (min-width: 992px) {
  .listing-sidebar {
    position: sticky;
    top: 5rem;
  }
}

.seller-avatar {
  font-size: 3rem;
  color: #0d6efd;
  line-height: 1;
}

.shop-hero {
  position: relative;
  background: linear-gradient(135deg, #0b3d5c 0%, #1a6a9a 55%, #2f8fbf 100%);
  color: #fff;
  overflow: hidden;
}

.shop-hero--has-banner {
  min-height: 220px;
}

.shop-hero__banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-hero__overlay {
  position: relative;
  background: linear-gradient(
    180deg,
    rgba(8, 28, 44, 0.35) 0%,
    rgba(8, 28, 44, 0.78) 100%
  );
  min-height: inherit;
}

.shop-hero__bio {
  max-width: 40rem;
  white-space: pre-line;
}

.shop-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.shop-hero .seller-avatar {
  color: #fff;
  font-size: 2.5rem;
}

.shop-logo {
  width: 72px;
  height: 72px;
  border-radius: 0.75rem;
  object-fit: cover;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}

.shop-logo-preview {
  width: 64px;
  height: 64px;
  border-radius: 0.5rem;
  object-fit: cover;
  border: 1px solid #dee2e6;
}

.listing-description a,
.shop-about a {
  word-break: break-word;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.listing-description a:hover,
.shop-about a:hover {
  text-decoration-thickness: 2px;
}

.shop-hours {
  white-space: pre-line;
}

.shop-service-badge {
  font-weight: 500;
  color: #334155;
}

.shop-sidebar {
  position: sticky;
  top: 5rem;
}

.shop-sidebar__block {
  border-top: 1px solid #eef2f6;
  padding-top: 0.9rem;
  margin-top: 0.9rem;
  margin-bottom: 0.9rem;
}

.shop-share .form-control {
  font-size: 0.75rem;
}

@media (max-width: 991.98px) {
  .shop-sidebar {
    position: static;
  }
}

/* ---- Mobile bottom navigation ---- */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  justify-content: space-around;
  background: #fff;
  border-top: 1px solid #e3e8ef;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  padding-bottom: env(safe-area-inset-bottom);
}

.mbn-item {
  flex: 1;
  text-align: center;
  padding: 0.4rem 0;
  font-size: 0.7rem;
  color: #6c757d;
  text-decoration: none;
}

.mbn-item i {
  display: block;
  font-size: 1.25rem;
  line-height: 1.3;
}

.mbn-item:active,
.mbn-item:hover {
  color: #0d6efd;
}

.mbn-cta i {
  color: #0d6efd;
  font-size: 1.6rem;
}

.mbn-badge {
  position: absolute;
  top: 0.15rem;
  left: 50%;
  transform: translateX(0.35rem);
  font-size: 0.6rem;
}

.mbn-item {
  position: relative;
}

/* ---- Messaging / chat ---- */
.chat-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 12rem);
  min-height: 24rem;
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  background: #f6f8fb;
  display: flex;
  flex-direction: column;
}

.chat-bubble {
  max-width: 80%;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--vl-radius);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.chat-bubble__body {
  white-space: pre-line;
  line-height: 1.35;
}

.chat-bubble__meta {
  font-size: 0.68rem;
  opacity: 0.7;
  text-align: right;
  margin-top: 0.15rem;
}

.chat-bubble--mine {
  align-self: flex-end;
  background: #0d6efd;
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

.chat-bubble--theirs {
  align-self: flex-start;
  background: #fff;
  color: #212529;
  border: 1px solid #e3e8ef;
  border-bottom-left-radius: 0.25rem;
}

.min-w-0 {
  min-width: 0;
}

#id_make,
#id_vehicle_model {
  /* Adds the standard Bootstrap caret arrow as a background image */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23343a40' fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.25rem;
  /* Prevents text from overlapping the icon */
}
