/**
 * HappyPreggie — Reusable UI Cards, Carousels, Concierge Banner & Global Modals
 * Reference: planning/03-visual-design-and-ui-system.md (Section 6)
 */

/* 6.1 Provider Directory Card (.cards2 / .listing-card) */
.cards2 {
  background: var(--hp-bg-white);
  border: 1px solid var(--hp-border-light);
  border-radius: var(--hp-radius-md);
  box-shadow: var(--hp-shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.cards2:hover {
  transform: translateY(-4px);
  box-shadow: var(--hp-shadow-hover);
  border-color: var(--hp-purple-soft);
}

.cards2 .card-image-box {
  position: relative;
  height: 195px;
  overflow: hidden;
  background-color: var(--hp-bg-muted);
  flex-shrink: 0;
}

.cards2 .card-image-box > a {
  display: block;
  width: 100%;
  height: 100%;
}

.cards2 .card-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.cards2:hover .card-image-box img {
  transform: scale(1.04);
}

.cards2 .add_mylove {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--hp-text-muted);
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 2;
  transition: transform 0.18s ease, color 0.18s ease;
}

.cards2 .add_mylove:hover {
  transform: scale(1.1);
}

.cards2 .add_mylove.is-favorited,
.cards2 .add_mylove.active {
  color: var(--hp-heart-red);
}

.cards2 .card-badges-overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.hp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--hp-radius-pill);
  line-height: 1.2;
}

.hp-badge-verified {
  background-color: var(--hp-teal-accent);
  color: #ffffff;
}

.hp-badge-hpcover {
  background-color: var(--hp-pink-pastel);
  color: var(--hp-purple-dark);
}

.hp-badge-muslim {
  background-color: #e6f4ea;
  color: #137333;
}

.hp-badge-purple {
  background-color: var(--hp-purple-tint);
  color: var(--hp-purple-primary);
}

.cards2 .card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cards2 .card-category-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--hp-purple-muted);
  margin-bottom: 4px;
}

.cards2 .card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--hp-text-primary);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cards2 .card-title a {
  color: inherit;
}

.cards2 .card-title a:hover {
  color: var(--hp-purple-primary);
}

.cards2 .card-location {
  font-size: 13px;
  color: var(--hp-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.cards2 .card-location i {
  color: var(--hp-purple-secondary);
}

.cards2 .card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--hp-border-light);
}

.hp-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 800;
  color: var(--hp-text-primary);
}

.hp-rating-pill i {
  color: var(--hp-star-gold);
}

.hp-rating-pill span.count {
  font-weight: 600;
  color: var(--hp-text-muted);
  font-size: 12px;
}

.cards2 .card-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--hp-purple-primary);
}

.cards2 .card-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

/* 6.2 Great Deal / Voucher Card (.mainparent2-deal-box / .deal-card) */
.mainparent2-deal-box {
  background: #ffffff;
  border: 1px solid var(--hp-border-light);
  border-radius: var(--hp-radius-md);
  box-shadow: var(--hp-shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mainparent2-deal-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--hp-shadow-hover);
}

.deal-card-banner {
  position: relative;
  height: 170px;
  overflow: hidden;
  flex-shrink: 0;
}

.deal-card-banner > a {
  display: block;
  width: 100%;
  height: 100%;
}

.deal-card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deal-voucher-ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: var(--hp-purple-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--hp-radius-pill);
}

.deal-discount-tag {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: var(--hp-warning-amber);
  color: #222222;
  font-weight: 900;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: var(--hp-radius-sm);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.deal-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.deal-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--hp-text-primary);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-card-provider {
  font-size: 13px;
  font-weight: 700;
  color: var(--hp-purple-muted);
  margin-bottom: 4px;
}

.deal-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--hp-border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* 6.3 Specialist Service / Companion Card (.cards3 / .service-widget-card) */
.cards3 {
  background: #ffffff;
  border: 1px solid var(--hp-border-light);
  border-radius: var(--hp-radius-md);
  box-shadow: var(--hp-shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cards3:hover {
  transform: translateY(-3px);
  box-shadow: var(--hp-shadow-hover);
}

.cards3-image {
  position: relative;
  height: 155px;
  overflow: hidden;
  flex-shrink: 0;
}

.cards3-image > a {
  display: block;
  width: 100%;
  height: 100%;
}

.cards3-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cards3-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--hp-purple-primary);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--hp-radius-pill);
}

.cards3-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cards3-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--hp-text-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cards3-price {
  font-size: 15px;
  font-weight: 900;
  color: var(--hp-teal-accent);
  margin-top: auto;
  margin-bottom: 10px;
}

