/* ============================================================
   КИНО ЭЗЭН — "ЗАР МЭДЭЭ" МОДУЛЬ — CSS
   Бие даасан файл. style.css-ийн дотор юу ч өөрчлөхгүй.
   Бүх class нэрс "zar-" угтвартай — давтагдахгүй.
   ============================================================ */

.zar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.zar-overlay.zar-open {
  display: flex;
}

.zar-modal {
  background: #14141f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- Header ---------- */
.zar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.zar-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}
.zar-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: rgba(255, 255, 255, 0.6);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zar-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ---------- Body (scrollable) ---------- */
.zar-body {
  overflow-y: auto;
  flex: 1;
  padding: 16px 20px 20px;
}

/* ---------- Category pills ---------- */
.zar-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.zar-cat-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.zar-cat-pill:hover {
  background: rgba(255, 255, 255, 0.12);
}
.zar-cat-pill.zar-active {
  background: #4ade80;
  color: #0a2a0a;
  font-weight: 700;
}

/* ---------- Post button ---------- */
.zar-post-btn {
  width: 100%;
  background: linear-gradient(90deg, #4ade80, #f4a261);
  border: none;
  color: #0a2a0a;
  font-size: 14px;
  font-weight: 700;
  padding: 11px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}
.zar-post-btn:hover {
  opacity: 0.92;
}
.zar-post-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Listing grid ---------- */
.zar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 540px) {
  .zar-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.zar-card {
  background: #1c1c2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, transform 0.1s;
}
.zar-card:hover {
  border-color: rgba(74, 222, 128, 0.4);
  transform: translateY(-2px);
}
.zar-card.zar-vip {
  border-color: rgba(244, 162, 97, 0.45);
}
.zar-vip-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #f4a261;
  color: #3a1f0c;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 1;
}
.zar-card-img {
  height: 100px;
  background: #2a2a3e;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.zar-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.zar-card-img i {
  font-size: 28px;
  color: rgba(255, 255, 255, 0.25);
}
.zar-card-body {
  padding: 10px;
}
.zar-card-cat {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 6px;
}
.zar-card-title {
  color: #fff;
  font-size: 13px;
  margin: 0 0 4px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.zar-card-price {
  color: #4ade80;
  font-size: 14px;
  margin: 0 0 6px;
  font-weight: 700;
}
.zar-card-foot {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10.5px;
  gap: 6px;
}
.zar-card-foot span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zar-empty {
  text-align: center;
  padding: 40px 16px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
}
.zar-loading {
  text-align: center;
  padding: 40px 16px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
}

/* ---------- Login prompt (нэвтрэлгүй үед) ---------- */
.zar-login-prompt {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin-bottom: 16px;
}
.zar-login-prompt a {
  color: #4ade80;
  font-weight: 700;
  text-decoration: none;
}

/* ============================================================
   ЗАР НИЙТЛЭХ ФОРМ
   ============================================================ */
.zar-form-wrap {
  display: none;
}
.zar-form-wrap.zar-open {
  display: block;
}

.zar-back-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  padding: 0;
}
.zar-back-btn:hover {
  color: #fff;
}

.zar-field {
  margin-bottom: 14px;
}
.zar-field label {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12.5px;
  margin-bottom: 6px;
  font-weight: 600;
}
.zar-field input,
.zar-field select,
.zar-field textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  padding: 10px 12px;
  font-family: inherit;
  box-sizing: border-box;
}
.zar-field input:focus,
.zar-field select:focus,
.zar-field textarea:focus {
  outline: none;
  border-color: #4ade80;
}
.zar-field textarea {
  resize: vertical;
  min-height: 80px;
}
.zar-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.zar-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.zar-checkbox-row input {
  width: auto;
}
.zar-checkbox-row label {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12.5px;
}

/* ---------- Image upload ---------- */
.zar-img-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.zar-img-slot {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  flex-shrink: 0;
}
.zar-img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.zar-img-slot i {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.3);
}
.zar-img-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.zar-submit-btn {
  width: 100%;
  background: linear-gradient(90deg, #4ade80, #f4a261);
  border: none;
  color: #0a2a0a;
  font-size: 14px;
  font-weight: 700;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 6px;
}
.zar-submit-btn:hover {
  opacity: 0.92;
}
.zar-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.zar-form-msg {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  display: none;
}
.zar-form-msg.zar-show {
  display: block;
}
.zar-form-msg.zar-success {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}
.zar-form-msg.zar-error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

/* ============================================================
   ЗАРЫН ДЭЛГЭРЭНГҲЙ ХАРАГДАЦ
   ============================================================ */
.zar-detail-wrap {
  display: none;
}
.zar-detail-wrap.zar-open {
  display: block;
}
.zar-detail-imgs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
}
.zar-detail-imgs img {
  width: 140px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.zar-detail-title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}
.zar-detail-price {
  color: #4ade80;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 14px;
}
.zar-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12.5px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.zar-detail-desc {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 16px;
}
.zar-detail-contact {
  background: rgba(74, 222, 128, 0.1);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.zar-detail-contact-phone {
  color: #4ade80;
  font-size: 16px;
  font-weight: 700;
}
.zar-call-btn {
  background: #4ade80;
  color: #0a2a0a;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- Spinner ---------- */
.zar-spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #0a2a0a;
  border-radius: 50%;
  animation: zar-spin-anim 0.6s linear infinite;
}
@keyframes zar-spin-anim {
  to { transform: rotate(360deg); }
}
