@import "./stores-base.css";

/* 포인트 컬러: 사이트 브랜드 컬러를 사용합니다. 참고 화면처럼 바꾸려면 이 값만 교체하세요. */
.store-hub {
  --store-accent: var(--green, #f45140);
  --store-accent-soft: var(--green-soft, #fff0ed);
}

.store-explorer {
  min-height: 670px;
  height: 670px;
  grid-template-columns: 460px minmax(0, 1fr);
  overflow: hidden;
  border-radius: 14px;
}

.store-browser-panel {
  min-height: 0;
  overflow: hidden;
  border-radius: 13px 0 0 13px;
}

.store-map-panel {
  min-height: 0;
  overflow: hidden;
  border-radius: 0 13px 13px 0;
}

/* 검색 방식 탭 */
.store-search-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 0 0 auto;
  border-bottom: 1px solid #dedfe2;
}

.store-search-tabs button {
  position: relative;
  height: 64px;
  border: 0;
  background: transparent;
  color: #6f747b;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.03em;
  cursor: pointer;
}

.store-search-tabs button:hover { color: #202225; }

.store-search-tabs button.active {
  color: var(--store-accent);
  font-weight: 800;
}

.store-search-tabs button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--store-accent);
}

/* 검색 입력 줄 */
.store-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 68px;
  gap: 8px;
  flex: 0 0 auto;
  padding: 22px 20px 6px;
}


.store-search-row select,
.store-search-row input {
  width: 100%;
  height: 50px;
  border: 1px solid #d9dce0;
  border-radius: 6px;
  background: #fff;
  padding: 0 12px;
  color: #33373c;
  font-size: 14px;
  outline: none;
}

