@use '../utils/base' as *;

/* store */
.place-module-container {
}
.place-module-outer {
  max-width: rem(1660);
  height: rem(700);
  margin: 0 auto;
  padding: 0 rem(30);
}
.place-title {
  margin-bottom: rem(10);
  padding: rem(10) 0;
}

/* 매장 검색 폼 */
.place-finder {
  width: rem(420);
  margin-bottom: rem(30);
}
.place-finder-form {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: rem(10);

  .form-element {
    height: rem(50);
    padding: 0 rem(20);
    border-color: rgba($almost-black, 0.2);
    border-style: solid;
    border-width: 1px;
    background-color: transparent;
    &::placeholder {
      color: $almost-black;
    }
  }
  .input-container {
    gap: rem(10);
    .text-input {
      flex-grow: 1;
    }
  }
  .btn-place-finder {
    width: rem(80);
    padding: 0;
    background-color: $almost-black;
    color: $almost-white;
  }
  .select-input {
    appearance: none;
    background: url('/assets/img/components/store/icon-chevron.svg') no-repeat
      right rem(20) center/rem(14) rem(8);
  }
  .select-input-narrow {
    width: 50%;
  }
  .select-container select:last-child {
    margin-left: -1px;
  }
}

/* 매장 지도 */
.place-map {
  position: absolute;
  right: 0;
  top: 0;
  width: calc(100% - rem(450));
  height: 100%;
  background-color: $almost-black;
}

/* 매장 목록 */
.place-result {
  overflow-y: scroll;
  overflow-x: hidden;
  width: rem(420);
  height: rem(498);
}
.place-items {
  margin-right: rem(20);
}
.place-item {
  padding: rem(24) rem(20);
  border-bottom: 1px solid rgba($almost-black, 0.2);
}
// button → a 로 바뀌었다(크롤러가 따라갈 실제 링크 제공). 기존 버튼과 같은 모양을 유지한다.
.btn-open-place-modal {
  display: block;
  width: 100%;
  text-align: left;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
// 매장 개별 페이지 링크 목록: AJAX 목록과 별개로 서버에서 렌더해 색인 경로를 만든다.
.place-index-links {
  margin-top: rem(16);
  > summary {
    cursor: pointer;
    color: rgba($almost-black, 0.6);
  }
  ul {
    margin-top: rem(8);
    max-height: rem(240);
    overflow-y: auto;
  }
  a {
    color: rgba($almost-black, 0.8);
  }
}
.place-modal-more {
  margin-top: rem(8);
  .place-modal-more-link {
    text-decoration: underline;
  }
}
.place-name-distance {
  margin-bottom: rem(16);
}
.place-address {
  position: relative;
  min-height: rem(20);
  padding-left: rem(20);
  color: rgba($almost-black, 0.6);
  &::before {
    @include bg-cover;
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: rem(14);
    height: rem(19);
    background-image: url('/assets/img/components/store/icon-location.svg');
  }
}
.custom-scrollbar {
  &::-webkit-scrollbar {
    width: rem(4);
  }
  &::-webkit-scrollbar-track {
    background: rgba($almost-black, 0.2);
  }
  &::-webkit-scrollbar-thumb {
    background: $almost-black;
  }
}

/* 매장 상세 정보 모달 창 */
.place-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: $zindex-modal;
  width: rem(1200);
  border-radius: rem(30);
  background-color: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 rem(20) rgba($almost-black, 0.4);
}
.place-modal-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: rem(50);
  width: rem(900);
  margin: 0 auto;
  padding: rem(50) 0;
}

.place-modal-area-left {
  flex-shrink: 0;
  display: flex;
  gap: rem(30);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.place-naver-logo {
  img {
    height: rem(150);
  }
}
.place-naver-icon {
  display: inline-flex;
  align-items: center;
  height: rem(50);
  padding: 0 rem(20);
  border-radius: rem(25);
  background-color: #2db400;
  font-weight: 700;
  color: $white;
  box-shadow: 0 rem(4) rem(4) rgba($almost-black, 0.4);
}
.place-naver-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: rem(12);
}

.place-modal-area-center {
  // flex-grow: 1;
}
.place-modal-title {
  // font-size: rem(30);
  display: flex;
  align-items: center;
  gap: rem(10);
  font-weight: 700;
  margin-bottom: rem(10);
}
.place-modal-sns-list {
  display: inline-flex;
  width: rem(24);
}
.place-modal-distance {
  // font-size: rem(20);
  font-weight: 700;
}
.place-modal-hr {
  margin: rem(30) 0 rem(20);
  height: 1px;
  background-color: $gray;
}
.place-info-items {
  display: flex;
  flex-direction: column;
  gap: rem(10);
  padding-right: rem(50);
  // font-size: rem(20);
  color: $almost-black;
}
.place-info-item {
  display: flex;
}
.place-info-label {
  flex-shrink: 0;
  width: rem(100);
}
.place-info-text {
  line-height: $line-height-base;
}

