/* ====== internal_style.css ====== */

/* General mobile adjustments */
body {
  background: #fafafa;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Arial, sans-serif;
}

.container {
  max-width: 1200px;
}

/* Search form styling */
form.row {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 10px;
}

form .form-control {
  border-radius: 8px;
  border: 1px solid #ccc;
  height: 45px;
}

form .btn {
  border-radius: 8px;
  height: 45px;
  width: 100%;
}

/* Listing cards */
.card {
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-radius: 10px;
  transition: transform 0.2s ease;
  overflow: hidden; /* ✅ ensures no overflow in mobile */
}

.card:hover {
  transform: translateY(-3px);
}

.card-body h5 {
  font-size: 1.1rem;
  font-weight: 600;
}

.card-body p {
  margin-bottom: 8px;
}

/* === Fix for Image & Thumbnail Responsiveness === */
.main-image {
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 1 / 1; /* keeps square ratio */
  background: black;
  display: block;
  margin: 0 auto 10px;
  object-fit: contain;
  border-radius: 6px;
}

.thumb-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

.thumb-container img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
  cursor: pointer;
}

.thumb-container img:hover {
  border-color: #007bff;
}

/* Center fit and stacking for mobile */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  form.row {
    flex-direction: column;
    gap: 10px;
  }

  form .col {
    width: 100%;
  }

  .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .card {
    margin: 0 auto;
    width: 100%;
  }

  body {
    overflow-x: hidden;
  }

  h3 {
    text-align: center;
    font-size: 1.2rem;
  }

  /* ✅ Responsive image scaling on mobile */
  .main-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .thumb-container img {
    width: 12vw; /* scales to viewport width */
    height: 12vw;
  }
}

/* Fix image overflow */
.card img.main-image {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Ensure thumbnails wrap nicely on small screens */
.thumb-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}


/* ====== End ====== */
