/* =========================================================
 * [tv_home_locations] - Hệ thống Cơ sở (Trang chủ)
 * ========================================================= */

.tv-home-loc {
  padding: 80px 15px;
  background:
    var(--tv-home-bg) center / cover fixed no-repeat,
    #660000;
}

.tv-home-loc__inner {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  height: 650px;
}

/* ---- Sidebar (Desktop) ---- */
.tv-home-loc__sidebar {
  width: 320px;
  background: #f69320;
  padding: 40px 30px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.tv-home-loc__title {
  color: #1a1a1a;
  font-size: 42px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: -1px;
}

.tv-home-loc__desc {
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 30px;
}

.tv-home-loc__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
}
.tv-home-loc__menu::-webkit-scrollbar { display: none; }

.tv-home-loc__menu-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.tv-home-loc__menu-item:last-child { border-bottom: none; }

.tv-home-loc__menu-link {
  color: #333;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
}

.tv-home-loc__menu-link:hover { color: #000; }
.tv-home-loc__menu-link.is-active {
  font-weight: 800;
  color: #000;
}

.tv-home-loc__menu-count {
  font-size: 14px;
  opacity: 0.8;
}

/* Accordion toggle — desktop ẩn */
.tv-home-loc__accordion-btn {
  display: none;
}

/* ---- Content (Desktop) ---- */
.tv-home-loc__content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  background: #fff;
  position: relative;
  scroll-behavior: smooth;
}

.tv-home-loc__content::-webkit-scrollbar { width: 6px; }
.tv-home-loc__content::-webkit-scrollbar-track { background: #f1f1f1; }
.tv-home-loc__content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
.tv-home-loc__content::-webkit-scrollbar-thumb:hover { background: #aaa; }

.tv-home-loc__group {
  margin-bottom: 40px;
}
.tv-home-loc__group:last-child { margin-bottom: 0; }

.tv-home-loc__group-title {
  font-size: 16px;
  font-weight: 800;
  color: #333;
  text-transform: uppercase;
  margin: 0 0 20px;
  border-bottom: 2px solid #eee;
  padding-bottom: 8px;
}

.tv-home-loc__group-body {
  display: block;
}

.tv-home-loc__track {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---- Card ---- */
.tv-home-loc__card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
}
.tv-home-loc__card:last-child { border-bottom: none; }

.tv-home-loc__card-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.tv-home-loc__media {
  width: 140px;
  height: 110px;
  flex-shrink: 0;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

.tv-home-loc__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tv-home-loc__img--placeholder {
  background: #eee;
}

.tv-home-loc__status {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 4px;
  z-index: 2;
  letter-spacing: 0.2px;
}

.tv-home-loc__status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

.tv-home-loc__status.is-closed::before {
  background: #f87171;
}

.tv-home-loc__info {
  flex: 1;
  min-width: 0;
}

.tv-home-loc__card-title {
  font-size: 16px;
  font-weight: 800;
  color: #1a1a1a;
  margin: 0 0 6px;
  line-height: 1.35;
}

.tv-home-loc__subtitle {
  font-size: 13px;
  color: #666;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tv-home-loc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tv-home-loc__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  background: #f0f0f0;
  border-radius: 6px;
  color: #333;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  text-align: center;
}

.tv-home-loc__btn:hover {
  background: #e2e2e2;
}

/* Desktop — giữ layout danh sách dọc */
@media (min-width: 901px) {
  .tv-home-loc__card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 20px;
  }

  .tv-home-loc__card-top {
    flex: 1 1 100%;
  }

  .tv-home-loc__actions {
    flex: 1 1 100%;
    padding-left: 156px;
    margin-top: -4px;
  }

  .tv-home-loc__btn {
    flex: 0 1 auto;
  }
}

/* =========================================================
 * MOBILE — Accordion + carousel ngang
 * ========================================================= */
@media (max-width: 900px) {
  .tv-home-loc {
    padding: 40px 12px;
  }

  .tv-home-loc__inner {
    flex-direction: column;
    height: auto;
    border-radius: 10px;
    overflow: visible;
  }

  /* Header cam gọn */
  .tv-home-loc__sidebar {
    width: 100%;
    padding: 18px 20px;
    border-radius: 10px 10px 0 0;
  }

  .tv-home-loc__title {
    font-size: 28px;
    margin: 0;
    letter-spacing: -0.5px;
  }

  .tv-home-loc__desc,
  .tv-home-loc__menu {
    display: none !important;
  }

  /* Accordion list */
  .tv-home-loc__content {
    padding: 0;
    overflow: visible;
    max-height: none;
    background: #fff;
    border-radius: 0 0 10px 10px;
  }

  .tv-home-loc__group {
    margin-bottom: 0;
    border-bottom: 1px solid #ececec;
  }
  .tv-home-loc__group:last-child {
    border-bottom: none;
  }

  .tv-home-loc__group-title {
    display: none;
  }

  .tv-home-loc__accordion-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 18px;
    background: #fff;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    gap: 12px;
  }

  .tv-home-loc__accordion-name {
    font-size: 15px;
    font-weight: 800;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.2px;
  }

  .tv-home-loc__accordion-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: #555;
  }

  .tv-home-loc__accordion-count {
    font-size: 15px;
    font-weight: 600;
  }

  .tv-home-loc__accordion-chevron {
    transition: transform 0.25s ease;
    color: #888;
  }

  .tv-home-loc__group.is-open .tv-home-loc__accordion-chevron {
    transform: rotate(90deg);
  }

  .tv-home-loc__group-body {
    display: none;
    background: #f3f3f3;
    padding: 14px 0 16px;
  }

  .tv-home-loc__group.is-open .tv-home-loc__group-body {
    display: block;
  }

  /* Carousel ngang */
  .tv-home-loc__track {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 14px;
  }
  .tv-home-loc__track::-webkit-scrollbar { display: none; }

  .tv-home-loc__card {
    flex: 0 0 82%;
    max-width: 320px;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .tv-home-loc__card-top {
    gap: 12px;
    margin-bottom: 4px;
  }

  .tv-home-loc__media {
    width: 88px;
    height: 88px;
    border-radius: 8px;
  }

  .tv-home-loc__card-title {
    font-size: 13.5px;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .tv-home-loc__subtitle {
    font-size: 11.5px;
    -webkit-line-clamp: 2;
  }

  .tv-home-loc__status {
    font-size: 8px;
    padding: 2px 5px;
  }

  .tv-home-loc__actions {
    gap: 6px;
  }

  .tv-home-loc__btn {
    font-size: 10px;
    padding: 6px 4px;
    border-radius: 5px;
    flex: 1;
  }
}

@media (max-width: 380px) {
  .tv-home-loc__card {
    flex: 0 0 88%;
  }

  .tv-home-loc__btn {
    font-size: 9px;
    padding: 5px 3px;
  }
}
