/* --- Animated gradient keyframes --- */
@keyframes borderGradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* --- Body Scroll Prevention --- */
html.panel-open {
  overflow: hidden;
  overscroll-behavior: contain;
  /* position: fixed;
  width: 100%;
  height: 100%; */

  -webkit-overflow-scrolling: hidden;
  scrollbar-gutter: stable;
}

/* --- Ad Detail Slide Panel Styles --- */
.ad-detail-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  padding: 0 6px;
  justify-content: center;
}

.ad-detail-panel.show {
  opacity: 1;
  visibility: visible;
}

.ad-detail-panel-content {
  max-width: 660px;
  max-height: 95dvh;
  min-height: 400px; /* Ensure minimum height even when hidden */
  background: var(--bg-color);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
  /* Enable smooth slide animations */
  transition: transform 0.3s ease;
  transform: translateY(100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: 100%;
}

/* Desktop: Make panel wider to utilize more screen space */
@media (min-width: 768px) {
  .ad-detail-panel-content {
    max-width: 900px;
    border-radius: 24px 24px 0 0;
  }
}

@media (min-width: 1200px) {
  .ad-detail-panel-content {
    max-width: 1100px;
  }
}

/* Panel animation states */
.ad-detail-panel-content.animate-open {
  transition: transform 0.3s ease;
}

.ad-detail-panel-content.snap-back {
  transition: transform 0.3s ease;
}

/* Dragging state - disable transitions during drag */
.ad-detail-panel-content.dragging {
  transition: none !important;
  cursor: grabbing;
}

/* -------------------------------------------------- */
/* Lightweight overrides                             */
/* -------------------------------------------------- */

/* (Removed) previously forced transition disabling to retain slide-up animation */

/* Always reserve 280px for image areas when images exist */
.ad-card-gallery,
.ad-card-main-image,
.ad-card-swiper,
.ad-card-swiper .swiper-slide {
  height: 280px;
  min-height: 280px;
}

.ad-detail-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem 0.6rem 1.5rem;
  background: var(--card-bg);
  position: relative;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  border-bottom: 4px solid;
  border-image: linear-gradient(45deg, #667eea 0%, #764ba2 20%, #f093fb 40%, #f5576c 60%, #4facfe 80%, #00f2fe 100%);
  border-image-slice: 1;
  box-shadow: #00000029 0px 4px 13px 4px;
  z-index: 10;
  /* keep rounded corners when title updates */
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.ad-detail-panel-header:active {
  cursor: grabbing;
}

.ad-detail-panel-header.dragging {
  cursor: grabbing;
}

.ad-detail-panel-title {
  color: var(--text-color);
  font-weight: 600;
  margin: 0;
  font-size: 0.875rem; /* ~30% smaller */
  pointer-events: none;
}

.ad-detail-panel-close {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  z-index: 10;
  position: relative;
  pointer-events: auto !important;
  touch-action: manipulation;
}

.ad-detail-panel-close:hover {
  background-color: var(--border-color);
}

.ad-detail-panel-body {
  flex: 1;
  background: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  overflow-y: scroll;
  min-height: 400px; /* Ensure minimum height */
  /* overscroll-behavior: contain; */
  /* scroll-snap-type: x mandatory; */
  /* scrollbar-gutter: stable; */
}

.ad-detail-panel-content-row {
  width: 100%;
  min-height: 400px; /* Ensure minimum height for content */
  /* scroll-snap-align: start; */
}

.ad-card-separator {
  opacity: 0.4;
}

/* Handle bar indicator */
.ad-detail-panel-header::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  transition: background-color 0.2s ease, width 0.2s ease, height 0.2s ease;
}

/* Enhanced handle bar for dragging feedback */
.ad-detail-panel-header:hover::before {
  background: var(--primary-color);
  width: 50px;
}

.ad-detail-panel-header.dragging::before {
  background: var(--primary-color);
  width: 60px;
  height: 5px;
}



.ad-card-holder {
  width: 100%;
  padding: 8px;
}

.ad-card-holder::-webkit-scrollbar {
  display: none;
}

/* --- Unified Ad Card Layout --- */
.ad-card {
  /* scroll-snap-align: start; */
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: start;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-height: 280px;
}

.ad-card::-webkit-scrollbar {
  display: none;
}

/* --- Featured Card Styles (Article Panel) --- */
.ad-card.featured-card {
  border: 3px solid #ffc107;
  box-shadow: 0 8px 24px rgba(255, 193, 7, 0.3);
  animation: featuredGlow 3s ease-in-out infinite;
}

.ad-card.featured-card:hover {
  box-shadow: 0 12px 32px rgba(255, 193, 7, 0.4);
}

@keyframes featuredGlow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(255, 193, 7, 0.3);
  }
  50% {
    box-shadow: 0 12px 32px rgba(255, 193, 7, 0.5);
  }
}

