/* ---------- Global Styles ---------- */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  background-color: #f1f7ed; /* Updated background */
  color: #333;
}

header {
  background-color: #243e36; /* Updated header background */
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
}

* { box-sizing: border-box; }
@media (max-width:720px){
  header{
    flex-direction:column;
    align-items:stretch;
    text-align:center;
  }
  .header-left{
    justify-content:center;
  }
  .auth-buttons{
    align-items:stretch;
  }
  .auth-buttons button{
    width:100%;
  }
}



.auth-buttons button {
  padding: 0.5rem 1rem;
  background-color: #fff;
  color: #243e36;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

/* ---------- Main Content ---------- */
main {
  padding: 1rem;
}

/* Categories Section with title above grid */
.categories {
  background-color: #fff;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  text-align: left;
}

.category-title {
  margin-bottom: 1rem;
}

/* ---- Category tiles: responsive grid ---- */
.animal-icons {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* phones default: 2 columns */
}

/* Small phones */
@media (max-width: 380px) {
  .animal-icons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
}


/* Desktop */
@media (min-width: 650px) {
  .animal-icons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


.icon-card {
  position: relative;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: auto;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(0.65rem, 1.2vw, 1.1rem);
  font-size: clamp(0.9rem, 1vw, 1rem);
  overflow: hidden;
}

.icon-card img {
  width: 100%;
  aspect-ratio: 1 / 1;   /* consistent square tiles */
  object-fit: cover;     /* fills nicely */
  border-radius: 10px;
}


.icon-card span {
  margin-top: 0.5rem;
  font-size: 1rem;
}

/* Grey overlay on hover */
.icon-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(128, 128, 128, 0);
  transition: background-color 0.2s;
}
.icon-card:hover {
  transform: scale(1.05);
}
.icon-card:hover::after {
  background-color: rgba(203, 200, 200, 0.4);
}

/* ---------- Listings Section ---------- */
.listings {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 1rem;
}

/* ---- Mobile: 2-column listings grid (premium + normal) ---- */
@media (max-width: 520px) {
  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

@media (max-width: 520px) {
  .listing-card {
    padding: 0.7rem;
    border-radius: 10px;
  }

  .listing-card h3 {
    font-size: 1rem;
    margin: 0.2rem 0 0.35rem;
  }

  /* Make the preview image less tall for 2-column cards */
  .listing-carousel img {
    height: 120px;
    border-radius: 8px;
  }

  /* Slightly smaller body text inside cards */
  .listing-card p,
  .listing-location,
  .listing-phone,
  .seller-info {
    font-size: 0.92rem;
  }

  /* Buttons inside cards should stay compact */
  .listing-card button {
    padding: 0.6rem 0.7rem;
    font-size: 0.95rem;
  }
}


.listing-card {
  background-color: #fff;
  border-radius: 8px;
  padding: clamp(0.75rem, 1.8vw, 1rem);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  min-width: 0;

  display: flex;          /* ✅ new */
  flex-direction: column; /* ✅ new */
  height: 100%;           /* ✅ helps grid align */
}

/* Clamp ONLY the description paragraph (the one that has no special class) */
/* Clamp ONLY the description paragraph (preview text) */
.listing-card p:not(.seller-info):not(.listing-location):not(.listing-phone) {
  display: -webkit-box;
  -webkit-box-orient: vertical;

  /* Standard + WebKit for compatibility */
  -webkit-line-clamp: 2;
  line-clamp: 2;

  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.5rem;
}



.listing-card.premium {
  border: 2px solid gold;
  background-color: #fffbea;
}

/* Premium badge */
.listing-card.premium {
  position: relative;
  overflow: hidden;
}

.listing-card.premium::before {
  content: "⭐ Premium";
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 215, 0, 0.92);
  color: #243e36;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

@media (max-width: 380px) {
  .listing-card.premium::before {
    top: 8px;
    left: 8px;
    padding: 5px 9px;
    font-size: 0.74rem;
  }
}




.listing-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

footer {
  text-align: center;
  padding: 1rem;
}

/* ---------- Modal Styles & Others ---------- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: rgba(0,0,0,0.6);
}
.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 1.5rem;
  border-radius: 8px;
  width: 90%;
  max-width: 520px;
  position: relative;
  overflow: hidden;
}
.close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1001;
}

/* ---------- Make inputs inside modals full-width (your current CSS only styles inputs inside forms) ---------- */
.modal-content label {
  display: block;
  font-weight: 600;
  margin-top: 0.5rem;
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="password"],
.modal-content input[type="tel"],
.modal-content textarea,
.modal-content select {
  width: 100%;
  padding: 0.75rem;
  margin: 0.35rem 0 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

/* ---------- Account modal layout ---------- */
.account-modal .account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.account-modal .field-hint {
  font-size: 0.9rem;
  color: #666;
  margin-top: -0.4rem;
  margin-bottom: 0.6rem;
}

.account-modal .divider {
  height: 1px;
  background: #eee;
  margin: 0.75rem 0 1rem;
}

@media (max-width: 560px) {
  .account-modal .account-grid {
    grid-template-columns: 1fr;
  }
}


/* ---------- Auth Modal Specific ---------- */
.auth-content {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 0;
}
.auth-slider-container {
  width: 200%;
  display: flex;
  transition: transform 0.5s ease-in-out;
  transform: translateX(0);
}
.auth-slide {
  width: 50%;
  box-sizing: border-box;
  padding: 1rem;
}

/* ---------- Forms & Inputs ---------- */
form input[type="email"],
form input[type="text"],
form input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}
.password-container {
  position: relative;
}
.password-container .toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.2rem;
  color: #888;
}

/* ---------- Buttons ---------- */
button {
  width: 100%;
  padding: 0.8rem 1.1rem;
  background-color: #7ca982;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0.5rem;
  font-weight: 750;
  letter-spacing: 0.1px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.10);
  transition: transform 0.08s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

button:hover {
  filter: brightness(0.98);
  box-shadow: 0 10px 22px rgba(0,0,0,0.14);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 3px solid rgba(124, 169, 130, 0.55);
  outline-offset: 2px;
}

.google-btn {
  background-color: #db4437;
  margin-bottom: 1rem;
}

/* ---------- Auth Switch Links ---------- */
.auth-switch {
  text-align: center;
  margin-top: 1rem;
}
.auth-switch a {
  color: #243e36;
  text-decoration: none;
  font-weight: bold;
}

/* ---------- Error Message ---------- */
.error-msg {
  color: red;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}



.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#createListingBtn {
  background-color: #7ca982;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

#createListingBtn {
  display: inline-block !important;
}

