/**
 * ============================================================
 * AD DETAILS PAGE - Mobile App Style Design
 * ============================================================
 */

.p-ad {
  padding-bottom: var(--space-48);
}

/* ========== LAYOUT ========== */
.p-ad__layout {
  max-width: 700px;
  margin: 0 auto;
}

.p-ad__main {
  min-width: 0;
}

/* ========== HERO IMAGE ========== */
.p-ad__hero {
  position: relative;
  height: 400px;
  background: var(--c-bg);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-top: var(--space-20);
  margin-bottom: 0;
}

.p-ad__hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Overlay: Category + Location at bottom of image */
.p-ad__hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-16) var(--space-20);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: var(--space-8);
}

.p-ad__hero-category {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.p-ad__hero-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.9);
}

.p-ad__hero-location svg {
  flex-shrink: 0;
}

/* Share button on hero */
.p-ad__hero-share {
  position: absolute;
  top: var(--space-16);
  left: var(--space-16);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.p-ad__hero-share:hover {
  background: #fff;
  transform: scale(1.1);
}

.p-ad__hero-share svg {
  color: var(--c-text);
}

/* Gallery Placeholder — matches card listing style */
.p-ad__gallery-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #f5f7f9 0%, #e8ecef 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
}

.p-ad__gallery-placeholder-logo {
  width: 120px;
  height: auto;
  max-height: 90px;
  object-fit: contain;
  opacity: 0.55;
}

.p-ad__gallery-placeholder-text {
  font-size: var(--font-size-md);
  color: #8b95a5;
  font-weight: var(--font-weight-medium);
}

/* Gallery Dots */
.p-ad__gallery-dots {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-8);
  z-index: 5;
}

.p-ad__gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all var(--transition-base);
}

.p-ad__gallery-dot--active {
  background: var(--c-bg-white);
  width: 24px;
}

/* Gallery Nav */
.p-ad__gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
  border: none;
  z-index: 5;
}

.p-ad__gallery-nav:hover {
  background: var(--c-bg-white);
}

.p-ad__gallery-nav--prev {
  right: var(--space-12);
}

.p-ad__gallery-nav--next {
  left: var(--space-12);
}

.p-ad__gallery-nav-icon {
  width: 18px;
  height: 18px;
  color: var(--c-text);
}

/* ========== STATS BAR ========== */
.p-ad__stats-bar {
  display: flex;
  background: var(--c-primary-dark);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: var(--space-14) var(--space-24);
  margin-bottom: var(--space-24);
  gap: var(--space-4);
}

.p-ad__stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.p-ad__stat-label {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.7);
  font-weight: var(--font-weight-medium);
}

.p-ad__stat-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: #fff;
}

.p-ad__stat-value svg {
  color: rgba(255, 255, 255, 0.8);
}

/* ========== SECTIONS ========== */
.p-ad__section {
  margin-bottom: var(--space-28);
}

.p-ad__section-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--c-primary-dark);
  margin-bottom: var(--space-16);
  text-align: right;
}

.p-ad__description {
  font-size: 18px;
  color: #000;
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-relaxed);
  white-space: pre-line;
  text-align: right;
}

.p-ad__description,
.p-ad__section-title {
  word-wrap: break-word;
}

/* ========== FEATURES ========== */
.p-ad__features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-12);
}

.p-ad__feature {
  display: flex;
  align-items: center;
  gap: var(--space-10);
  padding: var(--space-12) var(--space-16);
  background: var(--c-bg);
  border-radius: var(--radius-md);
}

.p-ad__feature-icon {
  width: 20px;
  height: 20px;
  color: var(--c-primary);
}

.p-ad__feature-text {
  font-size: var(--font-size-sm);
  color: var(--c-text);
}

/* ========== GALLERY THUMBNAILS ========== */
.p-ad__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-10);
}

.p-ad__thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-base);
}

.p-ad__thumb:hover {
  transform: scale(1.03);
}

.p-ad__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-ad__thumb--more::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.p-ad__thumb-count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: #fff;
  z-index: 2;
}

