/* ============================================
   DIRECTORY CYPRUS — UNIFIED CSS
   Replace your entire Additional CSS with this.
   Last updated: March 2026
   ============================================ */


/* ============================================
   A. GLOBAL UTILITIES
   ============================================ */

html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(0, 115, 230, 0.15);
  color: #1a202c;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #0073e6;
  outline-offset: 2px;
  border-radius: 4px;
}

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


/* ============================================
   B. STICKY HEADER
   Only target the site header nav bar, not .hp-page__header
   which also contains the search form on category pages.
   ============================================ */

header.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.admin-bar header.site-header {
  top: 32px;
}


/* ============================================
   C. NAVIGATION
   ============================================ */

.hp-menu .menu-item > a {
  transition: color 0.2s ease;
}

.hp-menu .menu-item > a:hover {
  color: #0073e6;
}

.hp-menu .menu-item.current-menu-item > a,
.hp-menu .menu-item.current_page_item > a {
  color: #0073e6;
  font-weight: 600;
  position: relative;
}

.hp-menu .menu-item.current-menu-item > a::after,
.hp-menu .menu-item.current_page_item > a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #0073e6;
  border-radius: 1px;
}

/* "Add Listing" button */
.hp-menu__item--submit a,
.hp-menu .hp-menu__item--listing-submit a {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hp-menu__item--submit a:hover,
.hp-menu .hp-menu__item--listing-submit a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 115, 230, 0.3);
}

/* Hide "Add Listing" for logged-out users */
body:not(.logged-in) .hp-menu--site-header .hp-menu__item--listing-submit {
  display: none;
}


/* ============================================
   D. HERO / SEARCH BAR
   ============================================ */

.hp-page__title + .hp-form--search,
.hp-hero .hp-form--search {
  margin-top: 10px;
}

/* Fix search bar overlap on category pages */
.site-container {
  overflow: visible !important;
}

/* Compact hero and fix search bar visibility */
.header-hero.header-hero--cover {
  padding-top: 60px !important;
  padding-bottom: 60px !important;
}

/* Remove negative margin that hides search behind hero overlay */
.hp-form--listing-search {
  margin-top: 0 !important;
}