.ad-card .featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 15;
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  color: #000;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: badgePulse 2s ease-in-out infinite;
  display: flex;
  align-items: center;
  gap: 4px;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Featured card price styling in article panel */
.ad-card.featured-card .ad-card-price {
  font-size: 1.7rem;
}

.ad-card.featured-card .ad-card-title {
  font-size: 1.4rem;
  font-weight: 700;
}

/* Dark mode adjustments for featured cards in article panel */
[data-theme="dark"] .ad-card.featured-card {
  border-color: #ffb300;
}

[data-theme="dark"] .ad-card .featured-badge {
  background: linear-gradient(135deg, #ffb300 0%, #ff9800 100%);
}

/* Responsive adjustments for featured cards in article panel */
@media (max-width: 768px) {
  .ad-card .featured-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
  }
}


/* --- Ad Card Gallery Styles --- */

.ad-card-main-image {
  position: relative;
  width: 100%;
  min-height: 280px;
  height: 280px;
  background: var(--bg-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-card-main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  position: relative;
  z-index: 2;
  background: var(--bg-color);
  min-height: 280px;
  max-height: 280px;
}



/* Ensure gallery container maintains height */
.ad-card-gallery {
  height: 280px;
  min-height: 280px;
  position: relative;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Zoom icon at top-left of gallery */
.ad-card-zoom {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.ad-card-zoom:hover {
  background: rgba(0,0,0,0.7);
  transform: translateY(-1px);
}

.ad-card-zoom:active {
  transform: translateY(0);
}



/* Swiper styles for ad card gallery */
.ad-card-swiper {
  width: 100%;
  height: 280px;
}

.ad-card-swiper .swiper-slide {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-color);
}

.ad-card-swiper .swiper-slide img,
.ad-card-swiper img[data-main-image] {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  max-height: 280px;
  display: block;
}

/* Map container replacing gallery area */
.ad-card-map-container {
  width: 100%;
  height: 400px;
  min-height: 400px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  z-index: 5;
}

/* Leaflet popup styling inside ad panel map to match search popup look */
.ad-card-map-container .leaflet-popup-content-wrapper,
.ad-card-map-container .leaflet-popup-tip {
  background: transparent;
  box-shadow: none;
  border: none;
  max-width: none;
}
.ad-card-map-container .leaflet-popup-content {
  margin: 0;
  width: 200px !important; /* constrain popup width to avoid squashing */
}

/* Popup card sizing similar to search */
.map-popup-hero {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  width: 200px;
  height: 160px;
}

/* Pointer triangle on left side pointing to marker */
.map-popup-hero::before {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid rgba(0, 0, 0, 0.85);
  z-index: 3;
}

/* Slightly larger title like search popup */
.map-popup .result-desc {
  font-size: 0.63rem; /* reduced ~30% */
}

/* Inline map (below details) */
.ad-card-inline-map {
  width: 100%;
  height: 300px;
  min-height: 300px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  margin-top: 12px;
}

.ad-card-image-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 15;
}

/* Overlay map/photos toggles in gallery */
.ad-card-map-toggle,
.ad-card-photos-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 402;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 16px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  font-size: 0.8rem;
}
.ad-card-map-toggle .label,
.ad-card-photos-toggle .label {
  font-weight: 600;
}
.ad-card-gallery.has-map-toggle .ad-card-image-count,
.ad-card-gallery.has-map-toggle .ad-card-image-count-desktop {
  top: 48px; /* push count below the map toggle */
}