/* 6.4 Category Tile (.service-t) */
.service-t {
  background: #ffffff;
  border: 1px solid var(--hp-border-light);
  border-radius: var(--hp-radius-md);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  box-shadow: var(--hp-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.service-t:hover {
  transform: translateY(-3px);
  box-shadow: var(--hp-shadow-hover);
  border-color: var(--hp-purple-primary);
}

.service-t-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.service-t-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--hp-text-primary);
  line-height: 1.3;
}

.service-t-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--hp-text-muted);
}

/* WhatsApp Concierge Recommendation Banner (#recommendation_form) */
.hp-concierge-box {
  background: linear-gradient(135deg, #330066 0%, #612e95 60%, #8157aa 100%);
  border-radius: var(--hp-radius-lg);
  padding: 32px;
  color: #ffffff;
  box-shadow: var(--hp-shadow-card);
}

.hp-concierge-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 28px;
  align-items: center;
}

@media (max-width: 991px) {
  .hp-concierge-grid {
    grid-template-columns: 1fr;
  }
}

.hp-concierge-box h3 {
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}

.hp-concierge-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  padding: 12px;
  border-radius: var(--hp-radius-md);
}

@media (max-width: 767px) {
  .hp-concierge-form-row {
    grid-template-columns: 1fr;
  }
}

/* Global Modals (<dialog> & Overlay Modals) */
.hp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 11, 40, 0.62);
  backdrop-filter: blur(3px);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.hp-modal-backdrop.is-open,
.hp-modal-backdrop.open {
  display: flex;
}

/* Swiper & Carousel Containment Inside CSS Grid Columns */
.swiper,
.hp-card-swiper,
.hp-service-widget-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

/* Shared Search Field & Autocomplete Styles (Used across Home, Directory & All Categories) */
.hp-search-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 12px;
  min-width: 0;
}

.hp-search-field + .hp-search-field {
  border-left: 1px solid var(--hp-border-light);
  padding-left: 16px;
}

@media (max-width: 767px) {
  .hp-search-field + .hp-search-field {
    border-left: none;
    border-top: 1px solid var(--hp-border-light);
    padding-left: 0;
    padding-top: 10px;
  }
}

.hp-search-field i {
  color: var(--hp-purple-primary);
  font-size: 16px;
  flex-shrink: 0;
}

.hp-search-field-inputs {
  flex: 1;
  min-width: 0;
}

.hp-search-field-inputs label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--hp-purple-muted);
  margin-bottom: 1px;
}

.hp-search-field-inputs input {
  width: 100%;
  border: none;
  padding: 2px 0;
  font-family: var(--hp-font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--hp-text-primary);
  background: transparent;
}

.hp-search-field-inputs input:focus {
  outline: none;
}

.hp-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--hp-border-light);
  border-radius: var(--hp-radius-md);
  box-shadow: var(--hp-shadow-modal);
  z-index: 1020;
  max-height: 320px;
  overflow-y: auto;
  display: none;
  padding: 8px;
}

.hp-autocomplete-dropdown.is-open,
.hp-autocomplete-dropdown.open {
  display: block;
}

.hp-autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--hp-radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--hp-text-primary);
  cursor: pointer;
}

.hp-autocomplete-item:hover {
  background-color: var(--hp-purple-tint);
  color: var(--hp-purple-primary);
}

.hp-autocomplete-item .badge-type {
  font-size: 11px;
  font-weight: 700;
  color: var(--hp-purple-primary);
  background: var(--hp-purple-tint);
  padding: 2px 8px;
  border-radius: var(--hp-radius-pill);
  white-space: nowrap;
}

.hp-modal-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 560px;
  border-radius: var(--hp-radius-lg);
  box-shadow: var(--hp-shadow-modal);
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.hp-modal-header {
  padding: 18px 24px;
  background: var(--hp-purple-tint);
  border-bottom: 1px solid var(--hp-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hp-modal-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--hp-purple-dark);
  margin: 0;
}

.hp-modal-close {
  background: #ffffff;
  border: 1px solid var(--hp-border-light);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hp-text-secondary);
}

.hp-modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* Wizard Progress Bar */
.hp-wizard-progress {
  height: 6px;
  background-color: var(--hp-bg-muted);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 18px;
}

.hp-wizard-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--hp-purple-primary), var(--hp-indigo-wizard));
  transition: width 0.25s ease;
}

.hp-wizard-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--hp-border-light);
  border-radius: var(--hp-radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  font-weight: 700;
  color: var(--hp-text-primary);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.hp-wizard-option:hover,
.hp-wizard-option:has(input:checked) {
  border-color: var(--hp-indigo-wizard);
  background-color: #f4f2ff;
}

/* Toast Notification */
.hp-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hp-toast {
  background: #231138;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--hp-radius-md);
  box-shadow: var(--hp-shadow-modal);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--hp-teal-accent);
}
