/* GANGCHEOL MOBILE v13 — mobile-only, no functional JavaScript changes */
@media (max-width: 767px) {
  html,body { max-width:100%; overflow-x:clip; }
  *,*::before,*::after { box-sizing:border-box; }
  img,video,iframe { max-width:100%; }
  /* Existing hamburger/menu behavior remains controlled by the site's own CSS/JS */
  .gc-topline { font-size:10px; }
  .gc-topline-inner { padding-inline:12px; gap:6px; }
  .gc-topline-links { gap:9px; }
  .site-header .header-main { padding:10px 12px; min-width:0; gap:8px; }
  .site-header .gc-brand { display:flex; align-items:center; min-width:0; flex:0 1 auto; gap:7px; }
  .site-header .gc-brand-symbol { flex-shrink:0; }
  .site-header .gc-brand-symbol img { max-width:37px; max-height:37px; }
  .site-header .gc-brand-copy { min-width:0; }
  .site-header .gc-brand-title { font-size:clamp(16px,4.3vw,20px); line-height:1.18; }
  .site-header .gc-brand-en { font-size:8px; letter-spacing:.07em; }
  .site-header .gc-header-tag { display:none !important; }
  .site-header .header-actions { display:flex; align-items:center; justify-content:flex-end; gap:5px; min-width:0; margin-left:auto; }
  .site-header .header-actions .icon-btn,
  .site-header .header-actions .btn-track { min-width:36px; min-height:38px; padding:7px 8px; border-radius:9px; white-space:nowrap; }
  .site-header .header-actions .icon-btn svg,
  .site-header .header-actions .btn-track svg { flex-shrink:0; }
  .site-header .header-actions .cart-badge { font-size:10px; }
  .site-header .main-nav .wrap { -webkit-overflow-scrolling:touch; }
  /* All main containers respect the phone width. */
  main .wrap { max-width:100%; padding-left:14px; padding-right:14px; }
  main h1 { line-height:1.3; }
  /* Product grids: only enhance actual grid patterns, never create a grid on generic wrappers */
  main :is(.products-grid,.product-grid,.product-list-grid,.gc-products-grid) {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px;
  }
  main :is(.products-grid,.product-grid,.product-list-grid,.gc-products-grid) > * { min-width:0; }
  main :is(.product-card,.product-item,.gc-product-card) { min-width:0; overflow:hidden; border-radius:12px; }
  main :is(.product-card,.product-item,.gc-product-card) img { display:block; width:100%; height:auto; object-fit:contain; }
  main :is(.product-card,.product-item,.gc-product-card) :is(.product-name,.product-title,.item-title) {
    font-size:12px; line-height:1.42; overflow-wrap:anywhere;
    display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden;
  }
  main :is(.product-card,.product-item,.gc-product-card) :is(.price,.product-price,.sale-price) { font-size:14px; font-weight:800; }
  main :is(.product-card,.product-item,.gc-product-card) :is(.buy-btn,.btn-buy,.product-buy) { min-height:39px; width:100%; }
  /* checkout.php confirmed selectors: keep POST fields, address lookup, gift modal and order calculations intact */
  form.checkout { display:grid !important; grid-template-columns:minmax(0,1fr) !important; gap:18px !important; }
  form.checkout > div,form.checkout > aside.order-summary { width:100% !important; min-width:0; max-width:100%; }
  form.checkout .gc-purchase-mode { padding:15px; border-radius:14px; margin-bottom:20px; }
  form.checkout .gc-mode-title { font-size:18px!important; }
  form.checkout .gc-mode-grid { gap:9px; }
  form.checkout .gc-mode-card { padding:13px 10px; min-width:0; }
  form.checkout .gc-mode-card b { font-size:15px; }
  form.checkout .gc-mode-card small { font-size:11px; line-height:1.4; }
  form.checkout :is(input,select,textarea) { max-width:100%; }
  form.checkout .field > :is(input,select,textarea),
  form.checkout .field > div > input { min-height:44px; font-size:16px; }
  form.checkout .form-row { min-width:0; gap:10px; }
  form.checkout .form-row > * { min-width:0; }
  form.checkout .ship-opt { display:grid; grid-template-columns:1fr; gap:9px; }
  form.checkout .ship-opt label { display:block; min-height:55px; }
  form.checkout .order-summary { border-radius:14px; padding:17px 15px; }
  form.checkout .os-item { min-width:0; gap:9px; }
  form.checkout .os-item .nm { min-width:0; overflow-wrap:anywhere; }
  form.checkout .os-total { font-weight:800; }
  form.checkout button[type="submit"] { min-height:49px; border-radius:10px; font-weight:800; }
  /* Cart drawer: preserve its existing open/close mechanism */
  :is(#cartDrawer,#cartPanel,#cartSidebar,.cart-drawer,.cart-panel,.cart-sidebar) {
    max-width:100vw !important; width:min(100vw,430px) !important;
  }
  /* Improve modal sizing without interfering with hidden state or onclick logic */
  .gift-modal { width:min(94vw,520px); max-height:90dvh; }
  #addrLayer:not([hidden]) { width:calc(100vw - 22px)!important; max-height:calc(100dvh - 26px)!important; }
  /* Generic footers: readability only; do not duplicate/rebuild footer markup */
  footer { overflow-wrap:anywhere; }
}
@media (max-width: 390px) {
  .site-header .header-main { gap:5px; padding-inline:8px; }
  .site-header .header-actions { gap:3px; }
  .site-header .header-actions :is(.icon-btn,.btn-track) { padding-inline:6px; min-width:32px; }
  .site-header .gc-brand-title { font-size:16px; }
  .site-header .gc-brand-en { font-size:7px; }
  main .wrap { padding-inline:10px; }
  main :is(.products-grid,.product-grid,.product-list-grid,.gc-products-grid) { gap:8px; }
  form.checkout .gc-mode-grid { gap:7px; }
}
@media (prefers-reduced-motion:reduce) {
  .site-header .header-actions * { transition:none!important; }
}