.permalink-gallery .ad-card-gallery.has-map-toggle .ad-card-image-count-desktop {
  top: 48px !important; /* push count below the map toggle in permalink gallery */
  right: 12px !important; /* move to right edge when map toggle is present */
  font-size: 0.7rem !important;
  font-weight: 600 !important;
}

.ad-card-thumbnails,
.ad-card-thumbnails-inline {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;

  /* Position thumbnails over the main image at bottom */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  padding: 0.5rem;
  backdrop-filter: blur(4px);
  margin-top: 220px;
  /* Ensure scroll works by setting max-width */
  max-width: calc(100% - 24px);
  min-width: 0;
}

/* --- Thumbnail pager (dots) --- */
.ad-thumb-dots {
  display: none;
  gap: 8px;
  align-items: center;
}

/* Inline overlay variant: position over gallery, centered near bottom */
.ad-card-thumbnails-inline + .ad-thumb-dots {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 10px;
  z-index: 11;
  display: flex;
}

/* Desktop bottom strip variant: show below strip in normal flow */
.ad-gallery-bottom-strip + .ad-thumb-dots {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.ad-thumb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-color);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.ad-thumb-dot.active {
  background: var(--text-color);
  transform: scale(1.2);
}

/* Sliding pager structure */
.ad-thumb-viewport {
  overflow: hidden;
  width: 100%;
}
.ad-thumb-track {
  display: flex;
  width: 100%;
  transition: transform 0.25s ease;
  will-change: transform;
}
.ad-thumb-track.no-transition {
  transition: none !important;
}
.ad-thumb-track.dragging {
  transition: none !important;
}
.ad-thumb-page {
  flex: 0 0 100%;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.ad-card-thumbnails::-webkit-scrollbar,
.ad-card-thumbnails-inline::-webkit-scrollbar {
  height: 4px;
}

.ad-card-thumbnails::-webkit-scrollbar-track,
.ad-card-thumbnails-inline::-webkit-scrollbar-track {
  background: transparent;
}

.ad-card-thumbnails::-webkit-scrollbar-thumb,
.ad-card-thumbnails-inline::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.ad-card-thumbnail {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.ad-card-thumbnail:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.8);
}

.ad-card-thumbnail.active {
  border-color: white;
  border-width: 3px;
  transform: none;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.ad-card-thumbnail::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ad-card-thumbnail.active::after {
  opacity: 0;
}

.ad-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* (No mobile price overlay: mobile behavior unchanged) */

/* --- Ad Card Header Styles --- */
.ad-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.ad-card-header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.ad-card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto; /* push actions to the right */
}

.ad-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  line-height: 1.4;
  cursor: pointer;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

.ad-card-share-btn,
.ad-card-copy-btn,
.ad-card-toggle-view-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  color: var(--text-color);
  font-size: 1rem;
  position: relative;
}

/* Open in new tab button matches icon-only style */
.ad-card-open-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  color: var(--text-color);
  font-size: 1rem;
  position: relative;
}

.ad-card-share-btn:hover,
.ad-card-copy-btn:hover,
.ad-card-toggle-view-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: scale(1.05);
}
.ad-card-open-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.ad-card-share-btn:active,
.ad-card-copy-btn:active,
.ad-card-toggle-view-btn:active {
  transform: scale(0.95);
}
.ad-card-open-btn:active {
  transform: scale(0.95);
}

