/* =============================================================================
   TOFFEHA — MARKETPLACE
   Plan cards, destination cards, creator cards, filters, buy panel, controls
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Plan Card (.toffeha-plan-card)
   Specialized card variant with marketplace-specific slots
   --------------------------------------------------------------------------- */
.toffeha-plan-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
  will-change: transform;
  display: flex;
  flex-direction: column;
  transition:
    transform  var(--dur-fast) var(--ease-entrance),
    box-shadow var(--dur-fast) var(--ease-standard);
}

.toffeha-plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.toffeha-plan-card__photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  background: var(--sand-100);
  flex-shrink: 0;
}

.toffeha-plan-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease-standard);
}

.toffeha-plan-card:hover .toffeha-plan-card__photo img {
  transform: scale(1.04);
}

/* Photo overlay gradient */
.toffeha-plan-card__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14, 32, 66, 0.55) 0%, transparent 55%);
  pointer-events: none;
}

/* Country flag bottom-left in photo */
.toffeha-plan-card__country-flag {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-raised);
  border-radius: var(--radius-xs);
  overflow: hidden;
  width: 28px;
  height: 20px;
  box-shadow: var(--shadow-sm);
}

.toffeha-plan-card__country-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Badges top-left */
.toffeha-plan-card__badges {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-raised);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* Save button top-right */
.toffeha-plan-card__save {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: var(--z-raised);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  color: #fff;
  transition: transform var(--dur-fast) var(--ease-spring);
}

.toffeha-plan-card__save:hover {
  transform: scale(1.12);
}

/* Card body */
.toffeha-plan-card__body {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

/* Duration eyebrow */
.toffeha-plan-card__duration {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--fw-regular);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

.toffeha-plan-card__title {
  font-size: var(--text-md);
  font-weight: var(--fw-semibold);
  line-height: var(--leading-snug);
  color: var(--text);
  margin: 0;
  text-wrap: balance;
}

.toffeha-plan-card__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card footer */
.toffeha-plan-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5) var(--space-4);
  border-top: 1px solid var(--border);
  gap: var(--space-3);
}

/* Price display */
.toffeha-plan-card__price {
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
  font-size: var(--text-lg);
  color: var(--text);
  line-height: 1;
}

.toffeha-plan-card__price--paid {
  color: var(--brand);
}

.toffeha-plan-card__price--free {
  color: var(--success-500);
}

/* ---------------------------------------------------------------------------
   Destination Card (.toffeha-destination-card)
   --------------------------------------------------------------------------- */
.toffeha-destination-card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  will-change: transform;
  transition:
    transform  var(--dur-fast) var(--ease-entrance),
    box-shadow var(--dur-fast) var(--ease-standard);
}

.toffeha-destination-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.toffeha-destination-card__photo {
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.toffeha-destination-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease-standard);
}

.toffeha-destination-card:hover .toffeha-destination-card__photo img {
  transform: scale(1.06);
}

/* Text overlay at bottom */
.toffeha-destination-card__overlay {
  position: absolute;
  inset: auto 0 0 0;
  background: var(--glass-bg-dark);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  padding: var(--space-5) var(--space-4) var(--space-4);
}

.toffeha-destination-card__title {
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--text-on-dark);
  margin: 0 0 var(--space-1);
  text-wrap: balance;
}

.toffeha-destination-card__count {
  font-size: var(--text-xs);
  color: rgba(247, 239, 226, 0.7);
}

/* ---------------------------------------------------------------------------
   Creator Card (.toffeha-creator-card)
   --------------------------------------------------------------------------- */
.toffeha-creator-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-align: center;
  padding: var(--space-6) var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  will-change: transform;
  transition:
    transform  var(--dur-fast) var(--ease-entrance),
    box-shadow var(--dur-fast) var(--ease-standard);
}

.toffeha-creator-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.toffeha-creator-card__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.toffeha-creator-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.toffeha-creator-card__name {
  font-size: var(--text-md);
  font-weight: var(--fw-semibold);
  color: var(--text);
  margin: 0;
}

.toffeha-creator-card__handle {
  font-size: var(--text-xs);
  color: var(--text-subtle);
  margin-top: -var(--space-1);
}

/* Stats row */
.toffeha-creator-card__stats {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.toffeha-creator-card__stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.toffeha-creator-card__stat-value {
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
  font-size: var(--text-md);
  color: var(--text);
  line-height: 1;
}

.toffeha-creator-card__stat-label {
  font-size: var(--text-2xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------------------------------------------------------------------------
   Filters Panel (.toffeha-filters)
   --------------------------------------------------------------------------- */
.toffeha-filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-5);
}

.toffeha-filters__section {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.toffeha-filters__section:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.toffeha-filters__title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--fw-regular);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  display: block;
}

.toffeha-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.toffeha-filters__clear {
  font-size: var(--text-xs);
  color: var(--text-subtle);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  transition: color var(--dur-fast);
}

.toffeha-filters__clear:hover {
  color: var(--brand);
}

/* ---------------------------------------------------------------------------
   Buy Panel (.toffeha-buy-panel)
   --------------------------------------------------------------------------- */
.toffeha-buy-panel {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.toffeha-buy-panel__price {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--fw-extrabold);
  color: var(--text);
  line-height: 1;
}

.toffeha-buy-panel__price--free {
  color: var(--success-500);
}

.toffeha-buy-panel__price-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.toffeha-buy-panel__cta {
  width: 100%;
  margin-top: var(--space-1);
}

.toffeha-buy-panel__divider {
  height: 1px;
  background: var(--border);
}

.toffeha-buy-panel__feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toffeha-buy-panel__feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.toffeha-buy-panel__feature-icon {
  width: 16px;
  height: 16px;
  color: var(--success-500);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---------------------------------------------------------------------------
   Marketplace Search Bar
   --------------------------------------------------------------------------- */
.toffeha-marketplace-search {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.toffeha-marketplace-search__icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.toffeha-marketplace-search__input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text);
}

.toffeha-marketplace-search__input::placeholder {
  color: var(--text-subtle);
}

/* ---------------------------------------------------------------------------
   Sort Bar + View Toggle
   --------------------------------------------------------------------------- */
.toffeha-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.toffeha-sort-bar__count {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.toffeha-sort-bar__controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.toffeha-view-toggle {
  display: flex;
  gap: var(--space-2);
}

.toffeha-view-toggle__btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease-standard);
}

.toffeha-view-toggle__btn--active,
.toffeha-view-toggle__btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* ---------------------------------------------------------------------------
   Tunisia Badge (.toffeha-tunisia-badge)
   --------------------------------------------------------------------------- */
.toffeha-tunisia-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #E11217;
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  line-height: 1.4;
  white-space: nowrap;
}

/* Arabic flourish */
.toffeha-tunisia-badge::before {
  content: '🇹🇳';
  font-style: normal;
  font-size: 10px;
}

/* ---------------------------------------------------------------------------
   Route Motif (.toffeha-route-line / .toffeha-route-svg)
   --------------------------------------------------------------------------- */
.toffeha-route-line {
  position: relative;
  overflow: visible;
}

.toffeha-route-svg {
  overflow: visible;
}

/* Dashed stroke style — actual animation in toffeha-motion.css */
.toffeha-route-svg path {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2px;
  stroke-dasharray: 6 4;
}

.toffeha-route-svg circle {
  fill: var(--brand);
}
