/* ===== SHOPS PAGE ===== */

/* Hero */
.shops-hero {
  position: relative;
  height: 100px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.shops-hero-bg { display: none; }
.shops-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0;
  text-align: center;
}
.shops-hero h1 { font-size: 26px; font-weight: 600; color: #fff; margin: 0; }
.shops-hero p { display: none; }

/* ===== ZONE LISTING VIEW ===== */
.zone-listing-wrap { padding: 40px 0 60px; }

.zone-listing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.zone-listing-title { font-size: 22px; font-weight: 600; color: var(--primary); }
.zone-listing-count { font-size: 15px; color: var(--gray); }

/* ===== SHOP AUTOCOMPLETE SEARCH ===== */
.shop-search-bar {
  position: relative;
  max-width: 360px;
  flex: 1;
}
.shop-search-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  font-size: 15px;
  pointer-events: none;
  z-index: 1;
}
.shop-search-input {
  width: 100%;
  padding: 11px 40px 11px 40px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font-th);
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.shop-search-input:focus { outline: none; border-color: var(--primary); }
.shop-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  color: var(--gray);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: background 0.15s;
  z-index: 1;
}
.shop-search-clear:hover { background: #cbd5e1; }

/* Autocomplete dropdown */
.shop-autocomplete {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13);
  z-index: 500;
  overflow: hidden;
  max-height: 380px;
  overflow-y: auto;
}
.shop-autocomplete.open { display: block; }
.ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.highlight { background: #f5f8ff; }
.ac-status {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ac-open, .ac-allday { background: #22c55e; }
.ac-closed { background: #94a3b8; }
.ac-holiday { background: #f59e0b; }
.ac-info { flex: 1; min-width: 0; }
.ac-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-name mark { background: #fef3c7; color: #92400e; padding: 0 1px; border-radius: 2px; font-style: normal; }
.ac-meta { font-size: 12px; color: var(--gray); margin-top: 2px; }
.ac-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}
.ac-badge.ac-open, .ac-badge.ac-allday { background: #dcfce7; color: #15803d; }
.ac-badge.ac-closed { background: #f1f5f9; color: #64748b; }
.ac-badge.ac-holiday { background: #fef3c7; color: #92400e; }
.ac-empty { padding: 18px 16px; color: var(--gray); font-size: 14px; display: flex; align-items: center; gap: 8px; }

.zones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.zone-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}
.zone-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(26,58,107,0.12);
}

.zone-card-img {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  position: relative;
  overflow: hidden;
}
.zone-card-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.zone-card-img i { position: relative; z-index: 1; }
.zone-card-img .zone-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.2);
}

.zone-card-body { padding: 18px; flex: 1; }
.zone-card-name { font-size: 18px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.zone-card-sub { font-size: 13px; color: var(--gray); margin-bottom: 12px; line-height: 1.5; }
.zone-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--light-gray);
  border-top: 1px solid var(--border);
}
.zone-card-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--gray);
  font-weight: 600;
}
.zone-card-count i { color: var(--primary); }
.zone-card-open-count {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: #dcfce7;
  color: #166534;
}
.zone-card-open-count.zero { background: #f1f5f9; color: var(--gray); }
.zone-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-th);
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.zone-card-btn:hover { background: var(--primary-dark); }

/* ===== ZONE DETAIL VIEW ===== */
.zone-detail-wrap { padding: 0 0 60px; }
.zone-detail-wrap.hidden { display: none; }
.zone-listing-wrap.hidden { display: none; }

/* Breadcrumb + header */
.zone-detail-header {
  background: #fff;
  color: var(--dark);
  padding: 16px 0;
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.zone-detail-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.zone-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1.5px solid var(--border);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-th);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.zone-back-btn:hover { background: #e2e8f0; }

.zone-detail-title-wrap { flex: 1; }
.zone-detail-icon { display: none; }
.zone-detail-name { font-size: 22px; font-weight: 800; color: var(--primary); }
.zone-detail-sub { font-size: 14px; color: var(--gray); margin-top: 2px; }
.zone-detail-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.zone-stall-badge {
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Stall toolbar */
.stall-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 60px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.stall-toolbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stall-search-wrap { position: relative; flex: 1; min-width: 200px; }
.stall-search-wrap i {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray); font-size: 14px;
}
.stall-search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 2px solid var(--border);
  border-radius: 9px;
  font-size: 15px;
  font-family: var(--font-th);
  transition: border-color 0.2s;
}
.stall-search-input:focus { outline: none; border-color: var(--primary); }

.stall-filter-btns { display: flex; gap: 6px; }
.stall-filter-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #f8f9fb;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-th);
  cursor: pointer;
  color: var(--gray);
  transition: all 0.15s;
  white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
}
.stall-filter-btn i { font-size: 11px; }
.stall-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.stall-filter-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* Stall count bar */
.stall-count-bar {
  padding: 10px 0;
  background: var(--light-gray);
  border-bottom: 1px solid var(--border);
}
.stall-count-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--gray);
  flex-wrap: wrap;
  gap: 8px;
}
.stall-count-bar strong { color: var(--primary); }
.status-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.leg { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.leg-dot { width: 9px; height: 9px; border-radius: 50%; }
.leg-dot.open { background: #22c55e; }
.leg-dot.closed { background: #ef4444; }
.leg-dot.holiday { background: #f59e0b; }
.leg-dot.allday { background: #3b82f6; }

/* Stall Table - centered */
.stall-table-section { padding: 24px 0; }
.stall-table-wrap {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: visible;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  position: relative;
}
.stall-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
}
.stall-table thead { background: var(--accent); }
.stall-table th {
  padding: 14px 20px;
  text-align: center;
  color: var(--primary-dark);
  font-weight: 600;
  white-space: nowrap;
  font-size: 16px;
}
.stall-table th:first-child { text-align: left; }
.stall-table tbody tr {
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.15s;
}
.stall-table tbody tr:last-child { border-bottom: none; }
.stall-table tbody tr:hover { background: #fffbf0; }
.stall-table tbody tr.stall-highlighted {
  animation: stall-pulse 3.5s ease forwards;
}
@keyframes stall-pulse {
  0%   { background: #dbeafe; box-shadow: inset 4px 0 0 #3b82f6; }
  40%  { background: #bfdbfe; box-shadow: inset 4px 0 0 #3b82f6; }
  100% { background: transparent; box-shadow: none; }
}
.stall-table td {
  padding: 14px 20px;
  vertical-align: middle;
  text-align: center;
}
.stall-table td:first-child { text-align: left; }

.stall-no-cell { color: #94a3b8; font-size: 16px; font-weight: 400; }
.stall-no-badge {
  display: inline-block;
  background: #eef2ff;
  color: var(--primary);
  font-weight: 600;
  font-size: 15px;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: monospace;
}
.stall-name-cell { font-weight: 600; color: var(--dark); font-size: 17px; text-align: left; }
.stall-name-sub { font-size: 14px; color: var(--gray); margin-top: 2px; font-weight: 400; }
.stall-time-cell {
  font-size: 16px;
  color: var(--dark);
  white-space: nowrap;
}

/* Phone button */
.stall-phone-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 50%;
  font-size: 16px;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.stall-phone-btn:hover { background: #16a34a; color: #fff; transform: scale(1.1); }

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-badge.open { background: #dcfce7; color: #166534; }
.status-badge.closed { background: #fee2e2; color: #991b1b; }
.status-badge.holiday { background: #fef3c7; color: #92400e; }
.status-badge.allday { background: #dbeafe; color: #1e40af; }
.status-badge i { font-size: 11px; }

/* Empty / No result */
.no-stalls-msg {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
}
.no-stalls-msg i { font-size: 48px; color: var(--border); display: block; margin-bottom: 14px; }
.no-stalls-msg p { font-size: 16px; }

/* Highlight search */
mark { background: #fde68a; color: var(--dark); border-radius: 3px; padding: 0 2px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .shops-hero { height: 100px; }
  .shops-hero h1 { font-size: 22px; }
  .zones-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  .zone-detail-header-inner { gap: 10px; }
  .zone-detail-name { font-size: 18px; }
  .stall-toolbar-inner { gap: 8px; }
  .stall-table th, .stall-table td { padding: 11px 12px; }
}
@media (max-width: 480px) {
  .zones-grid { grid-template-columns: 1fr 1fr; }
  .zone-card-img { height: 100px; font-size: 36px; }
  .zone-card-name { font-size: 15px; }
  .stall-filter-btns { display: none; }
}