/* ---------- Utility ---------- */
.hidden {
  display: none;
}





.back-to-home {
  text-align: center;
  margin: 2rem 0;
}

.back-to-home a {
  background-color: #eee;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
}

.auth-action {
  background-color: #7ca982;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.listing-images {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.listing-images img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
}


/* Make modal larger */
.large-modal {
  max-width: 720px;
}

/* Preview uploaded images */
.image-preview-container {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.image-preview-container .preview-img-wrapper {
  position: relative;
}

.image-preview-container img {
  max-width: 120px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.image-preview-container .remove-img-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: red;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 14px;
  cursor: pointer;
}

.preview-container {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.75rem 0;
}

.preview-img-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
}

.preview-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.remove-img-btn {
  position: absolute;
  top: 6px;
  right: 6px;

  width: 22px;
  height: 22px;

  background: red;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.remove-img-btn:hover {
  filter: brightness(0.9);
}


.listing-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Listing card images (grid view) */
.listing-carousel img {
  flex: 0 0 100%;
  width: 100%;
  height: clamp(140px, 22vw, 180px);
  object-fit: contain;   /* 🔑 show full image */
  background-color: #f4f4f4; /* neutral background */
  scroll-snap-align: start;
  border-radius: 6px;
}

/* Make horizontal scrollbars easier to see (especially on mobile/trackpads) */
.listing-carousel {
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px; /* leaves room for the scrollbar */
}

/* Firefox-only scrollbar styling (Safari will skip this) */
@supports (scrollbar-color: auto) {
  .listing-carousel {
    scrollbar-width: auto;
    scrollbar-color: rgba(36, 62, 54, 0.6) rgba(0, 0, 0, 0.12);
  }
}

/* Chrome/Edge/Safari */
.listing-carousel::-webkit-scrollbar { height: 10px; }
.listing-carousel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}
.listing-carousel::-webkit-scrollbar-thumb {
  background: rgba(36, 62, 54, 0.6);
  border-radius: 999px;
}