.ad-card-share-btn.share-success,
.ad-card-copy-btn.share-success {
  background: #28a745;
  color: white;
  border-color: #28a745;
  animation: successPulse 0.3s ease;
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Tooltip for share button - positioned below */
.ad-card-share-btn::after,
.ad-card-copy-btn::after {
  content: attr(title);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ad-card-share-btn::before,
.ad-card-copy-btn::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.ad-card-share-btn:hover::after,
.ad-card-copy-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(12px);
}

.ad-card-share-btn:hover::before,
.ad-card-copy-btn:hover::before {
  opacity: 1;
}

.ad-card-share-btn.share-success::after,
.ad-card-copy-btn.share-success::after {
  content: '¡Copiado!';
  background: #28a745;
  opacity: 1;
  transform: translateX(-50%) translateY(12px);
}

.ad-card-share-btn.share-success::before,
.ad-card-copy-btn.share-success::before {
  border-bottom-color: #28a745;
  opacity: 1;
}

/* Share button with label */
.ad-card-share-btn.has-label {
  width: auto;
  padding: 0 12px;
  border-radius: 20px;
  gap: 8px;
}

.ad-card-toggle-view-btn.has-label {
  width: auto;
  padding: 0 12px;
  border-radius: 20px;
  gap: 8px;
}

/* removed photos toolbar btn */

/* Bookmark button in article panel */
.ad-card .btn-bookmark {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  color: var(--text-color);
  font-size: 1rem;
  position: relative;
}

.ad-card .btn-bookmark:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border-color: #dc3545;
  transform: scale(1.05);
}

.ad-card .btn-bookmark.bookmarked {
  background: #dc3545;
  color: white;
  border-color: #dc3545;
}

.ad-card .btn-bookmark.bookmarked:hover {
  background: #c82333;
  border-color: #bd2130;
}

.ad-card .btn-bookmark:active {
  transform: scale(0.95);
}

.ad-card-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
  color: white !important;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
  cursor: pointer;
}

.ad-card-price .price-currency {
  font-size: 0.8em;
  opacity: 0.8;
  margin-right: 6px;
}

/* --- Ad Card Keypoints Styles --- */
.ad-card-keypoints-section {
  margin: 1rem 0;
}

.ad-card-keypoints {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.ad-card-keypoints::before {
  content: '💡';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.2rem;
  opacity: 0.3;
}

.ad-card-keypoints h5 {
  color: var(--text-color);
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ad-card-keypoints h5::before {
  content: '📋';
  font-size: 1.1rem;
}

.ad-card-keypoints-content {
  color: var(--text-color);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* --- Ad Card Contact Styles --- */
.ad-card-contact {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Contact row with price on the left and actions on the right */
.ad-contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.ad-contact-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ad-contact-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
}

/* Floating Contact Info */
.floating-contact-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: flex-end;
}

.floating-contact-item {
  position: relative;
  display: flex;
  align-items: center;
  animation: none !important;
}

/* Ensure bookmark button aligns perfectly with contact buttons */
.floating-contact-info .btn-bookmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
}

.floating-contact-item:nth-child(1),
.floating-contact-item:nth-child(2),
.floating-contact-item:nth-child(3),
.floating-contact-item:nth-child(4) { animation-delay: 0s !important; }

.floating-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.floating-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.floating-btn:hover::before {
  left: 100%;
}

.floating-btn:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: var(--text-color);
}

.floating-btn i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.floating-btn:hover i {
  transform: scale(1.1);
}

.contact-label {
  font-size: 0.8rem;
  letter-spacing: 0.3px;
}

/* Specific button colors */
.phone-item .floating-btn {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.8), rgba(32, 201, 151, 0.8));
  border-color: rgba(40, 167, 69, 0.6);
  color: white;
}

.whatsapp-item .floating-btn {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.8), rgba(18, 140, 126, 0.8));
  border-color: rgba(37, 211, 102, 0.6);
  color: white;
}

.email-item .floating-btn {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.8), rgba(200, 35, 51, 0.8));
  border-color: rgba(220, 53, 69, 0.6);
  color: white;
}

.website-item .floating-btn {
  background: linear-gradient(135deg, rgba(111, 66, 193, 0.8), rgba(90, 50, 163, 0.8));
  border-color: rgba(111, 66, 193, 0.6);
  color: white;
}