/* ========== CONTACT BUTTONS ========== */
.p-ad__contact-section {
  display: flex;
  gap: var(--space-12);
  margin-bottom: var(--space-28);
  position: sticky;
  bottom: 0;
  z-index: 100;
  background: var(--c-bg-white);
  padding: var(--space-12) var(--space-16);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  border-radius: 16px;
}

.p-ad__contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-10);
  padding: var(--space-14) var(--space-20);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  transition: all var(--transition-base);
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.p-ad__contact-btn--whatsapp {
  background: #25d366;
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  padding: 0;
  flex-shrink: 0;
}

.p-ad__contact-btn--whatsapp:hover {
  background: #1da851;
  transform: scale(1.05);
}

.p-ad__contact-btn--call {
  flex: 1;
  background: var(--c-bg);
  color: var(--c-text);
  border: 1.5px solid var(--c-border);
  height: 56px;
  font-size: var(--font-size-lg);
  direction: ltr;
}

.p-ad__contact-btn--call:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

/* ========== PARTNER INFO ========== */
.p-ad__partner {
  background: var(--c-primary-dark);
  border-radius: var(--radius-xl);
  padding: var(--space-20) var(--space-24);
  margin-bottom: var(--space-32);
  color: #fff;
}

.p-ad__partner-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-12);
  text-align: right;
}

.p-ad__partner-card {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  flex-direction: row-reverse;
}

.p-ad__partner-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.p-ad__partner-avatar svg {
  color: rgba(255, 255, 255, 0.7);
}

.p-ad__partner-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-ad__partner-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
  flex: 1;
}

.p-ad__partner-name {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: #fff;
}

.p-ad__partner-office {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.7);
}

.p-ad__partner-date {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.5);
}

/* ========== RELATED POSTS ========== */
.p-ad__related {
  margin-top: var(--space-32);
  margin-bottom: var(--space-32);
}

.p-ad__related-carousel {
  position: relative;
  margin-top: var(--space-16);
}

.p-ad__related-track {
  display: flex;
  gap: var(--space-16);
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: var(--space-8) 0;
}

.p-ad__related-track::-webkit-scrollbar {
  display: none;
}

.p-ad__related-item {
  flex: 0 0 260px;
  min-width: 260px;
}

.p-ad__related-item .c-card {
  height: 100%;
}

.p-ad__related-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--c-bg-white);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  z-index: 10;
}

.p-ad__related-nav:hover {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: white;
}

.p-ad__related-nav svg {
  width: 18px;
  height: 18px;
}

.p-ad__related-nav--prev {
  right: -20px;
}

.p-ad__related-nav--next {
  left: -20px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .p-ad__hero {
    height: 300px;
    border-radius: var(--radius-lg);
  }

  .p-ad__stats-bar {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: var(--space-12) var(--space-16);
  }

  .p-ad__stat-value {
    font-size: 17px;
  }

  .p-ad__thumbs {
    grid-template-columns: repeat(3, 1fr);
  }

  .p-ad__gallery-nav {
    width: 34px;
    height: 34px;
  }

  .p-ad__features {
    grid-template-columns: 1fr;
  }

  .p-ad__related-item {
    flex: 0 0 220px;
    min-width: 220px;
  }

  .p-ad__related-nav {
    display: none;
  }
}

@media (max-width: 480px) {
  .p-ad__hero {
    height: 260px;
  }

  .p-ad__hero-category {
    font-size: var(--font-size-lg);
  }

  .p-ad__stats-bar {
    flex-direction: row;
    padding: var(--space-10) var(--space-12);
    gap: var(--space-4);
  }

  .p-ad__stat-value {
    font-size: 17px;
  }

  .p-ad__stat-label {
    font-size: 14px;
  }

  .p-ad__gallery-nav {
    display: none;
  }

  .p-ad__contact-btn--call {
    font-size: var(--font-size-md);
  }
}

/* Fixed mobile contact bar */
@media (max-width: 640px) {
  .p-ad {
    padding-bottom: 90px !important;
  }

  .p-ad__contact-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--c-bg-white);
    padding: var(--space-12) var(--space-16);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-bottom: 0;
  }
}