.store-search-row select:focus,
.store-search-row input:focus { border-color: var(--store-accent); }
.store-search-row select:disabled { background: #f6f7f8; color: #a0a4a9; }

.store-search-row > button {
  height: 50px;
  border: 0;
  border-radius: 6px;
  background: var(--store-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.store-search-row > button:hover { background: var(--green-dark, #d83c2f); }

/* 취급 복권 */
.store-lottery-filter {
  flex: 0 0 auto;
  padding: 16px 20px 0;
}

.store-lottery-filter h3,
.store-result-title {
  margin: 0;
  color: #111;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.store-lottery-filter > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.store-lottery-filter button {
  height: 30px;
  border: 1px solid #d9dce0;
  border-radius: 15px;
  background: #fff;
  padding: 0 11px;
  color: #33373c;
  font-size: 12px;
  cursor: pointer;
}

.store-lottery-filter button:hover { border-color: var(--store-accent); }

.store-lottery-filter button.active {
  border-color: var(--store-accent);
  background: var(--store-accent-soft);
  color: var(--store-accent);
  font-weight: 800;
}

/* 검색결과 */
.store-result-title {
  flex: 0 0 auto;
  margin: 20px 20px 0;
  padding-bottom: 9px;
  border-bottom: 1px solid #202225;
}

.store-result-title span { margin-left: 4px; color: var(--store-accent); }

.store-result-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 14px 0 20px;
}

.store-result-list article {
  padding: 16px 0 14px;
  border-bottom: 1px solid #ececef;
}

.store-result-list article:last-child { border-bottom: 0; }

.store-result-list strong {
  display: block;
  color: #111;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.store-lottery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.store-lottery-tags span {
  border-radius: 4px;
  background: #eef2f8;
  padding: 3px 7px;
  color: #4b5666;
  font-size: 11px;
}

.store-result-list p {
  margin: 9px 0 0;
  color: #33373c;
  font-size: 13px;
}

.store-result-list b {
  display: block;
  margin-top: 7px;
  color: #111;
  font-size: 15px;
  font-weight: 600;
}

.store-empty {
  padding: 48px 0;
  color: #8a8f97;
  font-size: 13px;
  text-align: center;
}

/* 페이지네이션 */
.store-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 12px 0 14px;
  border-top: 1px solid #ececef;
}

.store-pagination button {
  min-width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: #4b5058;
  font-size: 15px;
  cursor: pointer;
}

.store-pagination button:hover { background: #f3f4f6; }

.store-pagination button.active {
  background: #202225;
  color: #fff;
  font-weight: 700;
}

.store-pagination button.arrow { border-color: #d9dce0; }

@media (max-width: 1200px) {
  .store-explorer { grid-template-columns: 420px minmax(0, 1fr); }
}

@media (max-width: 899px) {
  .store-hub {
    width: min(100% - 24px, 720px);
    padding-top: 22px;
    padding-bottom: 38px;
  }

  .store-explorer {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
  }

  .store-browser-panel {
    display: flex;
    border-right: 0;
    border-bottom: 1px solid #dedfe2;
    border-radius: 0;
  }

  .store-search-tabs button { height: 54px; font-size: 14px; }
  .store-search-row { padding: 16px 14px 4px; }
  .store-search-row select,
  .store-search-row input,
  .store-search-row > button { height: 46px; font-size: 14px; }
  .store-lottery-filter { padding: 14px 14px 0; }
  .store-result-title { margin: 18px 14px 0; }
  .store-result-list { max-height: min(48vh, 420px); padding: 0 14px; }

  .store-map-panel { min-height: 0; border-radius: 0; }
  .store-map-head { min-height: 0; align-items: flex-start; flex-direction: column; gap: 8px; padding: 18px 16px; }
  .store-map-head h2 { font-size: 18px; }
  .store-map-head p { font-size: 11px; }
  .store-map-canvas { min-height: clamp(380px, 112vw, 500px); }
  .store-map-visual { top: 6px; width: min(480px, calc(100% - 12px)); }
  .store-map-marker { min-width: 60px; min-height: 37px; padding: 5px 7px; }
  .store-map-marker strong { font-size: 9px; }
  .store-map-marker span { font-size: 7px; }
  .store-map-reset { top: 12px; left: 12px; min-height: 34px; padding: 0 12px; }
  .store-map-hover-card { top: 12px; right: 12px; min-width: 150px; padding: 11px 12px; }
  .store-map-hover-card strong { font-size: 14px; }
  .store-map-foot { min-height: 0; align-items: flex-start; flex-direction: column; gap: 4px; padding: 13px 16px; font-size: 10px; }
}

@media (max-width: 560px) {
  .store-search-row:not(.pair):not(.wide) { grid-template-columns: 1fr 1fr; }
  .store-search-row:not(.pair):not(.wide) > button { grid-column: 1 / -1; }
  .store-map-canvas { min-height: 360px; }
  .store-map-hover-card { display: none; }
}

/* 조회 방식 전환 (주변 / 당첨 판매점) */
.store-mode-nav {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 5px;
  border: 1px solid #dedfe2;
  border-radius: 14px;
  background: #fff;
}

.store-mode-nav button {
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0 24px;
  color: #6f747b;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.03em;
  cursor: pointer;
}

.store-mode-nav button:hover { color: #202225; }
.store-mode-nav button.active { background: var(--store-accent); color: #fff; }

/* 당첨 판매점 조회: 복권/회차 선택 + 등수 탭 + 지역 칩 */


.store-winning-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 0 auto;
  margin-top: 14px;
  border-bottom: 1px solid #dedfe2;
}

.store-winning-tabs button {
  position: relative;
  height: 54px;
  border: 0;
  background: transparent;
  color: #6f747b;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.03em;
  cursor: pointer;
}

.store-winning-tabs button:hover { color: #202225; }
.store-winning-tabs button.active { color: var(--store-accent); font-weight: 800; }

.store-winning-tabs button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--store-accent);
}

.store-region-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 0 0 auto;
  padding: 16px 20px 0;
}

.store-region-chips button {
  height: 30px;
  border: 1px solid #d9dce0;
  border-radius: 15px;
  background: #fff;
  padding: 0 11px;
  color: #33373c;
  font-size: 12px;
  cursor: pointer;
}

.store-region-chips button:hover { border-color: var(--store-accent); }

.store-region-chips button.active {
  border-color: var(--store-accent);
  background: var(--store-accent-soft);
  color: var(--store-accent);
  font-weight: 800;
}

.store-lottery-tags span.rank { background: #eef2f8; color: #33373c; font-weight: 700; }

@media (max-width: 899px) {
  .store-mode-nav { display: flex; }
  .store-mode-nav button { flex: 1; padding: 0 8px; font-size: 14px; }
  .store-winning-tabs button { height: 48px; font-size: 15px; }
  .store-region-chips { padding: 14px 14px 0; }
}

/* 당첨 판매점 조회: 회차·순위 / 지역·검색 두 줄 구성 */
.store-search-row.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 0; }
.store-search-row.wide { grid-template-columns: minmax(0, 1fr) 68px; padding-top: 8px; padding-bottom: 6px; }

.store-search-row .round-select {
  height: 50px;
  border-color: #d9dce0;
  border-radius: 6px;
  padding: 0 36px 0 12px;
  color: #33373c;
  font-size: 14px;
  text-align: left;
}

.store-search-row .round-select-wrap::after { right: 16px; }
.store-search-row .round-select-wrap.is-open .round-select { border: 1px solid var(--store-accent); }

@media (max-width: 899px) {
  .store-search-row .round-select { height: 46px; }
}

/* 판매점 공용 토글 목록 (StoreSelect) */
.store-select { position: relative; min-width: 0; }
.store-select.is-open { z-index: 30; }

.store-select-button {
  position: relative;
  width: 100%;
  height: 50px;
  border: 1px solid #d9dce0;
  border-radius: 6px;
  background: #fff;
  padding: 0 38px 0 14px;
  color: #33373c;
  font: inherit;
  font-size: 15px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.store-select-button.is-placeholder { color: #8a8f97; }
.store-select-button:disabled { background: #f6f7f8; color: #a0a4a9; cursor: default; }
.store-select.is-open .store-select-button { border-color: var(--store-accent); }

.store-select-button::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #555;
  border-bottom: 1.5px solid #555;
  transform: translateY(-70%) rotate(45deg);
}

.store-select.is-open .store-select-button::after { transform: translateY(-30%) rotate(-135deg); }

.store-select-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 100%;
  max-height: 360px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  border: 1px solid #c9ccd1;
  background: #fff;
  box-shadow: 0 8px 20px rgba(32, 34, 37, .14);
}

.store-select-list li {
  padding: 9px 16px;
  color: #6f747b;
  font-size: 18px;
  line-height: 1.35;
  white-space: nowrap;
  cursor: pointer;
}

.store-select-list li:hover { background: #f1f3f5; }
.store-select-list li.is-selected { background: #1a66d6; color: #fff; }

.store-select-list::-webkit-scrollbar { width: 12px; }
.store-select-list::-webkit-scrollbar-track { background: #f4f5f6; }
.store-select-list::-webkit-scrollbar-thumb { border: 2px solid #f4f5f6; border-radius: 6px; background: #8c9096; }

@media (max-width: 899px) {
  .store-select-button { height: 46px; }
  .store-select-list li { font-size: 16px; }
}

/* 지도 패널: 상단/하단 텍스트 없이 지도만 꽉 채웁니다. */
.store-map-panel { display: block; }
.store-map-canvas { height: 100%; min-height: 0; }

@media (max-width: 899px) {
  .store-map-canvas { height: auto; min-height: clamp(380px, 112vw, 500px); }
}

@media (max-width: 560px) {
  .store-map-canvas { min-height: 360px; }
}

.store-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.store-title-row .store-lottery-tags { margin-top: 0; }

/* 지도를 패널 크기에 맞춰 최대한 크게 (데스크톱) */
@media (min-width: 900px) {
  .store-explorer { height: clamp(680px, calc(100vh - 120px), 900px); min-height: 680px; }
  .store-map-canvas { container-type: size; }
  .store-map-visual {
    top: 50%;
    width: calc(min(100cqw, 100cqh) - 12px);
    transform: translate(-50%, -50%);
  }
}

/* 모바일: 지도는 숨기고 목록/검색만 보여줍니다. */
@media (max-width: 899px) {
  .desktop-site .store-map-panel { display: none; }
  .desktop-site .store-explorer { border-bottom: 0; }
  .desktop-site .store-browser-panel { border-bottom: 0; }
  .desktop-site .store-result-list { max-height: none; padding-bottom: 8px; }
}