/* "¡Lo quiero!" button for non-logged users */
.login-item .floating-btn.lo-quiero-btn {
  background: linear-gradient(135deg, var(--primary-color, #6f42c1), var(--secondary-color, #5a32a3));
  border: 2px solid var(--primary-color, #6f42c1);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  animation: pulse-glow 2s ease-in-out infinite;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(111, 66, 193, 0.3);
}

.login-item .floating-btn.lo-quiero-btn:hover {
  background: linear-gradient(135deg, var(--secondary-color, #5a32a3), var(--primary-color, #6f42c1));
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
}

.login-item .floating-btn.lo-quiero-btn i {
  font-size: 1.2rem;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.3);
  }
  50% {
    box-shadow: 0 6px 25px rgba(111, 66, 193, 0.5);
  }
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  10%, 30% {
    transform: scale(1.1);
  }
  20%, 40% {
    transform: scale(1);
  }
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Ad Card Location Styles --- */
.ad-card-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  justify-content: flex-end;
  text-align: right;
  width: 100%;
}

.ad-card-location i {
  color: var(--primary-color);
  font-size: 0.9rem;
}

/* Inline meta (date + views) aligned with location */
.ad-card-location .ad-card-location-sep {
  color: var(--text-muted);
  margin: 0 0.35rem;
}
.ad-card-location .ad-card-date,
.ad-card-location .ad-card-views {
  margin-left: 0.15rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Enhanced Ad Card Body Styles --- */
.ad-card-body {
  width: 100%;
  padding: 1.5rem;
}

/* --- Loader and skeletons --- */
.ad-card-loader-placeholder {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.06), rgba(0,0,0,0.12), rgba(0,0,0,0.06));
  background-size: 200% 100%;
  animation: skeletonShimmer 1.2s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-text-line {
  height: 14px;
}



@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(13, 110, 253, 0.25);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ad-card-loading-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ad-card-lead {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.4;
  font-style: italic;
  background: var(--card-bg);
  padding: 0.75rem;
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

.ad-card-body-text-section {
  margin-bottom: 1rem;
}

.show-more-btn {
  color: var(--primary-color) !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  transition: color 0.2s ease !important;
  margin-bottom: 0.75rem !important;
  text-decoration: none !important;
}

.show-more-btn:hover {
  color: #0b5ed7 !important;
  text-decoration: none !important;
}

.ad-card-body-text {
  font-size: 0.9rem;
  color: var(--text-color);
  /* margin-bottom: 1rem; */
  line-height: 1.6;
  text-align: left;
}

.ad-card-body-text strong {
  color: var(--primary-color);
  font-weight: 600;
}

.ad-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  gap: 1rem;
}

.ad-card-meta-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.ad-card-meta-right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  text-align: right;
}

.ad-card-meta-inline {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ad-card-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ad-card-author .author-avatar-link {
  text-decoration: none;
  transition: transform 0.2s ease;
}

.ad-card-author .author-avatar-link:hover {
  transform: scale(1.1);
  text-decoration: none;
}

.ad-card-author .author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--primary-color);
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.ad-card-author .author-avatar-link:hover .author-avatar {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px rgba(13, 110, 253, 0.3);
}

.ad-card-author .author-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ad-card-author .author-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.ad-card-author .author-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ad-card-author .author-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ad-card-author .author-name {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.9rem;
}

.ad-card-author .author-name-link {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.ad-card-author .author-name-link:hover {
  color: #0b5ed7;
  text-decoration: underline;
  transform: scale(1.02);
}

.ad-card-author .author-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid;
}

.ad-card-author .store-badge {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.1));
  color: #28a745;
  border-color: rgba(40, 167, 69, 0.3);
}

.ad-card-author .store-badge:hover {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.2), rgba(32, 201, 151, 0.2));
  transform: scale(1.05);
  text-decoration: none;
  color: #28a745;
}

.ad-card-author .premium-badge {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 152, 0, 0.1));
  color: #ffc107;
  border-color: rgba(255, 193, 7, 0.3);
}

.ad-card-author .premium-badge:hover {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 152, 0, 0.2));
  transform: scale(1.05);
}

