/* GACHA MALL app/mobile fixes: anchored search modal, WebView ticker, compact hero. */

#gm2-floor-searchbtn {
  display: none;
}

.gm2-ticker-track.gm3-js-ticker {
  animation: none !important;
  backface-visibility: hidden;
  will-change: transform;
}

#gm2-floor-search-scrim {
  position: fixed;
  z-index: 2147482000;
  inset: 0;
  background: rgba(14, 11, 25, .46);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  touch-action: none;
  overscroll-behavior: contain;
  transition: opacity .16s ease, visibility 0s linear .16s;
}

#gm2-floor-search-dialog {
  position: fixed;
  z-index: 2147482001;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: visible;
  box-sizing: border-box;
  padding: 16px;
  border: 1px solid rgba(69, 51, 105, .15);
  border-radius: 20px;
  background: #fff;
  color: #1d1929;
  box-shadow: 0 20px 56px rgba(25, 17, 44, .28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-7px) scale(.985);
  transform-origin: top right;
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}

#gm2-floor-search-dialog[data-placement="above"] {
  transform: translateY(7px) scale(.985);
  transform-origin: bottom right;
}

#gm2-floor-search-dialog::before {
  position: absolute;
  top: -6px;
  right: 23px;
  width: 12px;
  height: 12px;
  border-top: 1px solid rgba(69, 51, 105, .15);
  border-left: 1px solid rgba(69, 51, 105, .15);
  background: inherit;
  content: "";
  transform: rotate(45deg);
}

#gm2-floor-search-dialog[data-placement="above"]::before {
  top: auto;
  bottom: -6px;
  border: 0;
  border-right: 1px solid rgba(69, 51, 105, .15);
  border-bottom: 1px solid rgba(69, 51, 105, .15);
}

body.gm2-floor-search-open #gm2-floor-search-scrim,
body.gm2-floor-search-open #gm2-floor-search-dialog {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

body.gm2-floor-search-open #gm2-floor-search-dialog {
  transform: translateY(0) scale(1);
}

.gm2-floor-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.gm2-floor-search-head > div {
  display: grid;
  gap: 2px;
}

.gm2-floor-search-head small {
  color: #6d3bd1;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .15em;
}

.gm2-floor-search-head strong {
  color: inherit;
  font-size: 18px;
  line-height: 1.25;
}

.gm2-floor-search-close,
.gm2-floor-search-clear,
.gm2-floor-search-submit {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.gm2-floor-search-close {
  display: grid;
  place-items: center;
  padding: 0;
  background: #f2eff8;
  color: #514867;
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
}

.gm2-floor-search-form {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 44px auto;
  align-items: center;
  min-height: 54px;
  padding: 0 5px 0 15px;
  border: 2px solid #6d3bd1;
  border-radius: 17px;
  background: #faf9fd;
  box-shadow: 0 0 0 4px rgba(109, 59, 209, .08);
}

.gm2-floor-search-symbol {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border: 2px solid #6d3bd1;
  border-radius: 50%;
}

.gm2-floor-search-symbol::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 2px;
  border-radius: 2px;
  background: #6d3bd1;
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

#gm2-floor-search-input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1d1929;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
}

#gm2-floor-search-input::-webkit-search-cancel-button {
  display: none;
}

#gm2-floor-search-input::placeholder {
  color: #9790a6;
  font-weight: 600;
}

.gm2-floor-search-clear {
  display: none;
  padding: 0;
  background: transparent;
  color: #776e88;
  font-size: 22px;
}

#gm2-floor-search-dialog.has-value .gm2-floor-search-clear {
  display: grid;
  place-items: center;
}

.gm2-floor-search-submit {
  padding: 0 16px;
  background: #6d3bd1;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.gm2-floor-search-status {
  margin: 10px 2px 0;
  color: #777083;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
}

.gm2-floor-search-close:focus-visible,
.gm2-floor-search-clear:focus-visible,
.gm2-floor-search-submit:focus-visible,
#gm2-floor-search-input:focus-visible {
  outline: 3px solid rgba(192, 255, 42, .72);
  outline-offset: 2px;
}