/* ---------- Mobile scroll cue for image carousels ---------- */
@media (max-width: 520px) {

  /* Make it obvious there are more images by showing a "peek" of the next image */
  .listing-carousel.has-multi img {
    flex: 0 0 88%;           /* was 100% -> shows next image edge */
  }

#detailModal .listing-carousel.has-multi img,
.detail-modal .detail-carousel.has-multi img {
  flex: 0 0 92%;
}

  /* Add a subtle right-side fade + chevron hint */
  .listing-carousel,
  .detail-modal .detail-carousel {
    position: relative;
    padding-bottom: 14px;    /* more room for scrollbar area */
  }

  .listing-carousel.has-multi::before,
  #detailModal .listing-carousel.has-multi::before,
  .detail-modal .detail-carousel.has-multi::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 42px;
    height: 100%;
    pointer-events: none;
    /* fade on the right edge so the "next image" peek is noticeable */
    background: linear-gradient(to left, rgba(255,255,255,0.95), rgba(255,255,255,0));
    z-index: 5;
  }

  /* detail modal has a grey background, so match that fade */
  .detail-modal .detail-carousel::before {
    background: linear-gradient(to left, rgba(242,242,242,0.95), rgba(242,242,242,0));
  }

  .listing-carousel.has-multi::after,
  #detailModal .listing-carousel.has-multi::after,
  .detail-modal .detail-carousel.has-multi::after {
    content: "›";
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    opacity: 0.55;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.10);
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    animation: swipeHint 1.4s ease-in-out infinite;
    z-index: 6;
  }

  .detail-modal .detail-carousel::after {
    background: rgba(242,242,242,0.88);
  }

  @keyframes swipeHint {
    0%, 100% { transform: translateY(-50%) translateX(0); opacity: 0.45; }
    50%      { transform: translateY(-50%) translateX(-6px); opacity: 0.85; }
  }

  /* Make iOS scrolling feel nicer */
  .listing-carousel,
  .detail-modal .detail-carousel {
    -webkit-overflow-scrolling: touch;
    scroll-snap-stop: always;
  }
}

/* Detail modal carousel images */
#detailModal .listing-carousel img {
  height: 360px;          /* bigger for detail view */
  object-fit: contain;   /* show full image */
  background-color: #000; /* optional: black backdrop for contrast */
}

#detailModal .listing-carousel {
  border-radius: 10px;
  overflow: hidden;
}

#detailModal .listing-carousel img {
  padding: 10px;
}

/* Show full image inside the listing detail modal (no cropping) */
.modal-content .listing-carousel img {
  object-fit: contain;      /* <-- this stops cropping */
  object-position: center;
  height: 360px;            /* adjust if you want taller/shorter */
  background: #f2f2f2;      /* nice letterbox background */
}



/* Make description field look intentional and easier to type in */
#listingDescription {
  min-height: 140px;
  resize: vertical;
  line-height: 1.35;
}

#listingTitle,
#listingDescription,
#listingCategory,
#listingProvince,
#listingPhone {
  margin-top: 0.35rem;
}


.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-size: 0.98rem;
}

.contact-pref {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fafafa;
}

.contact-pref-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.contact-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.contact-choice input[type="radio"] {
  margin-top: 4px;
  transform: scale(1.15);
}

.contact-choice-box {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px 12px;
  background: white;
}

.contact-choice-main {
  font-weight: 700;
}

.contact-choice-sub {
  font-size: 0.92rem;
  color: #666;
  margin-top: 2px;
}

