/* ============================================
   UI Components — Buttons, Badges, Cards,
   Search, Stats, Skeletons
   ============================================ */

/* ————— Buttons ————— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: var(--s3) var(--s7);
  border-radius: var(--r-full);
  font-family: var(--font);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  border: 1.5px solid var(--black);
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  background: var(--white);
  color: var(--black);
  transition:
    background var(--duration) var(--ease),
    color var(--duration) var(--ease),
    transform var(--duration) var(--ease);
  -webkit-user-select: none;
  user-select: none;
}

.btn:hover {
  background: var(--black);
  color: var(--white);
}

.btn:active { transform: scale(0.97); }

/* Variants */
.btn-primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.btn-primary:hover {
  background: var(--white);
  color: var(--black);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}
.btn-ghost:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.btn-white {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}
.btn-white:hover {
  background: transparent;
  color: var(--white);
}

.btn-whatsapp {
  background: var(--wa-green);
  color: var(--white);
  border-color: var(--wa-green);
}
.btn-whatsapp:hover {
  background: #1ebe5d;
  border-color: #1ebe5d;
}

/* Sizes */
.btn-sm    { padding: var(--s2) var(--s5); font-size: var(--fs-xs); min-height: 36px; }
.btn-lg    { padding: var(--s4) var(--s8); font-size: var(--fs-base); }
.btn-block { width: 100%; }

/* ————— Badges ————— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: 1.4;
  background: var(--gray);
  color: var(--text-soft);
  border: 1px solid var(--gray-mid);
}

/* ————— Product Card ————— */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s5);
  padding: 0 var(--s6);
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: transform var(--duration-slow) var(--ease),
              box-shadow var(--duration-slow) var(--ease);
  text-decoration: none;
  color: inherit;
  display: block;
  border: 1px solid rgba(0,0,0,0.06);
}

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

.product-card:active { transform: scale(0.98); }

.product-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.product-card-img-placeholder {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: var(--gray);
  color: var(--text-muted);
}

.product-card-body { padding: var(--s4); }

.product-card-body .badge { margin-bottom: var(--s2); }

.product-card-body h4 {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  margin-bottom: var(--s1);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s2) var(--s4) var(--s4);
}

.product-price {
  font-size: var(--fs-base);
  font-weight: var(--fw-semi);
  color: var(--text);
}

.product-price small {
  font-size: var(--fs-xs);
  font-weight: var(--fw-normal);
  color: var(--text-muted);
}

.product-card-arrow {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform var(--duration) var(--ease);
}

.product-card:hover .product-card-arrow {
  transform: translateX(2px);
}

/* Star rating on card */
.product-card-rating {
  position: absolute;
  top: var(--s3);
  right: var(--s3);
  background: rgba(255,255,255,0.9);
  border-radius: var(--r-full);
  padding: 2px 8px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 3px;
}

.product-card-rating svg {
  width: 12px;
  height: 12px;
}

/* ————— Filter Pills ————— */
.filter-pills {
  display: flex;
  gap: var(--s2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: var(--s3) var(--s6);
}
.filter-pills::-webkit-scrollbar { display: none; }

.filter-pill {
  padding: var(--s2) var(--s5);
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  flex-shrink: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  border: 1.5px solid var(--gray-mid);
}

.filter-pill.active,
.filter-pill:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ————— Search Bar ————— */
.search-bar {
  margin: 0 var(--s6) var(--s4);
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: var(--s3) var(--s5) var(--s3) 44px;
  border-radius: var(--r-full);
  background: var(--bg-card);
  font-size: var(--fs-sm);
  color: var(--text);
  border: 1.5px solid var(--gray-mid);
  min-height: 48px;
  transition: border-color var(--duration) var(--ease);
}

.search-bar input:focus {
  border-color: var(--black);
  outline: none;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.4;
}

/* ————— Price (large) ————— */
.price-lg {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semi);
  color: var(--text);
  display: inline-flex;
  align-items: baseline;
  gap: var(--s1);
}

.price-lg small {
  font-size: var(--fs-sm);
  font-weight: var(--fw-normal);
  color: var(--text-muted);
}

/* ————— Stats Grid ————— */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s4);
}

.stat-block {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid rgba(0,0,0,0.06);
  padding: var(--s6) var(--s5);
  text-align: center;
  transition: transform var(--duration-slow) var(--ease);
}

.stat-block:hover { transform: translateY(-2px); }

.stat-block .stat-num {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semi);
  color: var(--text);
  display: block;
  line-height: 1;
  margin-bottom: var(--s2);
}

.stat-block .stat-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: var(--fw-normal);
}

/* ————— Empty state ————— */
.empty-state {
  text-align: center;
  padding: var(--s10) var(--s6);
}

.empty-state-icon { font-size: 3rem; margin-bottom: var(--s5); }
.empty-state h3   { margin-bottom: var(--s3); }
.empty-state p    { color: var(--text-muted); }

/* ————— Skeleton loader ————— */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    var(--gray) 25%,
    var(--white) 50%,
    var(--gray) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-md);
}

/* ————— Sticky CTA bar ————— */
.sticky-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-mid);
  padding: var(--s4) var(--s6);
  padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  z-index: var(--z-sticky);
}

/* ————— Detail block ————— */
.detail-block {
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-mid);
  margin-bottom: var(--s5);
  overflow: hidden;
}

.detail-block-header {
  background: var(--black);
  color: var(--white);
  padding: var(--s4) var(--s5);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.detail-block-body {
  padding: var(--s5);
  background: var(--bg-card);
}

.detail-block-body p {
  font-size: var(--fs-sm);
  line-height: 1.7;
  margin-bottom: var(--s3);
}

.detail-block-body p:last-child { margin-bottom: 0; }

.detail-block-body ul li {
  font-size: var(--fs-sm);
  color: var(--text-soft);
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--gray);
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.detail-block-body ul li:last-child { border-bottom: none; }

/* ————— Package count ————— */
.package-count {
  padding: var(--s3) var(--s6);
  font-size: var(--fs-xs);
  font-weight: var(--fw-normal);
  color: var(--text-muted);
}