/* Ensure category cover image overrides the parent theme gradient */
.header-hero.header-hero--cover {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

body.home .hp-page__content > .elementor-section:first-child,
body.home .hp-hero {
  background: linear-gradient(135deg, #f8fafe 0%, #f0f4f8 100%);
  padding-bottom: 40px;
}

.hp-form--search {
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}

.hp-form--search .hp-form__fields {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.hp-form--search .hp-form__fields:focus-within {
  box-shadow: 0 4px 24px rgba(0, 115, 230, 0.15);
  border-color: #0073e6;
}

.hp-form--search .hp-form__button {
  min-width: 120px;
  font-weight: 600;
  letter-spacing: 0.3px;
}


/* ============================================
   E. HOMEPAGE — LISTING CARDS GRID
   ============================================ */

body.home .hp-listing-category--view-block {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

body.home .hp-listing-category--view-block > * {
  height: 100%;
}

/* Card container */
body.home .hp-listing__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

body.home .hp-listing__content:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

/* Card image — fixed height, clipped */
body.home .hp-listing__image {
  height: 200px;
  overflow: hidden;
  border-radius: 10px;
  flex-shrink: 0;
}

body.home .hp-listing__image img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

body.home .hp-listing__image:hover img {
  transform: scale(1.05);
}

/* Better look for cards with no image */
body.home .hp-listing__image:has(img[src*="placeholder"]),
body.home .hp-listing__image:has(.hp-listing__image-placeholder) {
  background: linear-gradient(135deg, #e8ecf1 0%, #d1d8e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Title */
body.home .hp-listing__title {
  margin-top: 16px;
  flex-grow: 1;
}

body.home .hp-listing__title a {
  font-size: 1.3rem;
  font-weight: 600;
  color: #222;
  text-decoration: none;
  display: inline-block;
}

/* "View Details" pseudo-button */
body.home .hp-listing__title a::after {
  content: "View Details";
  display: block;
  margin-top: 12px;
  background-color: #0073e6;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
  width: 100%;
}

body.home .hp-listing__title a:hover::after {
  background-color: #005bb5;
}

/* "NEW" ribbon (hidden by default — set display:block to show) */
body.home .hp-listing__title::before {
  content: "NEW";
  background: #ff4757;
  color: white;
  padding: 3px 7px;
  font-size: 0.7rem;
  border-radius: 4px;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  display: none;
}

/* Price */
body.home .hp-listing__attribute--price {
  font-size: 1.2rem;
  font-weight: bold;
  color: #28a745;
  margin-top: 10px;
  margin-bottom: 10px;
  display: block;
}

/* Category badge on card */
body.home .hp-listing__categories a {
  display: inline-block;
  background-color: #eef5ff;
  color: #0073e6;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 10px;
}

body.home .hp-listing__categories a:hover {
  background-color: #0073e6;
  color: #fff;
}

/* Verified badge */
.hp-listing__verified-badge,
.hp-listing__actions .fas.fa-check-circle {
  color: #0073e6;
  font-size: 1rem;
}

/* Featured listing highlight */
body.home .hp-listing__featured {
  background: linear-gradient(135deg, #e0f0ff, #f8fcff);
  box-shadow: 0 0 10px rgba(0, 115, 230, 0.15);
  border-radius: 10px;
  padding: 5px;
}

body.home .hp-listing__featured .hp-listing__content {
  border-left: 3px solid #0073e6;
}

/* Center grid when only one featured listing */
body.home .hp-listing-category--view-block:has(.hp-listing__featured:only-child) {
  justify-content: center;
}

/* Hide extra fields on homepage cards */
body.home .hp-listing__attribute:not(.hp-listing__attribute--price),
body.home .hp-listing__attribute--phone,
body.home .hp-listing__attribute--condition,
body.home .hp-listing__attribute--shipping,
body.home .hp-listing__attribute--email,
body.home .hp-listing__attributes--ternary,
body.home .hp-listing__location,
body.home .hp-listing__created-date,
body.home .hp-listing__details--primary {
  display: none !important;
}


/* ============================================
   F. HOMEPAGE — CATEGORY GRID CARDS
   (For Sale, For Rent, Services, Dining, etc.)
   ============================================ */

/* Hide verbose category descriptions */
.hp-listing-category--view-block .hp-listing-category__description,
.hp-listing-category__description {
  position: absolute !important;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

/* Card shell — image-behind-text overlay style */
body.home .hp-listing-category {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #f2f2f2;
  border-radius: 12px;
  overflow: hidden;
  height: 250px;
  position: relative;
  text-align: center;
}

/* Full-bleed background image */
body.home .hp-listing-category__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

body.home .hp-listing-category__image img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  display: block;
  filter: brightness(0.6);
}

/* Nicer gradient for cards with missing images */
body.home .hp-listing-category__image:has(img[src*="placeholder"]) {
  background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
}

body.home .hp-listing-category__image img[src*="placeholder"] {
  opacity: 0.3;
}

/* Category name overlay — centered on the image */
body.home .hp-listing-category__content {
  position: relative;
  z-index: 2;
  padding: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

body.home .hp-listing-category__name {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}

body.home .hp-listing-category__name a {
  color: white;
  text-decoration: none;
  display: inline-block;
}

body.home .hp-listing-category__details--primary:empty {
  display: none;
}


/* ============================================
   G. SECTION SEPARATION
   ============================================ */

.elementor-widget-heading .elementor-heading-title,
body.home h2 {
  position: relative;
  padding-bottom: 12px;
}

body.home .elementor-section + .elementor-section {
  border-top: 1px solid #f0f0f0;
  padding-top: 40px;
  margin-top: 20px;
}


/* ============================================
   H. LISTING DETAIL PAGE (single listing view)
   ============================================ */

.hp-listing__header {
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
}

.single-hp_listing h1.hp-listing__title {
  font-size: 2rem;
  font-weight: 700;
  color: #1a202c;
  line-height: 1.3;
}

.single-hp_listing .hp-listing__category a {
  background: #eef5ff;
  color: #0073e6;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 8px;
}

.single-hp_listing .hp-listing__location {
  color: #718096;
  font-size: 0.95rem;
}

.single-hp_listing .hp-listing__created-date {
  color: #a0aec0;
  font-size: 0.85rem;
}

.hp-listing__action--reply {
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hp-listing__action--reply:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.single-hp_listing .hp-listing__attributes--secondary,
.single-hp_listing .hp-page__sidebar .widget {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.single-hp_listing .hp-listing__map {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

/* Body text readability */
.hp-listing__description,
.hp-listing__content p,
.elementor-widget-text-editor p {
  line-height: 1.7;
  color: #4a5568;
}


/* ============================================
   I. BLOG CARDS ON HOMEPAGE
   ============================================ */

body.home .elementor-post {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.home .elementor-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body.home .elementor-post__title a {
  color: #1a202c;
  text-decoration: none;
  font-weight: 600;
}

body.home .elementor-post__title a:hover {
  color: #0073e6;
}

body.home .elementor-post__read-more {
  color: #0073e6;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}


/* ============================================
   J. FOOTER — Light/clean style matching site
   ============================================ */

footer.site-footer,
.hp-page__footer {
  background: #f7f8fa;
  color: #4a5568;
  padding: 50px 0 30px;
  border-top: 1px solid #e2e8f0;
}

footer.site-footer a,
.hp-page__footer a {
  color: #2d3748;
  transition: color 0.2s ease;
}

footer.site-footer a:hover,
.hp-page__footer a:hover {
  color: #0073e6;
}

footer .widget-title,
footer h3,
footer h4 {
  color: #1a202c;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 16px;
}

footer .site-info,
.hp-page__footer .site-info {
  border-top: 1px solid #e2e8f0;
  padding-top: 20px;
  margin-top: 30px;
  font-size: 0.85rem;
  text-align: center;
  color: #718096;
}


/* ============================================
   K. MOBILE & RESPONSIVE
   ============================================ */

@media (max-width: 782px) {
  .admin-bar .hp-page__header,
  .admin-bar header.site-header {
    top: 46px;
  }
}

@media (max-width: 768px) {
  /* Listing grid */
  body.home .hp-listing-category--view-block {
    gap: 16px;
  }

  /* View Details button */
  body.home .hp-listing__title a::after {
    font-size: 1rem;
    padding: 12px;
  }

  /* Price */
  body.home .hp-listing__attribute--price {
    font-size: 1.1rem;
  }

  /* Category cards stack on mobile */
  body.home .hp-listing-category {
    height: 200px;
  }

  /* Section spacing */
  body.home .elementor-section + .elementor-section {
    padding-top: 24px;
    margin-top: 12px;
  }

  /* Search bar */
  .hp-form--search {
    padding: 0 16px;
  }

  .hp-form--search .hp-form__fields {
    flex-direction: column;
    border-radius: 12px;
  }

  /* Listing detail page */
  .single-hp_listing h1.hp-listing__title {
    font-size: 1.5rem;
  }

  .single-hp_listing .hp-page__sidebar {
    margin-top: 24px;
  }

  body {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}

@media (max-width: 480px) {
  body.home .hp-listing-category--view-block {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}


/* ============================================
   L. BREADCRUMBS
   ============================================ */

/* Breadcrumb wrapper */
.dc-breadcrumbs-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.dc-breadcrumbs {
  padding: 12px 0;
  margin-bottom: 0;
  font-size: 0.85rem;
}

.dc-breadcrumbs__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.dc-breadcrumbs__item {
  display: inline-flex;
  align-items: center;
}

.dc-breadcrumbs__item a {
  color: #0073e6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.dc-breadcrumbs__item a:hover {
  color: #005bb5;
  text-decoration: underline;
}

.dc-breadcrumbs__sep {
  margin: 0 6px;
  color: #a0aec0;
}

.dc-breadcrumbs__current {
  color: #4a5568;
  font-weight: 500;
}


/* ============================================
   M. BACK TO TOP BUTTON
   ============================================ */

.dc-back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0073e6;
  color: #fff;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 998;
  box-shadow: 0 4px 12px rgba(0, 115, 230, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dc-back-to-top--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dc-back-to-top:hover {
  background: #005bb5;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 115, 230, 0.4);
}


/* ============================================
   N. LIVE SEARCH DROPDOWN
   ============================================ */

.dc-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.dc-search-dropdown--active {
  max-height: 400px;
  overflow-y: auto;
  opacity: 1;
}

.dc-search-dropdown__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: #1a202c;
  transition: background 0.15s ease;
  border-bottom: 1px solid #f0f0f0;
}

.dc-search-dropdown__item:last-child {
  border-bottom: none;
}

.dc-search-dropdown__item:hover {
  background: #f7f8fa;
}

.dc-search-dropdown__img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.dc-search-dropdown__img--placeholder {
  background: #e2e8f0;
}

.dc-search-dropdown__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dc-search-dropdown__title {
  font-weight: 600;
  font-size: 0.95rem;
}

.dc-search-dropdown__cat {
  font-size: 0.8rem;
  color: #0073e6;
}

.dc-search-dropdown__empty {
  padding: 16px;
  text-align: center;
  color: #718096;
  font-size: 0.9rem;
}


/* ============================================
   O. SCROLL ANIMATIONS
   ============================================ */

.dc-fade-in--initial {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.dc-fade-in {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================
   P. HEADER SHRINK ON SCROLL
   ============================================ */

.dc-header--scrolled {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.dc-header--scrolled .hp-menu .menu-item > a {
  padding-top: 8px;
  padding-bottom: 8px;
}


/* ============================================
   Q. IMAGE LIGHTBOX
   ============================================ */

.dc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dc-lightbox--active {
  opacity: 1;
}

.dc-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.dc-lightbox__img {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.dc-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dc-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.4);
}


/* ============================================
   R. SHARE BUTTONS (listing detail page)
   ============================================ */

.dc-share {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  padding: 12px 0;
  border-top: 1px solid #e2e8f0;
}

.dc-share__label {
  font-size: 0.85rem;
  color: #718096;
  font-weight: 500;
}

.dc-share__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dc-share__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dc-share__link--fb { background: #1877f2; }
.dc-share__link--tw { background: #000; }
.dc-share__link--li { background: #0a66c2; }
.dc-share__link--wa { background: #25d366; }


/* ============================================
   S. LOAD MORE BUTTON
   ============================================ */

.dc-load-more {
  display: block;
  margin: 30px auto;
  padding: 14px 40px;
  background: #0073e6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.dc-load-more:hover {
  background: #005bb5;
  transform: translateY(-1px);
}

.dc-load-more:disabled {
  background: #a0aec0;
  cursor: not-allowed;
  transform: none;
}