html.gm-dark #gm2-floor-search-dialog {
  border-color: rgba(182, 166, 237, .22);
  background: #171424;
  color: #fff;
  box-shadow: 0 22px 64px rgba(0, 0, 0, .55);
}

html.gm-dark .gm2-floor-search-close {
  background: #28243a;
  color: #d6cfee;
}

html.gm-dark .gm2-floor-search-form {
  border-color: #c8ff35;
  background: #100e1a;
  box-shadow: 0 0 0 4px rgba(200, 255, 53, .09);
}

html.gm-dark .gm2-floor-search-symbol {
  border-color: #c8ff35;
}

html.gm-dark .gm2-floor-search-symbol::after {
  background: #c8ff35;
}

html.gm-dark #gm2-floor-search-input {
  color: #fff;
}

html.gm-dark #gm2-floor-search-input::placeholder,
html.gm-dark .gm2-floor-search-status {
  color: #9690aa;
}

html.gm-dark .gm2-floor-search-clear {
  color: #b9b1cd;
}

html.gm-dark .gm2-floor-search-submit {
  background: linear-gradient(180deg, #d9ff5e, #b7ef23);
  color: #171320;
}

@media (max-width: 900px) {
  html.gm-test2-page body.gm-test2-motion .floor-nav {
    --gm-shortcut-size: clamp(44px, 12vw, 52px);
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: clamp(4px, 2vw, 10px) !important;
  }

  html.gm-test2-page body.gm-test2-motion .floor-nav > .floor-nav__item:nth-of-type(2) {
    grid-column: 2 !important;
  }

  html.gm-test2-page body.gm-test2-motion .floor-nav > .floor-nav__item:nth-of-type(3) {
    grid-column: 3 !important;
  }

  html.gm-test2-page body.gm-test2-motion .floor-nav > .floor-nav__item:nth-of-type(4) {
    grid-column: 4 !important;
  }

  html.gm-test2-page body.gm-test2-motion .floor-nav #gm2-catsbtn {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  html.gm-test2-page body.gm-test2-motion #gm2-floor-searchbtn {
    grid-column: 5 !important;
    grid-row: 1 !important;
    display: flex !important;
    min-width: 0 !important;
    min-height: 52px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #6254a8 !important;
    -webkit-tap-highlight-color: transparent;
  }

  html.gm-test2-page body.gm-test2-motion .floor-nav__icon,
  html.gm-test2-page body.gm-test2-motion #gm2-catsbtn .gm2-sc-box,
  html.gm-test2-page body.gm-test2-motion #gm2-floor-searchbtn .gm2-floor-searchbox {
    display: grid !important;
    width: var(--gm-shortcut-size) !important;
    min-width: var(--gm-shortcut-size) !important;
    height: var(--gm-shortcut-size) !important;
    place-items: center !important;
    border: 1px solid rgba(73, 57, 112, .18) !important;
    border-radius: 16px !important;
    background: #fff !important;
    color: #6254a8 !important;
    box-shadow: 0 5px 16px rgba(31, 22, 55, .06) !important;
    transform: none !important;
  }

  html.gm-test2-page body.gm-test2-motion #gm2-floor-searchbtn svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
  }

  html.gm-test2-page body.gm-test2-motion #gm2-floor-searchbtn .gm2-floor-searchbox {
    position: relative !important;
  }

  html.gm-test2-page body.gm-test2-motion #gm2-floor-searchbtn[data-has-query="true"] .gm2-floor-searchbox::after {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #c8ff35;
    content: "";
    box-shadow: 0 1px 4px rgba(36, 29, 57, .24);
  }

  html.gm-test2-page body.gm-test2-motion #gm2-floor-searchbtn:focus-visible {
    outline: 3px solid rgba(109, 59, 209, .38) !important;
    outline-offset: 2px !important;
    border-radius: 17px !important;
  }

  html.gm-test2-page body.gm-test2-motion.gm2-floor-search-open #gm2-floor-searchbtn .gm2-floor-searchbox {
    border-color: #6d3bd1 !important;
    background: #6d3bd1 !important;
    color: #fff !important;
    box-shadow: 0 7px 18px rgba(109, 59, 209, .2) !important;
  }

  html.gm-dark.gm-test2-page body.gm-test2-motion #gm2-floor-searchbtn .gm2-floor-searchbox {
    border-color: rgba(111, 77, 190, .55) !important;
    background: #131122 !important;
    color: #b7abfa !important;
    box-shadow: none !important;
  }

  html.gm-dark.gm-test2-page body.gm-test2-motion.gm2-floor-search-open #gm2-floor-searchbtn .gm2-floor-searchbox {
    border-color: #d9ff5e !important;
    background: linear-gradient(180deg, #d9ff5e, #b7ef23) !important;
    color: #141221 !important;
    box-shadow: 0 0 0 2px rgba(217, 255, 94, .13), 0 0 20px rgba(199, 255, 50, .3) !important;
  }

  #gm-live-feed.gm2-ticker .gm2-ticker-clip {
    transform: translateZ(0);
  }

  html.gm-test2-page body.gm-test2-motion #gm2-hero.gm-mobile-carousel,
  html.gm-dark.gm-test2-page body.gm-test2-motion #gm2-hero.gm-mobile-carousel {
    height: clamp(260px, 40vw, 320px) !important;
    min-height: 0 !important;
    max-height: 320px !important;
    aspect-ratio: auto !important;
  }
}

