/* === Global Styles === */
body, html {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: #f8f9fa;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 1rem;
}

/* === Unified Categories Sidebar === */
.categories-sidebar, .sidebar {
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  position: sticky;
  top: 20px;
  width: 250px;
  flex-shrink: 0;
}
.categories-sidebar h3, .sidebar h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  font-weight: bold;
}
.cat-card {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.3s;
  position: relative;
  margin-bottom: 5px;
}
.cat-card img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 10px;
}
.cat-card p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.cat-card:hover {
  background: #e0f2f1;
}
/*.sub-cats {
  max-height: 0;
  overflow: hidden;
  flex-direction: column;
  transition: max-height 0.4s ease;
  padding-left: 20px;
  margin-top: 0;
}*/
/*.cat-card.active .sub-cats {
  max-height: 300px;
  margin-top: 5px;
}*/
.arrow {
  margin-left: auto;
  transition: transform 0.3s;
}
.cat-card.active .arrow {
  transform: rotate(180deg);
}

/* === Header / Nav === */
.desktop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #007bff;
  color: white;
  gap: 15px;
}
.desktop-header .logo {
  font-size: 1.5rem;
  font-weight: bold;
}
.desktop-header .header-center {
  flex: 4;
}
.desktop-header .header-right {
  flex: 1;
  text-align: right;
}
.search-wrapper {
  position: relative;
  display: flex;
  width: 100%;
  gap: 5px;
}
.search-wrapper .search-category {
  padding: 10px;
  border-radius: 6px 0 0 6px;
  border: none;
  background: #e9ecef;
  cursor: pointer;
}
.search-wrapper .search-input {
  flex: 1;
  padding: 10px 15px;
  border-radius: 0 6px 6px 0;
  border: none;
  font-size: 1rem;
}
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  z-index: 999;
}
.suggestions li {
  padding: 8px 12px;
  cursor: pointer;
}
.suggestions li:hover { background: #f1f1f1; }

/* Buttons */
.btn-post {
  background: #ffb400;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-post:hover { background: #ffa500; }
.signin-btn, .register-btn {
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  margin-right: 5px;
  transition: 0.3s;
}
.signin-btn:hover, .register-btn:hover {
  background: #fff;
  color: #007bff;
}

/* === Main / Sidebar / Content === */
.main-container {
  display: flex;
  gap: 20px;
  padding: 20px;
}
.content { flex: 1; }

/* Ads Grid */
.ad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
}
@media(min-width: 1024px) {
  .ad-grid { grid-template-columns: repeat(5, 1fr); }
}
.ad {
  background: white;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.ad:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.15); }