.contact-choice:hover .contact-choice-box {
  border-color: #b5b5b5;
}

.hidden {
  display: none !important;
}


/* ---- My Listings edit: clean contact layout ---- */
.contact-section {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.95rem;
  line-height: 1.2;
}

.contact-row input[type="checkbox"] {
  margin-top: 0.2rem;
}

.contact-row-primary {
  padding: 0.65rem 0.75rem;
  border: 1px solid #d9e6d9;
  border-radius: 10px;
  background: #f5fbf5;
}

.contact-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.contact-main {
  font-weight: 700;
}

.contact-sub {
  font-size: 0.85rem;
  color: #4f5a4f;
}


/* Better meta layout so it doesn't scramble/wrap weirdly */
.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  margin-top: 0.5rem;
  color: #555;
  font-size: 0.95rem;
}

.meta-item strong {
  margin-right: 0.25rem;
}

@media (min-width: 520px) {
  .meta-grid {
    grid-template-columns: 1fr 1fr; /* 2 columns when there's space */
  }
}


/* ---- Filters: responsive layout ---- */
.filters {
  display: grid;
  gap: 12px;
  align-items: center;
  margin-top: 1.25rem;
  grid-template-columns: 1fr; /* mobile stack */
}

/* Make the search row behave properly */
.search-row {
  display: grid;
  gap: 8px;
}

/* Search bar: input + button on one row */
.search-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

/* Desktop: 2-column layout so filters don’t look stretched */
/* Desktop: keep filters stacked and aligned (category dropdown is hidden) */
@media (min-width: 900px) {
  .filters {
    grid-template-columns: 1fr;   /* stack */
    max-width: none;
    margin: 0;              /* ✅ center */
  }

  .search-row { width: 100%; }
  .search-bar { width: 100%; }

  /* keep the input + button together */
  .search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  /* allow the input to fill the row */
  .search-bar input {
    flex: 1;
    max-width: none;
  }

  /* Force desktop filter buttons to be normal size */
  #searchBtn,
  #resetFiltersBtn {
    width: auto;
  }
}




.filters select,
.filters input[type="search"] {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
}

/* ---- Hide category dropdown (image tiles are primary filter) ---- */
.filters label[for="categoryFilter"],
#categoryFilter {
  display: none;
}



#searchInput {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
}
/* Desktop: don't cap the search input width */
@media (min-width: 900px) {
  #searchInput {
    max-width: none;
  }
}


/* Give the listings section some top scroll offset (for sticky header) */
#listingsSection {
  scroll-margin-top: 110px; /* adjust: 80–140px depending on your header height */
}



.search-bar input {
  flex: 1;
  padding: 0.65rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 1rem;
}

.search-bar button {
  padding: 0.8rem 1.1rem;
  border: none;
  border-radius: 14px;
  cursor: pointer;
}


/* ---------- Listing Detail Modal Carousel (horizontal) ---------- */
.detail-modal .detail-carousel {
  display: flex;                 /* ✅ makes children line up next to each other */
  flex-direction: row;
  gap: 12px;
  overflow-x: auto;              /* ✅ horizontal scroll */
  overflow-y: hidden;
  scroll-snap-type: x mandatory; /* ✅ snap scrolling */
  -webkit-overflow-scrolling: touch;

  border-radius: 10px;
  background: #f2f2f2;
  padding: 10px;
}

/* Each image takes a "page" width so you swipe one-by-one */
.detail-modal .detail-carousel img {
  flex: 0 0 100%;
  width: 100%;
  height: 360px;
  object-fit: contain;
  object-position: center;
  background: #f2f2f2;
  scroll-snap-align: start;
  border-radius: 10px;

  padding: 0; /* ✅ IMPORTANT: remove image padding (use container padding instead) */
}