@media (min-width: 901px) {
  #gm2-floor-search-scrim,
  #gm2-floor-search-dialog {
    display: none !important;
  }
}

@media (max-width: 520px) {
  html.gm-test2-page body.gm-test2-motion #gm2-hero.gm-mobile-carousel,
  html.gm-dark.gm-test2-page body.gm-test2-motion #gm2-hero.gm-mobile-carousel {
    height: clamp(248px, 58vw, 280px) !important;
    min-height: 0 !important;
    max-height: 280px !important;
    aspect-ratio: auto !important;
    margin: 6px 0 10px !important;
  }

  html.gm-test2-page body.gm-test2-motion #gm2-hero.gm-mobile-carousel .gm2-hero__content {
    width: 70% !important;
    max-width: 70% !important;
    padding: 14px 14px 26px !important;
  }

  html.gm-test2-page body.gm-test2-motion #gm2-hero.gm-mobile-carousel .gm2-hero__eyebrow {
    padding: 4px 8px !important;
    font-size: 8.5px !important;
  }

  html.gm-test2-page body.gm-test2-motion #gm2-hero.gm-mobile-carousel h1 {
    margin-top: 8px !important;
    font-size: clamp(20px, 5.7vw, 23px) !important;
    line-height: 1.06 !important;
  }

  html.gm-test2-page body.gm-test2-motion #gm2-hero.gm-mobile-carousel p {
    margin-top: 7px !important;
    -webkit-line-clamp: 2 !important;
    font-size: 10px !important;
    line-height: 1.4 !important;
  }

  html.gm-test2-page body.gm-test2-motion #gm2-hero.gm-mobile-carousel .gm2-hero__actions {
    margin-top: 9px !important;
  }

  html.gm-test2-page body.gm-test2-motion #gm2-hero.gm-mobile-carousel .gm2-hero__actions button {
    min-height: 32px !important;
    padding: 0 10px !important;
    font-size: 9.5px !important;
  }

  html.gm-test2-page body.gm-test2-motion #gm2-hero.gm-mobile-carousel .gm-mobile-carousel__dots {
    bottom: 8px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #gm2-floor-search-scrim,
  #gm2-floor-search-dialog {
    transition: none;
  }
}

/* 2026-08-19 iOS 포커스 자동확대 방지: 헤더 검색 입력은 16px 이상 */
@media (max-width: 820px) {
  input[placeholder="머신, 카테고리, 상품 검색"] { font-size: 16px; }
}
