/* ============================================================
   TulumCodex — Estilos del portal
   Paleta: negro + jade + arena, mobile-first
   ============================================================ */

/* ORIGINAL:
   TulumCodex — Estilos del portal público
   Paleta: dark bg + gold accent, mobile-first
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:    #8fbc8f;  /* jade */
  --gold-lt: #b5d4b5;  /* jade light */
  --dark:    #0e0e0e;  /* codex black */
  --card:    #141414;
  --border:  #222;
  --text:    #e8e0d0;  /* warm white */
  --muted:   #888;
  --wa:      #25D366;
  --radius:  10px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--dark);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ── HEADER ── */
.site-header {
  background: #0a0a0a;
  border-bottom: 1px solid #1e1e1e;
  position: sticky; top: 0; z-index: 100;
  padding: 14px 0;
}
/* Efecto glass en el header (con respaldo sólido donde no se soporte) */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    background: rgba(10, 10, 10, .6);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  text-decoration: none;
}
.logo-toro { font-size: 1.5rem; }
.logo em { color: var(--gold); font-style: normal; }

.header-nav { display: flex; align-items: center; gap: 12px; }

/* ── BUTTONS ── */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
  text-align: center;
}
.btn:hover { opacity: .85; transform: translateY(-1px); text-decoration: none; }
.btn-gold   { background: var(--gold); color: #000; }
.btn-wa     { background: var(--wa); color: #fff; }
.btn-outline { background: transparent; color: var(--gold); border: 1.5px solid var(--gold); }
.btn-ghost  { background: #1a1a1a; color: var(--text); }
.btn-sm     { padding: 6px 12px; font-size: .82rem; }
.btn-lg     { padding: 14px 24px; font-size: 1rem; }
.btn-block  { display: block; width: 100%; }

/* ── HERO ── */
.hero {
  background: linear-gradient(160deg, #0e0e0e 0%, #0a1a0a 100%);
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.5rem); color: var(--text); margin-bottom: 8px; }
.hero-sub { color: var(--muted); margin-bottom: 28px; font-size: .95rem; }

/* FILTER BAR */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.filter-bar select,
.filter-bar input[type=number] {
  padding: 10px 14px;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  min-width: 140px;
}
.filter-bar select:focus,
.filter-bar input:focus { outline: 2px solid var(--gold); }

/* ── MAIN CONTENT ── */
.main-content { padding: 28px 16px 60px; }

.results-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.results-count { color: var(--muted); font-size: .9rem; }

/* GRID */
.grid-props {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ── PROPERTY CARD ── */
.prop-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: border-color .2s, transform .2s;
}
.prop-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.prop-card.destacada { border-color: var(--gold); }

.badge-destacada {
  position: absolute; top: 10px; left: 10px;
  background: var(--gold); color: #000;
  font-size: .7rem; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
  z-index: 1;
}

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

.card-body { padding: 14px; }

.card-meta { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }

.badge-zona, .badge-tipo, .badge-amen {
  font-size: .7rem; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
}
.badge-zona { background: #1a1a0a; color: var(--gold); border: 1px solid #2a2800; }
.badge-tipo { background: #0a1a1a; color: #4dd9d9; border: 1px solid #0a2a2a; }
.badge-amen { background: #0a1a0a; color: #4ade80; border: 1px solid #0a2a0a; }

.card-title {
  font-size: .92rem; font-weight: 600; margin-bottom: 6px; line-height: 1.3;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--gold); text-decoration: none; }

.card-precio {
  font-size: 1.1rem; font-weight: 700; color: var(--gold); margin-bottom: 8px;
}

.card-detalles {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: .78rem; color: var(--muted); margin-bottom: 12px;
}

.card-actions { display: flex; gap: 8px; }

/* ── PAGINATION ── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-top: 40px;
  color: var(--muted);
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty-state p { font-size: 1.1rem; margin-bottom: 20px; }

/* ── PROPERTY DETAIL ── */
.prop-detail { padding: 24px 16px 60px; }

.breadcrumb {
  font-size: .83rem; color: var(--muted);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--gold); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  margin-bottom: 40px;
}
@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* GALLERY */
.gallery-main {
  width: 100%; height: 360px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  cursor: pointer;
}
.gallery-thumbs {
  display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.thumb {
  width: 70px; height: 50px; object-fit: cover;
  border-radius: 6px; border: 2px solid transparent;
  cursor: pointer; opacity: .7; transition: all .2s;
}
.thumb:hover, .thumb.active { border-color: var(--gold); opacity: 1; }
.gallery-placeholder {
  height: 300px; background: var(--card); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 2rem;
}

/* DETAIL INFO */
.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.detail-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 12px; line-height: 1.3; }
.detail-precio { font-size: 1.8rem; font-weight: 700; color: var(--gold); margin-bottom: 20px; }

.detail-nums {
  display: flex; gap: 0; margin-bottom: 24px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.num-item { flex: 1; padding: 14px 10px; text-align: center; border-right: 1px solid var(--border); }
.num-item:last-child { border-right: none; }
.num-val { display: block; font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.num-label { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; }

/* CONTACT FORM */
.contact-form {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.contact-form h3 { margin-bottom: 14px; font-size: 1rem; color: var(--muted); }
.contact-form input,
.contact-form textarea {
  width: 100%; padding: 10px 12px;
  background: #0d0d0d; border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); font-size: .9rem;
  margin-bottom: 10px; font-family: inherit;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--gold); }
.form-feedback { padding: 10px 14px; border-radius: 7px; font-size: .88rem; margin-top: 10px; }
.form-feedback.ok    { background: #14532d; color: #bbf7d0; }
.form-feedback.error { background: #450a0a; color: #fca5a5; }

.detail-date { font-size: .78rem; color: var(--muted); margin-top: 12px; }

/* DESCRIPTION */
.detail-desc, .detail-amenidades, .similares {
  margin-top: 32px;
}
.detail-desc h2, .detail-amenidades h2, .similares h2 {
  font-size: 1.1rem; margin-bottom: 14px;
  color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.detail-desc p { color: var(--text); line-height: 1.8; }

/* AMENIDADES */
.amenidades-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.amen-tag {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 14px; font-size: .85rem;
}

/* SIMILARES */
.similares-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.sim-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: block; color: var(--text); text-decoration: none;
  transition: border-color .2s;
}
.sim-card:hover { border-color: var(--gold); }
.sim-card img { width: 100%; height: 120px; object-fit: cover; }
.sim-no-img { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.sim-info { padding: 10px; }
.sim-title { font-size: .82rem; margin-bottom: 4px; }
.sim-precio { font-size: .9rem; font-weight: 700; color: var(--gold); }

/* ── PUBLICAR FORM ── */
.form-page { padding: 32px 16px 60px; max-width: 720px; }
.form-header { margin-bottom: 28px; }
.form-header h1 { font-size: 1.5rem; margin-bottom: 6px; }
.form-header p { color: var(--muted); }

.pub-form fieldset {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 20px;
}
.pub-form legend {
  font-weight: 700; padding: 0 8px; color: var(--gold);
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: .88rem; color: var(--muted); }
.form-group input[type=text],
.form-group input[type=number],
.form-group input[type=email],
.form-group select,
.form-group textarea {
  width: 100%; padding: 11px 14px;
  background: #0d0d0d; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .92rem;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: 2px solid var(--gold); }
.form-group input[type=checkbox] { width: auto; margin-right: 8px; accent-color: var(--gold); }
.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr 1fr; } }
.hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }

/* AMENIDADES CHECKS */
.amen-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.amen-check {
  display: flex; align-items: center; gap: 6px;
  background: #0d0d0d; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px;
  font-size: .85rem; cursor: pointer;
  transition: border-color .15s;
}
.amen-check:has(input:checked) { border-color: var(--gold); }
.amen-check input { accent-color: var(--gold); }

/* PREVIEW IMÁGENES */
.img-preview-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.preview-item { position: relative; }
.preview-item img { width: 90px; height: 70px; object-fit: cover; border-radius: 6px; }
.preview-item span {
  position: absolute; bottom: 2px; left: 0; right: 0;
  text-align: center; font-size: .6rem; color: #fff;
  background: rgba(0,0,0,.6); border-radius: 0 0 6px 6px; padding: 2px;
}

/* FORM FOOTER */
.form-footer { margin-top: 8px; }
.terms { font-size: .78rem; color: var(--muted); margin-bottom: 14px; }

/* ALERTS */
.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; }
.alert-error { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }
.alert ul { padding-left: 20px; margin-top: 8px; }

/* ── FOOTER ── */
.site-footer {
  background: #0a0a0a;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
  font-size: .83rem;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--gold); }
.footer-legal { margin-top: 8px; font-size: .75rem; opacity: .6; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .hero { padding: 32px 0 24px; }
  .filter-bar select,
  .filter-bar input { min-width: 100%; }
  .grid-props { grid-template-columns: 1fr; }
  .gallery-main { height: 230px; }
  .detail-nums { flex-wrap: wrap; }
  .num-item { min-width: 50%; }
}

/* ── CONTACT OPTIONS en publicar.php ── */
.contact-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}
.contact-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.contact-option-icon {
  font-size: 1.6rem;
  line-height: 1;
  padding-top: 4px;
  flex-shrink: 0;
}
.contact-option .form-group {
  flex: 1;
  margin-bottom: 0;
}
.contact-option .form-group label {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

/* ── PWA INSTALL BANNER ── */
.pwa-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: linear-gradient(135deg, #1a1200, #0d0d0d);
  border-top: 2px solid var(--gold);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
  z-index: 9000;
  box-shadow: 0 -4px 24px rgba(201,162,39,.2);
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.pwa-banner-icon { font-size: 2rem; flex-shrink: 0; }
.pwa-banner-text { flex: 1; }
.pwa-banner-text strong { display: block; color: var(--gold); font-size: .95rem; }
.pwa-banner-text small { color: #888; font-size: .78rem; }
.pwa-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pwa-banner-close {
  background: none; border: none; color: #666;
  font-size: 1.2rem; cursor: pointer; padding: 4px 8px;
  flex-shrink: 0;
}

/* ── ADMIN FLOATING BAR ── */
.admin-float-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #1a0000;
  border-top: 2px solid #ef4444;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 8px;
  z-index: 8999; flex-wrap: wrap;
}
.admin-float-bar span {
  color: #ef4444; font-size: .8rem; font-weight: 700;
  margin-right: 4px;
}
.admin-float-bar a {
  padding: 5px 12px; border-radius: 6px;
  font-size: .78rem; font-weight: 600;
  text-decoration: none; transition: opacity .15s;
  white-space: nowrap;
}
.admin-float-bar a:hover { opacity: .8; }
.afb-edit     { background: #c9a227; color: #000; }
.afb-aprobar  { background: #166534; color: #bbf7d0; }
.afb-pausar   { background: #1e3a5f; color: #93c5fd; }
.afb-destacar { background: #4c1d95; color: #ddd6fe; }
.afb-rentada  { background: #134e4a; color: #99f6e4; }
.afb-rechazar { background: #7f1d1d; color: #fca5a5; }

/* ── BULK ACTIONS BAR ── */
.bulk-bar {
  background: #1a1200; border: 1px solid #3a2a00;
  border-radius: 8px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.bulk-bar span { color: #c9a227; font-weight: 600; font-size: .9rem; }
.bulk-bar select {
  padding: 6px 10px; background: #0d0d0d;
  border: 1px solid #333; border-radius: 6px;
  color: #e0e0e0; font-size: .85rem;
}

/* ── TULUMCODEX LOGO ── */
.tc-logo-svg { height: 36px; width: auto; display: block; }
.tc-logo-link { display: flex; align-items: center; text-decoration: none; }
.contacto-stats { display:flex; flex-wrap:wrap; gap:10px; margin:10px 0 18px; }
.contacto-stats span { background:#141414; border:1px solid #1e2e1e; border-radius:20px; padding:4px 12px; font-size:.78rem; color:#8fbc8f; }

/* ── CARD CAROUSEL ───────────────────────────────────────────── */
.card-carousel {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 ratio — bulletproof */
  background: #111;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.carousel-viewport {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}
.carousel-track {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  height: 100%;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 100%;
  min-width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}
.carousel-slide img,
.carousel-slide .card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}
.card-img-link .card-img {
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
  border-radius: var(--radius) var(--radius) 0 0;
}
/* Prev/Next buttons — positioned inside card-carousel */
.carousel-btn {
  position: absolute;
  top: 37.5%; /* center of 75% padding-top container */
  transform: translateY(-50%);
  background: rgba(0,0,0,.6);
  border: none;
  color: #e8e0d0;
  font-size: 1.5rem;
  line-height: 1;
  width: 30px;
  height: 42px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 20;
  transition: background .15s, opacity .15s;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-carousel:hover .carousel-btn,
.card-carousel:focus-within .carousel-btn { opacity: 1; }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }
.carousel-btn:hover { background: rgba(0,0,0,.85); }
/* Dots */
.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 20;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  transition: background .2s, transform .2s;
  cursor: pointer;
}
.dot.active {
  background: #8fbc8f;
  transform: scale(1.3);
}
/* Mobile: always show buttons */
@media (max-width: 640px) {
  .carousel-btn { opacity: .7; width: 28px; height: 38px; font-size: 1.3rem; }
}