.ad-card-views {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.ad-card-views::before {
  content: '👁️';
  font-size: 0.8rem;
  margin-right: 0.25rem;
}

.ad-card-date {
  color: var(--text-muted);
  /* font-style: italic; */
  font-size: 0.85rem;
}

.ad-card-date::before {
  content: '📅';
  font-size: 0.8rem;
  margin-right: 0.25rem;
}

.ad-card-tags {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-start;
}

.ad-card-tags .badge {
  background: var(--border-color) !important;
  color: var(--text-color) !important;
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.ad-card-tags .badge:hover {
  background: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color);
  transform: scale(1.05);
}

/* View more tags button */
.ad-card-tags .badge-view-more {
  background: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
}

.ad-card-tags .badge-view-more:hover {
  background: #0b5ed7 !important;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.ad-card-tags .badge-view-more:active {
  transform: scale(0.95);
}

/* Hidden tags */
.ad-card-tags .badge.hidden {
  display: none;
}

/* Hidden tags animation when shown */
.ad-card-tags .badge.show-hidden {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}



/* --- Gallery Modal Styles --- */
.gallery-modal {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-modal-content {
  width: 95vw;
  max-width: 900px;
  height: 90vh;
  background: transparent;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-modal .swiper {
  height: 100%;
}
.gallery-modal .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery-modal .swiper-zoom-container img {
  max-height: 80vh;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}
.gallery-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #fff;
  font-size: 24px;
  line-height: 38px;
  background: none;
  border: none;
  z-index: 10;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
  width: 38px;
  height: 38px;
  text-align: center;
}
.gallery-modal-close:hover {
  background: rgba(255,255,255,0.1);
}

@media (max-width: 600px) {
  .gallery-modal-content {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
  }
  .gallery-modal .swiper-zoom-container img {
    max-height: 60vh;
  }
}

/* --- Mobile Responsive Enhancements --- */
@media (max-width: 600px) {
  .ad-detail-panel {
    padding: 0;
  }
  
  .ad-card-header {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .ad-card-header-left {
    flex: 1;
    min-width: 0;
  }
  
  .ad-card-title {
    font-size: 1.1rem;
  }
  
  .ad-card-price {
    font-size: 1.2rem;
  }

  .ad-card-share-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
  
  .ad-card-thumbnail {
    width: 35px;
    height: 35px;
    flex-shrink: 0; /* Ensure thumbs don't shrink and allow horizontal scroll */
  }
  
  /* Ensure mobile inline thumbnails container allows horizontal scroll */
  .ad-card-thumbnails-inline {
    max-width: calc(100% - 16px);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  .ad-card-lead {
    font-size: 0.85rem;
    padding: 0.5rem;
  }
  
  .ad-card-body-text {
    font-size: 0.8rem;
  }
  
  .ad-card-meta {
    font-size: 0.8rem;
    gap: 0.75rem;
  }
  
  .ad-card-author {
    gap: 0.5rem;
  }
  
  .ad-card-author .author-avatar {
    width: 20px;
    height: 20px;
  }
  
  .ad-card-author .author-name {
    font-size: 0.8rem;
  }
  
  .ad-card-author .author-label {
    font-size: 0.7rem;
  }
  
  .ad-card-author .author-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }
  
  .ad-card-keypoints {
    padding: 0.75rem;
  }
  
  .ad-card-keypoints h5 {
    font-size: 0.9rem;
  }
  
  .ad-card-keypoints-content {
    font-size: 0.8rem;
  }
  
  .floating-contact-info {
    gap: 0.5rem;
  }
  
  .floating-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .contact-label {
    font-size: 0.75rem;
  }
  
  .floating-btn i {
    font-size: 0.9rem;
  }

  .show-more-btn {
    font-size: 0.85rem !important;
  }

  .ad-card-body {
    padding: 1rem;
  }

  .ad-card-holder {
    padding: 4px;
  }
}

/* --- Panel Mobile Responsive Styles --- */
@media (max-width: 500px) {
  .ad-detail-panel-header {
    padding: 0.6rem 1rem 0.3rem 1rem;
  }
  .ad-detail-panel-header h5 {
    font-size: 1.15rem;
  }

  .author-badge span {
    display: none;
  }
} 

/* --- Desktop Gallery Enhancements --- */
@media (min-width: 992px) {
  /* Ensure bottom strip is a new row (not another column) */
  .ad-card-gallery {
    display: block;
    height: auto;
    min-height: 0;
  }

  /* Desktop: new two-column top area with max 300px height */
  .ad-card-swiper {
    display: none !important; /* hide mobile swiper on desktop */
  }
  .ad-gallery-two-col {
    display: flex;
    gap: 12px;
    height: 300px;
    max-height: 300px;
    align-items: stretch;
  }
  .ad-gallery-main {
    width: 500px;
    height: 100%;
    background: var(--bg-color);
    overflow: hidden;
    border-radius: 12px;
    position: relative;
  }
  .ad-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .ad-gallery-side-grid {
    flex: 1;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 12px;
    min-width: 0;
  }
  .ad-gallery-side-grid-inner {
    display: contents; /* children fill grid cells */
  }
  .ad-gallery-side-grid .ad-card-thumbnail {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.5);
    overflow: hidden;
    flex-shrink: 1;
    cursor: pointer;
  }
  .ad-gallery-side-grid .ad-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
  }
  .ad-gallery-bottom-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-top: 10px;
    margin-top: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  .ad-gallery-bottom-strip .ad-card-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex: 0 0 auto;
    border: 2px solid rgba(255,255,255,0.5);
    margin-bottom: 6px;
  }
  .ad-gallery-bottom-strip .ad-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  /* Disable hover zoom on side-grid and bottom-strip thumbnails */
  .ad-gallery-side-grid .ad-card-thumbnail:hover,
  .ad-gallery-bottom-strip .ad-card-thumbnail:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.5);
  }

  /* Hide mobile inline thumbnails; show desktop sets */
  .ad-card-thumbnails-inline {
    display: none !important;
  }
}