.ad img { width: 100%; display: block; transition: transform 0.3s; }
.ad:hover img { transform: scale(1.05); }
.ad .info { padding: 0.5rem; display: flex; flex-direction: column; }
.ad h4 { font-size: 0.85rem; margin: 0; color: #333; }
.ad .price { color: #128c7e; font-weight: bold; margin-top: 5px; }
.ad .location { font-size: 0.75rem; color: #666; }

/* Labels */
.label {
  position: absolute;
  top: 8px; left: 8px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 3px;
}
.label.trending { background: #ff5a5f; }
.label.featured { background: #ffb400; }
.label.urgent { background: #28a745; }
.label.new { background: #6f42c1; }
.label.wanted { background: #17a2b8; }

.floating-arrow {
  display: block;
  margin: 20px auto;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.3s, background 0.3s;
}
.floating-arrow:hover {
  transform: translateY(5px);
  background: #0056b3;
}


/* View More Button */
.view-more-btn {
  text-align: center;
  margin: 15px 0 25px 0;
}
.view-more-btn button {
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  background: #128c7e;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
}
.view-more-btn button:hover {
  background: #0f6f61;
  transform: scale(1.05);
}

/* Footer */
footer.footer {
  background: #007bff;
  color: #fff;
  text-align: left;
  padding: 40px 20px 20px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

/* === Mobile Styles === */
.mobile-sidebar,
.mobile-header,
.mobile-nav {
  display: none; /* default hide on desktop */
}

@media(max-width: 780px) {
  .desktop-header { display: none; }

  .main-container {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    padding-bottom: 70px; /* for bottom nav */
  }

  /* Mobile Header */
  .mobile-header {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #007bff;
    color: white;
    padding: 10px 15px;
    position: sticky;
    top: 0;
    z-index: 999;
  }
  .mobile-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }
  .mobile-logo { font-size: 1.4rem; font-weight: bold; }
  .mobile-user-profile img { width: 40px; height: 40px; border-radius: 50%; }

  .mobile-header-bottom {
    display: flex;
    gap: 8px;
    width: 100%;
  }
  .mobile-search-wrapper { flex: 1; }
  .mobile-search-wrapper input {
    width: 100%;
    padding: 10px;
    border-radius: 25px;
    border: none;
    box-sizing: border-box;
  }

  /* Mobile Categories Grid */
  .mobile-sidebar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 10px;
    box-sizing: border-box;
  }
  .mobile-sidebar .cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    padding: 5px;
    border-radius: 6px;
  }
  .mobile-sidebar .cat-card img {
    width: 100%;
    height: 50px;
    object-fit: cover;
    margin-bottom: 4px;
  }

  /* Mobile Bottom Nav */
  .mobile-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #ccc;
    padding: 8px 0;
    z-index: 9999;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
  }
  .mobile-nav-item span { display: block; font-size: 0.7rem; margin-top: 2px; }
}

/* Hide mobile elements on desktop */
@media(min-width: 781px) {
  .mobile-header,
  .mobile-sidebar,
  .mobile-nav {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  .sidebar {
    display: block !important;
  }
}

/* === Fix: Show only relevant categories per device === */
@media(max-width: 780px) {
  .sidebar, .categories-sidebar {
    display: none !important; /* hide desktop categories on mobile */
  }
}

@media(min-width: 781px) {
  .mobile-sidebar {
    display: none !important; /* hide mobile categories on desktop */
  }
}

/* ===== Force Mobile/Desktop Visibility Fix ===== */

/* Mobile: show only on <=780px */
@media (max-width: 780px) {
    .desktop-header,
    .sidebar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    .mobile-header,
    .mobile-sidebar,
    .mobile-nav {
        display: flex !important; /* grid/flex handled below */
    }
    .mobile-sidebar { display: grid !important; }
}

/* Desktop: show only on >780px */
@media (min-width: 781px) {
    .desktop-header,
    .sidebar {
        display: block !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
    }
    .mobile-header,
    .mobile-sidebar,
    .mobile-nav {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* === Ensure mobile elements are hidden on desktop === */
@media (min-width: 781px) {
  .mobile-header,
  .mobile-sidebar,
  .mobile-nav {
    display: none !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Make sure desktop header and sidebar remain visible */
  .desktop-header,
  .sidebar {
    display: block !important;
  }
}

/* === Desktop: only hide mobile elements, keep header flex intact === */
@media (min-width: 781px) {
    .mobile-header,
    .mobile-sidebar,
    .mobile-nav {
        display: none !important; /* hide mobile elements */
    }

    /* Keep desktop header flex layout */
    .desktop-header {
        display: flex !important; /* must stay flex */
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 15px 20px;
        gap: 15px;
    }

    /* Ensure sidebar stays visible */
    .sidebar {
        display: block !important;
    }
}

/* Fix desktop header alignment */
.desktop-header .header-right {
    display: flex;
    align-items: center;
    flex-wrap: nowrap; /* prevent wrapping */
    gap: 10px;         /* spacing between profile area and Post Ad button */
}

.desktop-header .header-profile-area {
    display: flex;
    align-items: center;
    flex-wrap: nowrap; /* prevent wrapping */
    gap: 5px;          /* spacing between Sign In, Register, Notification */
}

/* Fix desktop header buttons alignment */
.desktop-header .header-profile-area,
.desktop-header .header-right {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;      /* prevent wrapping */
    gap: 10px;              /* spacing between buttons */
}

.desktop-header .header-profile-area button,
.desktop-header .header-right button {
    margin: 0;
    padding: 8px 15px;       /* uniform padding */
    height: auto;            /* let height adjust naturally */
    flex-shrink: 0;          /* prevent shrinking */
    white-space: nowrap;     /* prevent text wrapping */
}

.desktop-header .btn-post {
    border-radius: 6px;      /* match other buttons */
}

/* Desktop Header: Fix notification alignment */
@media(min-width: 781px) {
    .desktop-header .header-profile-area {
        display: flex;
        align-items: center;
        gap: 10px; /* space between buttons and notification */
    }

    .desktop-header .notification-icon {
        display: flex;
        align-items: center;
        font-size: 1rem;
        background: transparent;
        border: none;
        color: #fff;
        padding: 0 5px;
        cursor: pointer;
    }

    .desktop-header .notif-count {
        margin-left: 5px;
        background: #ff5a5f;
        border-radius: 50%;
        padding: 2px 6px;
        font-size: 0.7rem;
        font-weight: bold;
    }
}

.desktop-header .header-profile-area {
    display: flex;
    align-items: center;
    gap: 10px; /* adjust this value for the space you want */
}

.desktop-header .header-right {
    margin-left: 15px; /* creates space from the notification area */
    display: flex;
    align-items: center; /* keep vertical alignment */
}

#scrollDownBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  display: none; /* initially hidden */
  z-index: 9999;
  transition: transform 0.3s;
}
#scrollDownBtn:hover {
  transform: translateY(5px);
  background: #0056b3;
}

/* Footer */
footer.footer {
  background: #007bff;
  color: #fff;
  padding: 40px 20px 20px 20px;
  font-family: Arial, sans-serif;
}

footer.footer .footer-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
  max-width: 1200px;
  margin: auto;
}

footer.footer .footer-col {
  flex: 1 1 180px; /* Grow but keep min width */
  min-width: 180px;
}

footer.footer h4 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  position: relative;
  padding-bottom: 5px;
}

footer.footer h4::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 2px;
  background: #ffb400;
  border-radius: 2px;
}

footer.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

footer.footer ul li {
  margin-bottom: 8px;
}

footer.footer ul li a {
  text-decoration: none;
  color: #fff;
  transition: color 0.3s;
}

footer.footer ul li a:hover {
  color: #ffb400;
}

footer.footer .social-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

footer.footer .social-links a {
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s;
}

footer.footer .social-links a:hover {
  color: #ffb400;
}

footer.footer .app-badges {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* Footer bottom */
footer.footer .footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 20px;
  font-size: 0.9rem;
}

/* Responsive */
@media(max-width: 1024px) {
  footer.footer .footer-container {
    gap: 20px;
    justify-content: center;
  }
}

@media(max-width: 780px) {
  footer.footer .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  footer.footer .footer-col {
    min-width: auto;
    width: 100%;
  }

  footer.footer .social-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  footer.footer .app-badges {
    justify-content: center;
  }
}

/* Hide footer on mobile devices */
@media (max-width: 780px) {
    footer.footer {
        display: none !important;
    }
}

/* Show footer on desktop */
@media (min-width: 781px) {
    footer.footer {
        display: flex !important; /* maintain desktop layout */
    }
}

.footer .app-links {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.footer .app-links img {
    width: 140px;   /* adjust size as needed */
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.3s;
}

.footer .app-links img:hover {
    transform: scale(1.05);
}

.footer .app-links img {
    max-width: 140px; /* adjust width */
    height: auto;
    margin-right: 10px;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #f8f9fa url('https://www.transparenttextures.com/patterns/cubes.png') repeat; 
    background-size: auto;
}


/* === Sticky desktop header (no layout changes) === */
@media (min-width: 781px) {
  .desktop-header {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    z-index: 2000; /* keeps it above page content */
  }
}

/* === Sticky Desktop Header (Fixed) === */
@media (min-width: 781px) {
  .desktop-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
  }

  /* Prevent content from hiding behind the fixed header */
  body {
    padding-top: 80px; /* adjust to your header’s height */
  }
}

/* === Sticky Mobile Header (Fixed at top like desktop) === */
@media (max-width: 780px) {
  .mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: #007bff; /* keep your original header color */
  }

  /* Push content down so it doesn't hide behind header */
  body {
    padding-top: 100px; /* adjust to your mobile header’s height */
  }
}

/* === Sidebar dropdown fix (use max-height animation; JS sets inline height) === */
.sidebar .cat-card .sub-cats {
  display: block;               /* allow max-height animation to work */
  max-height: 0;                /* collapsed */
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.2s ease;
  padding-left: 20px;
  margin-top: 0;
  color: #555;
  font-size: 0.9rem;
}

/* when active (JS toggles the class "active") */
.sidebar .cat-card.active .sub-cats {
  max-height: 1000px; /* large enough; JS will set exact inline height for smoothness */
  margin-top: 6px;
}

/* arrow rotation — unified selector and transition */
.sidebar .cat-card .arrow {
  margin-left: auto;
  display: inline-block;
  transform: rotate(0deg);
  transition: transform 0.3s ease;
}

.sidebar .cat-card.active .arrow {
  transform: rotate(180deg);
}

.sub-cats a {
  display: block;
  padding: 6px 10px;
  margin-bottom: 8px;     /* <-- space between items */
  color: #555;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.sub-cats a:hover {
  background: #f1f1f1;
  color: #000;
}


/* === Sidebar sub-cats: stacked list with gaps (paste at END of style.css) === */

.sidebar .cat-card.has-children {
  /* keep the image + label on one row but allow submenu to wrap below */
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;            /* allow submenu to wrap onto a new line */
  position: relative;
}

/* Force submenu to appear on its own full-width row below the card header */
.sidebar .cat-card.has-children .sub-cats {
  order: 2;                   /* ensure submenu is after the img + p */
  width: 100%;                /* take full row */
  display: flex;              /* stack children vertically */
  flex-direction: column;
  gap: 8px;                   /* space between subcategory items */
  padding-left: 60px;         /* indent (50px image + 10px margin) */
  box-sizing: border-box;
  max-height: 0;              /* collapsed */
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.2s ease;
  margin-top: 6px;
}

/* open state (JS toggles .active on .cat-card) */
.sidebar .cat-card.has-children.active .sub-cats {
  /* JS will set the exact maxHeight inline for smooth animation;
     this fallback allows CSS-only opening if needed */
  max-height: 1000px;
}

/* sub-item link styles — use gap above, remove margin-bottom to avoid doubled spacing */
.sidebar .cat-card.has-children .sub-cats a {
  display: block;
  padding: 8px 12px;
  color: #555;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.18s ease, color 0.18s ease;
  width: fit-content;         /* keeps the clickable area compact — remove if you want full-row clickable */
}

/* If you prefer the whole row clickable, enable this: */
/* .sidebar .cat-card.has-children .sub-cats a { width: 100%; } */

.sidebar .cat-card.has-children .sub-cats a:hover {
  background: #f1f1f1;
  color: #000;
}

/* rotate arrow when open (keeps earlier behavior) */
.sidebar .cat-card.has-children .arrow {
  margin-left: auto;
  transition: transform 0.25s ease;
}
.sidebar .cat-card.has-children.active .arrow {
  transform: rotate(180deg);
}

.sidebar .cat-card.has-children .sub-cats p {
  margin: 0 0 8px 0;  /* bottom space */
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.2s;
  cursor: pointer;
}

.sidebar .cat-card.has-children .sub-cats p:last-child {
  margin-bottom: 0; /* no gap after last item */
}

.sidebar .cat-card.has-children .sub-cats p:hover {
  background: #f1f1f1;
}

.sidebar {
  flex: 0 0 220px;   /* do not grow/shrink, fixed 220px */
  max-width: 220px;
  background: #fff;
  border-right: 1px solid #ddd;
  padding: 15px;
  box-sizing: border-box;
}

.desktop-profile img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid #fff; /* optional, makes it stand out */
}

/* Desktop Profile Dropdown */
.desktop-header .profile-container {
    position: relative;
    cursor: pointer;
}

.desktop-header .profile-container img.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.desktop-header .profile-dropdown {
    position: absolute;
    top: 50px; /* below the profile image */
    right: 0;
    background: #fff;
    color: #333;
    list-style: none;
    padding: 5px 0;
    margin: 0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 150px;
    display: none; /* hidden by default */
    z-index: 3000;
}

.desktop-header .profile-dropdown li {
    padding: 8px 15px;
    transition: background 0.2s;
}

.desktop-header .profile-dropdown li:hover {
    background: #f1f1f1;
}

.desktop-header .profile-dropdown li a {
    color: #333;
    text-decoration: none;
    display: block;
}


.footer-bottom {
    width: 100%;
    text-align: center;
    margin: 0 auto;
    padding: 10px 0;
    display: block;
}



/* ===== Ad Details Layout ===== */
.ad-details-page .ad-details-container {
  max-width: 1000px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Top Section: Main Flex */
.ad-details-page .top-section {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* Left: Image + Product Details Below */
.ad-details-page .left-column {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ad-details-page .images-slider img {
  width: 100%;
  border-radius: 8px;
}

.ad-details-page .images-thumbs {
  display: flex;
  gap: 10px;
}

.ad-details-page .images-thumbs img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.3s;
}

.ad-details-page .images-thumbs img:hover { transform: scale(1.1); }

/* Product Details Below Images */
.ad-details-page .product-details-below {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ad-details-page .product-details-below h1 { font-size: 1.5rem; margin: 0; }
.ad-details-page .product-details-below .price { color: #128c7e; font-weight: bold; font-size: 1.3rem; }
.ad-details-page .product-details-below .location { font-size: 0.9rem; color: #666; }
.ad-details-page .product-details-below .stats { display: flex; gap: 10px; font-size: 0.85rem; color: #666; }

/* Right Wrapper */
.ad-details-page .right-wrapper {
  flex: 0 0 250px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center; /* Center all content */
  text-align: center;  /* Center text */
}

/* Price & Request */
.ad-details-page .price-request .price { font-size: 1.3rem; color: #128c7e; font-weight: bold; margin-bottom: 8px; }
.ad-details-page .price-request .btn { width: 100%; padding: 10px; margin-top: 5px; }

/* Seller Contact */
.ad-details-page .seller-contact .contact-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-direction: column;
  width: 100%;
}

/* Seller Info */
.ad-details-page .seller-info-card {
  display: flex;
  flex-direction: column; /* vertical layout */
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #f1f1f1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.ad-details-page .seller-info-card img {
  width: 70px;
  height: 70px;
  border-radius: 50%; /* Circle */
  object-fit: cover;
  border: 2px solid #128c7e;
}

/* Buttons Styling */
.ad-details-page .btn {
  display: inline-block;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  text-align: center;
  white-space: nowrap;
  width: 100%;
  margin: 5px 0;
}

.ad-details-page .btn-primary { background: #128c7e; color: #fff; }
.ad-details-page .btn-primary:hover { background: #0f705f; }

.ad-details-page .btn-secondary { background: #f1f1f1; color: #333; }
.ad-details-page .btn-secondary:hover { background: #ddd; }

/* === Primary Call-to-Action (Call Seller) === */
.ad-details-page .btn.call {
  background: #28a745;      /* green */
  color: #fff;
   border-radius: 10px;
}
.ad-details-page .btn.call:hover {
  background: #218838;
}

/* Make Call button same size as Chat button */
.ad-details-page .btn.call {
  padding: 10px 16px;      /* match chat button */
  font-size: 14px;         /* same as chat button */
  font-weight: 500;        /* same as chat button */
  border-radius: 6px;      /* match chat button */
  min-width: 140px;        /* same as chat button */
  text-align: center;
  display: inline-block;
  transition: all 0.3s ease;
}

/* === Secondary Call-to-Action (Chat Seller, Request Call Back) === */
.ad-details-page .btn-outline {
  background: #e6f0ff;        /* light blue background */
  border: 1px solid #007bff;  /* blue border */
  color: #007bff;             /* blue text */
  font-weight: 500;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  min-width: 140px;
  text-align: center;
  display: inline-block;
  transition: all 0.3s ease;
}
.ad-details-page .btn-outline:hover {
  background: #007bff;        /* solid blue on hover */
  color: #fff;                /* white text on hover */
}

/* === Danger Buttons (Reports) === */
.ad-details-page .report-wrapper {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  margin-top: 10px;
  width: 100%;
  box-sizing: border-box;
}
.ad-details-page .report-wrapper .btn.small {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 88px !important;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 4px;
  background: #fff;
  color: #fc2533;
  border: 1px solid #fc2533;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.ad-details-page .report-wrapper .btn.small:hover {
  background: #fc2533;
  color: #fff;
}

/* Safety Tips */
.ad-details-page .safety-tips {
  background: #f0f8ff; /* light blue for calm, professional feel */
  padding: 12px 15px;
  border-radius: 10px;
  text-align: left;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  font-size: 0.85rem; /* smaller font */
  color: #333;
}

.ad-details-page .safety-tips h3 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 1rem;
  color: #007bff; /* blue title for attention */
  font-weight: 600;
}

.ad-details-page .safety-tips ul {
  padding-left: 20px;
  margin: 0;
  list-style: none;
}

.ad-details-page .safety-tips ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
  line-height: 1.3;
  color: #555;
}

.ad-details-page .safety-tips ul li::before {
  content: "✔"; /* checkmark for visual cue */
  position: absolute;
  left: 0;
  color: #28a745; /* green check for safety */
  font-weight: bold;
}


/* Description Section */
.ad-details-page .description-section {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

/* Similar Ads Carousel */
.ad-details-page .similar-ads { margin-top: 20px; }
.ad-details-page .ad-carousel { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 10px; }
.ad-details-page .ad-carousel::-webkit-scrollbar { display: none; }

/* Mobile adjustments */
@media(max-width: 780px) {
  .ad-details-page .top-section { flex-direction: column; }
  .ad-details-page .left-column, .ad-details-page .right-wrapper { min-width: 100%; align-items: center; }
  .ad-details-page .contact-buttons, .ad-details-page .report-wrapper { flex-direction: column; }
}

/* Product Gallery */
.ad-details-page .product-gallery .main-image {
  text-align: center;
  margin-bottom: 15px;
}
.ad-details-page .product-gallery .main-image img {
  width: 100%;
  max-width: 700px;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #ddd;
}

/* Slider */
.ad-details-page .slider-container {
  position: relative;
  max-width: 700px;
  margin: auto;
}
.ad-details-page .slider-container img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #ddd;
}
.ad-details-page .slider-container .prev, .ad-details-page .slider-container .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  padding: 10px;
  cursor: pointer;
  font-size: 18px;
  border-radius: 50%;
}
.ad-details-page .slider-container .prev { left: 10px; }
.ad-details-page .slider-container .next { right: 10px; }

/* Thumbnails */
.ad-details-page .thumbnail-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: thin;
}
.ad-details-page .thumbnail-scroll img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 5px;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.3s;
}
.ad-details-page .thumbnail-scroll img:hover {
  border-color: #fc2533;
  transform: scale(1.05);
}
.ad-details-page .thumbnail-scroll img.active {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* === Card-like white wrappers === */
.ad-details-page .price-request,
.ad-details-page .seller-contact,
.ad-details-page .report-wrapper,
.ad-details-page .safety-tips,
.ad-details-page .description-section,
.ad-details-page .similar-ads {
  background: #fff;
  border: 2px solid #f1f1f1;  /* light border like */
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* Consistent spacing */
.ad-details-page .right-wrapper > div {
  width: 100%;
}

.ad-details-page button i {
  margin-right: 6px;   /* space between text & icon */
  font-size: 14px;
}

/* Verified Badge */
.ad-details-page .seller-name {
  font-weight: 600;
  font-size: 1rem;
}
.ad-details-page .verified {
  font-size: 0.75rem;
  color: #007bff;
  margin-left: 6px;
  background: #e6f0ff;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.ad-details-page .verified i {
  color: #007bff;
  font-size: 0.75rem;
}

/* View all ads link */
.ad-details-page .view-ads {
  display: inline-block;
  font-size: 0.85rem;
  margin-top: 2px;
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
}
.ad-details-page .view-ads:hover {
  color: #0056b3;
}

/* Action Buttons under thumbnails */
.ad-details-page .action-buttons {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin: 10px 0;
}
.ad-details-page .action-buttons .btn.small {
  flex: 0 0 auto;
  width: auto;
  min-width: 88px;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 4px;
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.ad-details-page .action-buttons .btn.small:hover {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

/* Wrapper for price + badge */
.ad-details-page .price-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Price text */
.ad-details-page .price {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0;
}

/* Badge styles */
.ad-details-page .price-tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

/* Negotiable */
.ad-details-page .price-tag.negotiable {
  background: #e6f9f0;
  color: #0a8a47;
  border: 1px solid #0a8a47;
}

/* Fixed Price */
.ad-details-page .price-tag.fixed {
  background: #fff3e6;
  color: #b45f06;
  border: 1px solid #b45f06;
}

/* === Lightbox (Full Image Preview) === */
.ad-details-page .lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 50px;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  text-align: center;
}

.ad-details-page .lightbox img {
  max-width: 90%;
  max-height: 80vh;
}

.ad-details-page .lightbox .close {
  position: absolute;
  top: 20px; right: 40px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
}

.ad-details-page .lightbox .prev, 
.ad-details-page .lightbox .next {
  position: absolute;
  top: 50%;
  font-size: 40px;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  user-select: none;
}

.ad-details-page .lightbox .prev { left: 10%; }
.ad-details-page .lightbox .next { right: 10%; }

/* === Product Information (Small Cards) === */
.ad-details-page .product-info {
  background: #fff;
  border: 2px solid #f1f1f1;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
  max-width: 700px;
  margin: 20px 0;
}

.ad-details-page .product-info h3 {
  font-size: 1rem;        /* slightly smaller title */
  margin-bottom: 12px;
  color: #333;
}

/* Grid for small info cards */
.ad-details-page .info-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Each small info card */
.ad-details-page .info-card {
  flex: 1 1 30%;           /* 3 per row */
  min-width: 120px;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  text-align: center;
}

.ad-details-page .info-card .info-label {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
}

.ad-details-page .info-card .info-value {
  font-size: 0.85rem;
  color: #128c7e;
  font-weight: 600;
}

/* Mobile adjustments */
@media(max-width: 780px) {
  .ad-details-page .info-card {
    flex: 1 1 45%;       /* 2 per row on mobile */
  }
}


.ad-details-page .options {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.ad-details-page .option-btn {
  padding: 5px 10px;
  font-size: 0.85rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.ad-details-page .option-btn.selected {
  background: #128c7e;
  color: #fff;
  border-color: #128c7e;
}

.ad-details-page .product-details-below .details-row {
  display: flex;
  flex-wrap: wrap;      /* wraps if not enough space */
  gap: 15px;
  align-items: center;
}

.ad-details-page .product-details-below .details-row p {
  margin: 0;
  font-size: 0.95rem;
  color: #555;
}

.ad-details-page .product-details-below .details-row .price {
  color: #128c7e;      /* highlight price in green */
  font-weight: bold;
}

.ad-details-page .product-details-below .details-row .views-posted {
  color: #888;
}

.ad-details-page .product-details-below .details-row p {
  margin: 0;
  font-size: 0.85rem;   /* smaller font for location & stats */
  color: #555;
}

.ad-details-page .product-details-below .details-row .price {
  color: #128c7e;      /* price stays green */
  font-weight: bold;
  font-size: 1rem;      /* slightly larger than others */
}

.ad-details-page .similar-ads .ad .price {
  font-size: 0.9rem;   /* smaller font for similar products prices */
  font-weight: bold;   /* optional: keep it bold */
  color: #128c7e;     /* optional: match main price color */
}

/* Page Background */
.ad-details-page body {
  background: linear-gradient(135deg, #e0f7fa, #ffffff); /* soft gradient from light cyan to white */
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

/* Optional: subtle pattern or texture */
.ad-details-page body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: url('https://www.transparenttextures.com/patterns/geometry2.png'); /* subtle pattern */
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

/* Make ad-details container slightly pop */
.ad-details-page .ad-details-container {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 12px;
  padding: 25px;
  margin: 30px auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.ad-details-page .description-section {
  max-width: 700px;      /* limits width */
  margin: 20px 0;        /* spacing from other elements */
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: left;      /* aligns content to the left */
}

/* Product Information & Description Styling */
.ad-details-page .product-info,
.ad-details-page .description-section {
  background: #fff;                     /* white background */
  border: 2px solid #f1f1f1;           /* light border like Jiji */
  border-radius: 10px;                  /* rounded corners */
  box-shadow: 0 4px 12px rgba(0,0,0,0.06); /* subtle shadow */
  padding: 20px;                        /* inner spacing */
  max-width: 700px;                     /* limit width */
  margin: 20px 0;                       /* spacing from other sections */
}

/* Price + Negotiable stacked and centered */
.ad-details-page .price-wrapper {
  display: flex;
  flex-direction: column;  /* stack vertically */
  align-items: center;     /* center horizontally */
  gap: 5px;                /* space between price and badge */
  margin-bottom: 15px;     /* space below before buttons */
}

/* Product Features Container */
.ad-details-page .product-features {
  background: #fff;
  border: 2px solid #f1f1f1;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  max-width: 700px; /* matches left column width */
  margin: 20px 0;
}

.ad-details-page .product-features h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #333;
}

/* Horizontal Flex with Wrapping */
.ad-details-page .features-grid {
  display: flex;
  flex-wrap: wrap;          /* allows wrapping when reaching column width */
  gap: 15px;
}

/* Each Feature Item */
.ad-details-page .feature-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 0 calc(20% - 12px); /* 5 per row horizontally with gap considered */
  box-sizing: border-box;
}

/* Label and Value */
.ad-details-page .feature-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin: 0;
}

.ad-details-page .feature-value {
  font-size: 0.95rem;
  color: #128c7e;
  margin: 0;
}

/* === Product Information Grid (Small Cards) === */
.ad-details-page .product-info {
  background: #fff;
  border: 2px solid #f1f1f1;
  border-radius: 10px;
  padding: 15px;               /* slightly smaller padding */
  box-shadow: 0 3px 8px rgba(0,0,0,0.05); /* lighter shadow */
  max-width: 700px;
  margin: 20px 0;
}

.ad-details-page .product-info h3 {
  font-size: 1rem;             /* slightly smaller title */
  margin-bottom: 12px;
  color: #333;
}

.ad-details-page .info-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;                   /* gap between cards */
}

.ad-details-page .info-card-small {
  flex: 1 1 calc(20% - 12px);  /* 5 per row on desktop with gap considered */
  min-width: 120px;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 8px 10px;           
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: #555;
}

.ad-details-page .info-card-small .info-label {
  font-weight: 500;
  font-size: 0.75rem;
  color: #666;
}

.ad-details-page .info-card-small .info-value {
  font-weight: 600;
  color: #128c7e;
  font-size: 0.85rem;
}

/* Mobile adjustments */
@media(max-width: 780px) {
  .ad-details-page .info-card-small {
    flex: 1 1 45%;       /* 2 per row on mobile */
  }
}

@media(max-width: 780px) {

  /* --- Top Section: Stack vertically --- */
  .ad-details-page .top-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px;
  }

  /* --- Left & Right columns full width --- */
  .ad-details-page .left-column,
  .ad-details-page .right-wrapper {
    width: 100% !important;
    min-width: auto !important;
    align-items: stretch !important;
  }

  /* --- Main Images & Slider --- */
  .ad-details-page .slider-container img,
  .ad-details-page .images-slider img,
  .ad-details-page .product-gallery .main-image img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
  }

  .ad-details-page .images-thumbs img {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
  }

  /* --- Buttons (share, download, request) grid --- */
  .ad-details-page .contact-buttons,
  .ad-details-page .action-buttons {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
  }

  /* --- Product Name, Price, Location, Stats --- */
  .ad-details-page .product-details-below .details-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* --- Product Info grid: 4 per row --- */
  .ad-details-page .info-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* --- Product Features grid: 3 per row --- */
  .ad-details-page .features-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* --- Similar Ads grid: 2 per row --- */
  .ad-details-page .ad-carousel {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    overflow-x: hidden !important;
  }

  .ad-details-page .ad-carousel .ad img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
  }

  /* --- Ensure box-sizing globally --- */
  .ad-details-page *, 
  .ad-details-page *::before, 
  .ad-details-page *::after {
    box-sizing: border-box !important;
  }
}

/* === Report Buttons Side by Side (like Call Seller buttons) === */
@media(max-width: 780px) {
  .ad-details-page .report-wrapper {
    flex-direction: row;      /* side by side */
    flex-wrap: nowrap;        /* do not wrap to grid */
    justify-content: flex-start;
    gap: 10px;                /* space between buttons */
  }

  .ad-details-page .report-wrapper .btn.small {
    flex: 1 1 auto;           /* take equal space but side by side */
    min-width: 0;             /* remove min-width restriction */
  }
}

/* Report buttons: desktop layout */
.ad-details-page .report-wrapper {
  justify-content: space-between; /* spread buttons evenly */
  align-items: center;
  flex-direction: row;           /* side by side */
  width: 100%;                   /* fit container */
  margin-top: 10px;
  gap: 10px;
}

.ad-details-page .report-wrapper .btn.small {
  font-weight: 600;       /* slightly bolder */
  font-size: 0.95rem;     /* slightly bigger */
  padding: 10px 16px;     /* match call seller buttons */
  flex: 1 1 auto;         /* grow to fill evenly */
  min-width: 0;            /* prevent shrinking */
}

/* Report buttons: desktop layout */
.ad-details-page .report-wrapper {
  display: flex;
  justify-content: space-between; /* side by side */
  align-items: center;
  flex-direction: row;
  max-width: 400px;       /* total width of the buttons group */
  margin: 10px auto;      /* center the wrapper horizontally */
  gap: 10px;
}

.ad-details-page .report-wrapper .btn.small {
  font-weight: 600;       
  font-size: 0.95rem;     
  padding: 10px 16px;     
  flex: 1 1 auto;         /* grow evenly to fill wrapper */
  min-width: 0;            
}

@media(max-width: 780px) {
  /* Make Call button same as Chat button on mobile */
  .ad-details-page .btn.call {
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    min-width: 140px !important;
    width: auto !important;
  }

  /* Ensure both buttons take equal space side by side */
  .ad-details-page .contact-buttons,
  .ad-details-page .report-wrapper {
    display: flex !important;
    gap: 10px !important;
  }

  .ad-details-page .contact-buttons .btn,
  .ad-details-page .report-wrapper .btn.small {
    flex: 1 1 auto !important;
  }
}

@media (max-width: 780px) {
  /* Move Product Features & Description above Seller Profile on mobile */
  .ad-details-page .left-column,
  .ad-details-page .right-wrapper {
    display: flex;
    flex-direction: column;
  }

  /* Assign order */
  .ad-details-page .product-features {
    order: 1;  /* comes first in left column */
  }

  .ad-details-page .description-section {
    order: 2;  /* comes after features */
  }

  .ad-details-page .right-wrapper {
    order: 3;  /* seller profile comes last */
  }
}
@media (max-width: 780px) {
  /* Move Similar Ads below Safety Tips */
  .ad-details-page .safety-tips {
    order: 3; /* safety tips comes first */
  }

  .ad-details-page .similar-ads {
    order: 4; /* similar ads comes after safety tips */
  }
}

/* Price + Negotiable/Fixed stretch full width */
.ad-details-page .price-wrapper {
  display: flex;
  justify-content: space-between; /* stretch price left, tag right */
  align-items: center;
  flex-wrap: nowrap;              /* prevent wrapping */
  width: 100%;                    /* full width */
  font-size: 1rem;
  margin-bottom: 5px;
}

.ad-details-page .price-wrapper .price {
  font-weight: bold;
  font-size: 1.3rem;
  color: #128c7e;
}

.ad-details-page .price-wrapper .price-tag {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.ad-details-page .price-wrapper .price-tag.negotiable {
  background: #e6f9f0;
  color: #0a8a47;
  border: 1px solid #0a8a47;
}

.ad-details-page .price-wrapper .price-tag.fixed {
  background: #fff3e6;
  color: #b45f06;
  border: 1px solid #b45f06;
}

/* Mobile adjustments */
@media(max-width: 780px) {
  .ad-details-page .price-wrapper {
    flex-direction: row;     /* keep horizontal on mobile */
    justify-content: space-between; /* stretch left and right */
    align-items: center;
    width: 100%;
  }
}

/* Price + Negotiable/Fixed: Full-width horizontal layout */
.ad-details-page .price-wrapper {
  display: flex;              /* horizontal row */
  flex-direction: row;        /* ensure horizontal */
  justify-content: space-between; /* spread items across full width */
  align-items: center;        /* vertically center content */
  gap: 10px;                  /* spacing between price and tags */
  width: 100%;                /* stretch across container */
  flex-wrap: nowrap;          /* prevent wrapping */
  margin-bottom: 15px;        /* space below before buttons */
}

/* Individual price styling */
.ad-details-page .price-wrapper .price {
  font-size: 1.3rem;
  font-weight: bold;
  color: #128c7e;
  margin: 0;
}

/* Negotiable / Fixed tags styling */
.ad-details-page .price-wrapper .price-tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

/* Negotiable tag */
.ad-details-page .price-wrapper .price-tag.negotiable {
  background: #e6f9f0;
  color: #0a8a47;
  border: 1px solid #0a8a47;
}

/* Fixed tag */
.ad-details-page .price-wrapper .price-tag.fixed {
  background: #fff3e6;
  color: #b45f06;
  border: 1px solid #b45f06;
}

/* Price + Negotiable/Fixed: Full-width, snug layout */
.ad-details-page .price-wrapper {
  display: flex;              
  flex-direction: row;        
  justify-content: flex-start; /* align items to left */
  align-items: center;        
  gap: 6px;                    /* small gap between price and tags */
  width: 100%;                
  flex-wrap: nowrap;          
  margin-bottom: 15px;        
}

/* Price styling */
.ad-details-page .price-wrapper .price {
  font-size: 1.3rem;
  font-weight: bold;
  color: #128c7e;
  margin: 0;
  white-space: nowrap;         /* prevent wrapping */
}

/* Tags styling */
.ad-details-page .price-wrapper .price-tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;         /* prevent wrapping */
}

/* Negotiable tag */
.ad-details-page .price-wrapper .price-tag.negotiable {
  background: #e6f9f0;
  color: #0a8a47;
  border: 1px solid #0a8a47;
}

/* Fixed tag */
.ad-details-page .price-wrapper .price-tag.fixed {
  background: #fff3e6;
  color: #b45f06;
  border: 1px solid #b45f06;
}

/* Report wrapper: mobile */
@media (max-width: 780px) {
  .ad-details-page .report-wrapper {
    display: flex !important;
    flex-direction: row !important;    /* side by side */
    flex-wrap: nowrap !important;      /* do not wrap */
    justify-content: space-between !important;  /* stretch evenly */
    gap: 10px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 10px 0 !important;
  }

  .ad-details-page .report-wrapper .btn.small {
    flex: 1 1 0 !important;  /* each button takes equal space */
    min-width: 0 !important; /* allow shrinking */
  }
}

.ad-details-html {   /* changed from ad-details.html to ad-details-html */
  position: fixed;       
  bottom: 20px;          
  left: 50%;             
  transform: translateX(-50%);
  font-size: 2.5rem;
  color: #333;           
  cursor: pointer;
  animation: bounce 1.5s infinite;
  z-index: 999;          
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Floating down arrow */
.ad-details-html {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.5rem;
  cursor: pointer;
  color: #333;
  z-index: 999;
  transition: transform 0.3s;
}

/* Optional hover effect */
.ad-details-html:hover {
  transform: translateX(-50%) translateY(5px);
}

/* Hide arrow on screens smaller than 768px (mobile/tablet) */
@media (max-width: 767px) {
  .ad-details-html {
    display: none;
  }
}

@media (max-width: 780px) {
  /* Reduce container padding and margin */
  .ad-details-page .ad-details-container {
    padding: 15px !important;
    margin: 15px auto !important;
  }

  /* Reduce gaps in top section */
  .ad-details-page .top-section {
    gap: 10px !important;
  }

  /* Reduce card padding */
  .ad-details-page .product-info,
  .ad-details-page .description-section,
  .ad-details-page .product-features,
  .ad-details-page .price-request,
  .ad-details-page .seller-contact,
  .ad-details-page .report-wrapper,
  .ad-details-page .safety-tips {
    padding: 10px !important;
    margin: 10px 0 !important;
  }

  /* Thumbnails smaller */
  .ad-details-page .thumbnail-scroll img {
    width: 90px !important;
    height: 60px !important;
  }

  /* Reduce gap between buttons */
  .ad-details-page .contact-buttons,
  .ad-details-page .action-buttons,
  .ad-details-page .report-wrapper {
    gap: 5px !important;
  }
}

/* ===== FIX PRODUCT FEATURES SECTION ===== */
.product-features {
  max-width: 1200px;   /* keeps it inside container */
  margin: 0 auto;      /* center on desktop */
  padding: 20px 15px;
  box-sizing: border-box;
  overflow-x: hidden;  /* prevent horizontal scroll */
}

/* ===== FIX SIMILAR PRODUCTS SECTION ===== */
.similar-products {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px 15px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* If similar products uses grid */
.similar-products .product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  max-width: 100%;
  overflow: hidden;
}

/* Ensure product images don’t overflow */
.similar-products img,
.product-features img {
  max-width: 100%;
  height: auto;
  display: block;
}







