:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #64706f;
  --primary: #0f766e;
  --primary-dark: #0b4f4a;
  --accent: #d4a373;
  --border: #e6e1d8;
  --shadow: 0 14px 34px rgba(23, 32, 42, 0.09);
  --shadow-strong: 0 24px 60px rgba(23, 32, 42, 0.2);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(212, 163, 115, .18), transparent 34%),
    linear-gradient(180deg, #fffcf7 0%, var(--bg) 100%);
  color: var(--text);
}

body.modal-open {
  overflow: hidden;
}
button, select { font: inherit; }
.app-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 16px 96px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 30px;
  padding: 14px;
  border: 1px solid rgba(230, 225, 216, .86);
  border-radius: 18px;
  background: rgba(255,255,255,.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.brand-wrap {
  display: flex;
  gap: 14px;
  align-items: center;
}
.logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(23, 32, 42, .08);
}
h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: 0; }
.subtitle { margin: 0; color: var(--primary); font-weight: 700; }
.lang-select {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
  color: var(--text);
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: transform .2s ease, box-shadow .2s ease;
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(23, 32, 42, .13);
}
.category-image {
  height: 190px;
  background-size: cover;
  background-position: center;
}
.tour-bg {
  background-image:
    linear-gradient(135deg, rgba(11,79,74,.9), rgba(212,163,115,.44)),
    url('assets/logo.png');
}
.transfer-bg {
  background-image:
    linear-gradient(135deg, rgba(23,32,42,.9), rgba(15,118,110,.52)),
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.28), transparent 25%);
}
.market-bg {
  background-image:
    linear-gradient(135deg, rgba(116,78,37,.86), rgba(15,118,110,.44)),
    radial-gradient(circle at 70% 25%, rgba(255,255,255,.24), transparent 28%);
}
.category-content { padding: 18px; }
.category-content h2 { margin: 0 0 8px; font-size: 24px; }
.category-content p { margin: 0; color: var(--muted); line-height: 1.4; }
.hidden { display: none !important; }
.list-section {
  margin-top: 28px;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.list-header h2 { margin: 0 0 6px; }
.list-header p { margin: 0; color: var(--muted); }
.secondary-btn, .primary-btn, .whatsapp-float {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
}
.secondary-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
.primary-btn, .whatsapp-float {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
}
.primary-btn:hover {
  background: var(--primary-dark);
}
.item-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.item-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  align-items: stretch;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.item-card:hover {
  border-color: rgba(15,118,110,.36);
  transform: translateY(-1px);
  box-shadow: 0 16px 38px rgba(23, 32, 42, .11);
}
.item-thumb {
  width: 100%;
  height: 132px;
  object-fit: cover;
  border-radius: 12px;
  background: #e5e7eb;
}
.item-body { display: flex; flex-direction: column; gap: 10px; }
.item-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.item-title-row h3 { margin: 0; font-size: 20px; }
.item-desc {
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.price-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 8px 12px;
  background: rgba(212,163,115,.2);
  color: #8a5b2b;
  border-radius: 10px;
  font-weight: 700;
}
.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: auto;
}
.item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.item-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.18);
}
.item-whatsapp-btn:hover {
  background: #1ebe5d;
}
.meta-inline {
  color: var(--muted);
  font-size: 14px;
}
.list-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,.7);
}
.list-state p {
  margin: 0;
}
.list-state-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}
.list-state.loading .list-state-dot {
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .35; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.2); }
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23,32,42,.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1000;
  pointer-events: auto;
}
.modal-card {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  position: relative;
  z-index: 1001;
  box-shadow: var(--shadow-strong);
}

.modal-overlay.hidden,
.lightbox.hidden {
  pointer-events: none;
}

.modal-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 24px;
}

.modal-media-wrap {
  position: relative;
}

.modal-image {
  width: 100%;
  height: 370px;
  object-fit: cover;
  border-radius: 14px;
  background: #e5e7eb;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.gallery-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d1d5db;
}

.gallery-dot.active {
  background: var(--primary);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(23,32,42,.62);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
}

.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }

.modal-content h3 {
  margin-top: 0;
  font-size: 28px;
  color: var(--text);
}

.modal-description {
  color: var(--muted);
  line-height: 1.6;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.meta-chip {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 8px 12px;
  color: #374151;
}

.price-row {
  margin-bottom: 18px;
}

/* Detay popup X */
#closeModal,
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  z-index: 2;

  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(0,0,0,.62);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1100;
  pointer-events: auto;
}

.lightbox-image {
  max-width: min(100%, 1000px);
  max-height: 88vh;
  border-radius: 18px;
}

#closeLightbox,
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1101;

  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.96);
  color: #111827;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
}

/* WhatsApp */
#modalWhatsapp,
.whatsapp-float,
#whatsappFloat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #fff;
  border: none;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.28);
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
}

#modalWhatsapp {
  width: 100%;
  min-height: 48px;
  position: relative;
  z-index: 1;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
}

#whatsappFloat,
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
}

body.modal-open .whatsapp-float {
  opacity: 0;
  pointer-events: none;
}

#modalWhatsapp:hover,
#whatsappFloat:hover,
.whatsapp-float:hover {
  background: #1ebe5d;
}

@media (max-width: 860px) {
  .modal-layout {
    grid-template-columns: 1fr;
  }

  .modal-image {
    height: 260px;
  }
}

@media (max-width: 768px) {
  #closeModal,
  .modal-close {
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  #closeLightbox,
  .lightbox-close {
    top: 14px;
    right: 14px;
    width: 48px;
    height: 48px;
    font-size: 30px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .list-header,
  .brand-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-card {
    grid-template-columns: 1fr;
  }

  .item-thumb {
    height: 180px;
  }

  .item-footer,
  .item-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .item-actions .secondary-btn,
  .item-whatsapp-btn {
    width: 100%;
  }

  h1 {
    font-size: 24px;
  }

  .category-image {
    height: 160px;
  }

  .modal-card {
    padding: 18px;
    border-radius: 16px;
  }
  .category-grid {
    grid-template-columns: 1fr;
  }
}