.detail-description {
  margin-top: 0.75rem;
  color: #333;
  line-height: 1.35;
  white-space: pre-wrap;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.secondary-btn {
  background-color: #243e36;
}

.detail-report {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

@media (min-width: 520px) {
  .detail-actions {
    grid-template-columns: 1fr 1fr;
  }
}


.listing-card button {
  margin-top: auto;    /* push to bottom */
  width: 100%;
}

/* ---- Cleaner cards on marketplace grid ----
   Keep: title + category + seller + location + button
   Hide: description + phone in grid view (details available in modal)
*/
#premiumListings .listing-card .listing-phone,
#allListings .listing-card .listing-phone {
  display: none;
}

/* Hide the description paragraph in grid view.
   This targets the "plain" description paragraph (not seller/location/phone) */
#premiumListings .listing-card p:not(.seller-info):not(.listing-location):not(.listing-phone),
#allListings .listing-card p:not(.seller-info):not(.listing-location):not(.listing-phone) {
  display: none;
}

/* Make meta lines tighter */
#premiumListings .listing-card .seller-info,
#premiumListings .listing-card .listing-location,
#allListings .listing-card .seller-info,
#allListings .listing-card .listing-location {
  margin: 0.2rem 0;
  color: #55635a;
  font-size: 0.92rem;
}


/* ---------- Modern upload area ---------- */
.upload-block {
  margin: 0.75rem 0 1rem;
}

.upload-head {
  margin-bottom: 0.5rem;
}

.upload-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #243e36;
}

.upload-sub {
  font-size: 0.92rem;
  color: #555;
  margin-top: 0.15rem;
}

.upload-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 2px dashed rgba(36, 62, 54, 0.25);
  border-radius: 12px;
  background: #f7f9f7;
  cursor: pointer;
  transition: 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}

.upload-dropzone:hover {
  border-color: rgba(36, 62, 54, 0.45);
  background: #f0f5f0;
}

.upload-icon {
  font-size: 1.4rem;
}

.upload-cta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}

.upload-cta strong {
  color: #243e36;
}

.upload-cta span {
  font-size: 0.9rem;
  color: #666;
}

.upload-hint {
  font-size: 0.85rem;
  color: #666;
  white-space: nowrap;
}

/* Hide the native file input (we click the label instead) */
#listingImages {
  position: absolute;
  left: -9999px;
}

/* Nice label for fields */
.field-label {
  display: block;
  margin-top: 0.65rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
}


.image-preview-container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

@media (max-width: 600px) {
  .image-preview-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}



.modal-content.large-modal {
  max-height: 88vh;
  overflow-y: auto;
  padding-bottom: 5.5rem;
}


/* ---- Optional Boost card (Create Listing modal) ---- */
.boost-card {
  margin-top: 0.9rem;
  padding: 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(36, 62, 54, 0.15);
  background: #f7faf7;
}

.boost-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.6rem;
}

.boost-title {
  font-weight: 800;
  color: #243e36;
}

.boost-pill {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(124, 169, 130, 0.18);
  color: #243e36;
}

.boost-row {
  margin: 0;
  align-items: flex-start;
}

.boost-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.boost-main {
  font-weight: 800;
  color: #243e36;
}

.boost-sub {
  font-size: 0.92rem;
  color: #55635a;
  line-height: 1.25;
}

.boost-note {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  color: #55635a;
}

.free-post-note {
  margin: 0.9rem 0 0.35rem;
  font-size: 0.95rem;
  color: #243e36;
  font-weight: 700;
}

.subtle-note {
  font-weight: 600;
  color: rgba(36, 62, 54, 0.75);
  margin-top: 0.6rem;
}