/* Hide new desktop-only blocks on small screens */
@media (max-width: 991.98px) {
  .ad-gallery-two-col,
  .ad-gallery-bottom-strip {
    display: none !important;
  }
  .ad-card-image-count-desktop {
    display: none !important;
  }
}
/* --- End Message Styles --- */
.ad-card-end-message {
  padding: 2rem 1rem;
  text-align: center;
  background: var(--bg-color);
  border-radius: 12px;
  margin: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.end-message-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.end-message-content i {
  font-size: 3rem;
  color: var(--success-color, #28a745);
}

.end-message-content p {
  font-size: 1.1rem;
  color: var(--text-color);
  margin: 0;
  font-weight: 500;
}

.end-message-content .btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.end-message-content .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Permalink Gallery Styles */
.permalink-gallery {
  margin-bottom: 1.5rem;
}

.permalink-gallery .ad-card-gallery {
  position: relative;
  margin: 0;
  padding: 0;
}

.permalink-gallery .ad-card-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.permalink-gallery .ad-card-zoom:hover {
  background: rgba(0, 0, 0, 0.9);
}

.permalink-gallery .ad-card-image-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 15;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.permalink-gallery .ad-card-image-count-desktop {
  display: none;
}

@media (min-width: 768px) {
  .permalink-gallery .ad-card-image-count {
    display: none;
  }

  .permalink-gallery .ad-card-image-count-desktop {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 12px !important;
    right: 60px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    z-index: 5 !important;
    width: auto !important;
    height: auto !important;
    max-width: 120px !important;
    max-height: 24px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Ensure permalink gallery desktop thumbs match article panel style */
  .permalink-gallery .ad-gallery-side-grid .ad-card-thumbnail {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.5);
    overflow: hidden;
    flex-shrink: 1;
    cursor: pointer;
  }
  .permalink-gallery .ad-gallery-side-grid .ad-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
  }
  .permalink-gallery .ad-gallery-bottom-strip .ad-card-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex: 0 0 auto;
    border: 2px solid rgba(255,255,255,0.5);
    margin-bottom: 6px;
  }
  .permalink-gallery .ad-gallery-bottom-strip .ad-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  /* Disable hover zoom on side-grid and bottom-strip thumbnails in permalink */
  .permalink-gallery .ad-gallery-side-grid .ad-card-thumbnail:hover,
  .permalink-gallery .ad-gallery-bottom-strip .ad-card-thumbnail:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.5);
  }
}

/* Mobile styles for permalink gallery - ensure horizontal scroll works */
@media (max-width: 767.98px) {
  .permalink-gallery .ad-card-thumbnails-inline {
    max-width: calc(100% - 16px);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  
  .permalink-gallery .ad-card-thumbnail {
    flex-shrink: 0; /* Ensure thumbs don't shrink and allow horizontal scroll */
  }
} 