.place-modal-area-right {
  flex-shrink: 0;
}
.place-deli-pc {
  display: flex;
  gap: rem(15);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.place-deli-m {
  display: none;
}
.place-deli-cards {
  position: relative;
  width: rem(200);
  height: rem(200);
  border-radius: rem(50);
  box-shadow: 0 0 rem(15) rgba($almost-black, 0.2);
  overflow: hidden;
}
.place-deli-card {
  position: absolute;
  inset: 0;
  perspective: rem(1000);
  pointer-events: none;
  &.is-active {
    pointer-events: auto;
  }
}
.place-deli-card-img {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.3s;
  transform: rotateY(180deg);
  backface-visibility: hidden;
  .is-active & {
    transform: rotateY(0deg);
  }
  canvas {
    display: block;
    width: 100%;
    height: 100%;
  }
}
.place-deli-qr-temp {
  width: 100%;
  height: 100%;
  background-color: #000;
}
.place-deli-text {
  // font-size: rem(16);
  font-weight: 700;
  text-align: center;
  color: $gray;
}
.place-deli-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: rem(20);
}
.place-deli-icon {
  padding: rem(5);
  border-radius: rem(15);
  background-color: transparent;
  transition: background-color 0.3s;
  &:hover {
    background-color: $primary-color;
  }
  &.is-active {
    background-color: $primary-color;
  }
}
.place-deli-btn {
  width: rem(50);
  height: rem(50);
  img {
    display: block;
    max-width: 100%;
    max-height: 100%;
  }
}
.place-deli-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: rem(20);
  padding-top: rem(20);
  border-top: 1px solid $almost-black;
}
.place-deli-link-btn {
  display: block;
  width: rem(50);
  height: rem(50);
  img {
    display: block;
    max-width: 100%;
    max-height: 100%;
  }
}

.place-modal-content {
  display: flex;
  justify-content: space-between;
}
.place-modal-link-logo {
  width: rem(120);
  margin-right: auto;
  margin-left: auto;
  margin-bottom: rem(20);
}
.place-info-icon {
  width: rem(40);
  height: rem(25);
  padding-top: rem(6);
  text-align: center;
  img {
    width: auto;
    height: 100%;
  }
}
.btn-place-modal-close {
  position: absolute;
  right: rem(30);
  top: rem(30);
  padding: rem(10);
  img {
    width: rem(20);
    height: rem(20);
  }
}

@media screen and (max-width: $breakpoint-lg) {
  .place-module-outer {
    width: 100%;
    padding-right: 0;
    padding-left: 3.90625%;
  }
  .place-finder,
  .place-result {
    width: 47.42%;
  }
  .place-map {
    width: 49.47%;
  }
  .place-modal {
    // right: 0;
    // left: 0;
    // margin-right: auto;
    // margin-left: auto;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
  }
  .place-modal-inner {
    flex-wrap: wrap;
    width: 90%;
  }
  .place-modal-area-center {
    order: -1;
    width: 100%;
  }
}

@media screen and (max-width: $breakpoint-md) {
  .place-module-container {
    padding: rem(0) 0 rem(60);
  }
  .place-module-outer {
    height: auto;
    width: 92.1875%;
    margin: 0 auto;
    padding-left: 0;
  }
  .place-finder {
    width: 100%;
    margin-bottom: rem(10);
  }
  .place-finder-form {
    .form-element {
      height: rem(40);
    }
    .select-input {
      background-position: right rem(10) center;
      background-size: rem(8) rem(4);
    }
    .btn-place-finder {
      width: rem(64);
    }
  }
  .place-map {
    position: relative;
    width: 100vw;
    height: vw(280, sm);
    margin-bottom: rem(16);
    margin-left: vw(-14, sm);
  }
  .place-result {
    width: 100%;
    height: auto;
    max-height: rem(498);
    background-color: transparent;
    border: 0;
  }
  .place-item {
    padding: rem(20) rem(20);
  }
  .place-address {
    min-height: 0;
    padding-left: rem(12);
    &::before {
      width: rem(8);
      height: rem(11);
      background-size: 100% 100%;
    }
  }
  .place-modal {
    position: fixed;
    right: 0;
    left: 0;
    width: 92.1875vw;
    margin: 0 auto;
    transform: translateY(-50%);
  }
  .place-modal-inner {
    flex-direction: column;
    gap: rem(20);
    padding: rem(20) 0;
  }
  .place-modal-hr {
    margin: rem(10) 0;
  }
  .place-info-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: baseline;
    padding-top: rem(2);
    width: rem(20);
    img {
      width: 50%;
    }
  }
  .place-modal-area-left {
    gap: rem(20);
    flex-direction: row;
    justify-content: start;
    width: rem(190);
    margin: 0 auto;
  }
  .place-naver-logo {
    img {
      height: rem(50);
    }
  }
  .place-deli-text {
    margin-bottom: rem(10);
  }
  .place-naver-links {
    align-items: start;
    gap: rem(2);
  }
  .place-naver-icon {
    height: auto;
    padding: 0;
    background-color: transparent;
    color: $almost-black;
    box-shadow: none;
  }
  .btn-place-modal-close {
    right: rem(10);
    top: rem(10);
    width: rem(36);
    img {
      width: 100%;
    }
  }
  .place-deli-pc {
    display: none;
  }
  .place-deli-m {
    display: block;
  }
}