/* ===== Footer ===== */
.site-footer {
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.75);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.footer-links a {
  text-decoration: none;
  font-weight: 700;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-links .dot {
  opacity: 0.5;
}

.footer-copy {
  font-size: 0.9rem;
  opacity: 0.75;
}

/* ===== Footer mobile fix (prevent overflow) ===== */
.footer-links {
  flex-wrap: wrap;            /* ✅ allow wrapping */
  justify-content: center;    /* ✅ center on small screens */
  row-gap: 0.35rem;           /* nicer spacing when it wraps */
}

/* Optional: stop ultra-long words from blowing layout */
.footer-links a {
  max-width: 100%;
}

@media (max-width: 520px) {
  .footer-inner {
    justify-content: center;  /* footer stacks/centers nicely */
    text-align: center;
  }

  .footer-links {
    font-size: 0.92rem;
    column-gap: 0.75rem;
  }

  /* ✅ dots look weird when wrapping — hide them on mobile */
  .footer-links .dot {
    display: none;
  }
}



/* Sponsored ad card */
.ad-card {
  /* ✅ remove full-width span so it takes one grid slot */
  /* grid-column: 1 / -1; */

  background: #fff;
  border: 2px solid rgba(255, 215, 0, 0.9);
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);

  display: flex;
  flex-direction: column;   /* ✅ stack like a listing card */
  gap: 0.6rem;
  height: 100%;             /* ✅ helps match listing-card height in grid rows */
}


.ad-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 215, 0, 0.92);
  color: #243e36;
}

.ad-media {
  width: 100%;
  height: 170px;          /* adjust to match your listing image feel */
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
}

.ad-copy { flex: 1; min-width: 0; }
.ad-title { font-weight: 900; margin: 0; }
.ad-text { margin: 0.25rem 0 0; color: #55635a; }

@media (max-width: 520px) {
  .ad-card { flex-direction: column; align-items: stretch; }
  .ad-media { width: 100%; height: 140px; }
}


/* ===== Sponsored ad card ===== */
.ad-card {
  background: #fff;
  border: 2px solid rgba(255, 215, 0, 0.9);
  border-radius: 14px;
  padding: 0.85rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);

  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  height: 100%;

  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.ad-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.10);
}

.ad-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 215, 0, 0.92);
  color: #243e36;
}

.ad-media {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
}

.ad-copy { flex: 1; min-width: 0; }

.ad-title {
  font-weight: 900;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.15;
}

.ad-meta {
  font-size: 0.85rem;
  opacity: 0.75;
}

.ad-text {
  margin: 0.25rem 0 0;
  color: #55635a;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;

  overflow: hidden;
}

.ad-actions {
  margin-top: auto;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.ad-cta {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  font-weight: 900;
  cursor: pointer;
  background: #7ca982;
  color: #fff;
}

.ad-cta:hover { opacity: 0.95; }

@media (max-width: 520px) {
  .ad-media { height: 160px; }
}

/* --- Boost confirm modal --- */
.mp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.mp-modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.28);
  overflow: hidden;
}

.mp-modal-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.mp-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  color: #243e36;
}

.mp-modal-close {
  color: #111827;                    /* dark */
  font-weight: 900;
  border: 1px solid rgba(0,0,0,0.18);
  background: #f3f4f6;
}
.mp-modal-close:hover {
  background: #e5e7eb;
}


.mp-modal-body {
  padding: 14px 16px;
  color: #222;
}

.mp-boost-box {
  background: rgba(124, 169, 130, 0.10);
  border: 1px solid rgba(36, 62, 54, 0.14);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
}

.mp-boost-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0;
}
.mp-boost-row strong { color: #243e36; }

.mp-modal-actions {
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.mp-btn {
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
}
.mp-btn-cancel {
  background: #e9ecef;              /* darker than before */
  color: #1f2937;                    /* dark text */
  border: 1px solid rgba(0,0,0,0.18);
}
.mp-btn-cancel:hover { background: #dee2e6; }


.mp-btn-primary {
  background: #243e36;
  color: #fff;
}
.mp-btn-primary:hover { opacity: 0.95; }
.mp-btn[disabled] { opacity: 0.6; cursor: not-allowed; }


.btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


.category-declaration {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  background: rgba(124, 169, 130, 0.10);
}
.category-declaration-title {
  font-weight: 800;
  margin-bottom: 6px;
  color: #243e36;
}
.category-declaration-text {
  margin: 0 0 10px 0;
  color: #333;
  line-height: 1.35;
  font-size: 0.95rem;
}


#categorySpecificWrap.hidden {
  margin-bottom: 0;
}
