/* Shop quick preview: keep long package details reachable on short screens. */
@media (min-width: 761px) {
  .shop-quick-preview__dialog {
    box-sizing: border-box;
    height: min(760px, calc(100vh - 48px));
    height: min(760px, calc(100dvh - 48px));
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    min-height: 0;
  }

  /* Desktop: reserve the footer and let the package area consume the remaining height. */
  .shop-quick-preview__content {
    box-sizing: border-box;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .shop-quick-preview__summary {
    flex: 0 0 auto;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
  }

  /* Description always expands naturally; scrolling is reserved for the package list. */
  .shop-quick-preview__description {
    flex: 0 0 auto;
    max-height: none;
    margin-bottom: 12px;
    padding: 10px 14px;
    overflow: visible;
    font-size: 14px;
    line-height: 1.5;
  }

  /* The package panel grows/shrinks with the viewport. Its list scrolls only when needed. */
  .shop-quick-preview__package {
    flex: 1 1 0;
    min-height: 0;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
  }

  .shop-quick-preview__package .shop-package-list {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .shop-quick-preview__package .shop-package-item { padding: 6px 8px; }
  .shop-quick-preview__package .shop-package-item__icon { width: 38px; height: 38px; }
  .shop-quick-preview__package .shop-package-item__icon img { max-width: 34px; max-height: 34px; }

  /* Original footer position: price left, add-to-cart right, always kept inside the viewport. */
  .shop-quick-preview__footer {
    position: static;
    z-index: auto;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding-top: 4px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: transparent;
    box-shadow: none;
  }
  .shop-quick-preview__footer .shop-card__price { justify-content: flex-start; width: auto; margin: 0; text-align: left; }
  .shop-quick-preview__footer form { position: static; width: auto; min-width: 160px; margin: 0; }
  .shop-quick-preview__footer form .shop-button { position: static; box-sizing: border-box; width: 160px; min-width: 0; margin: 0; padding: 10px 12px; white-space: nowrap; }
}

@media (max-width: 760px) {
  .shop-quick-preview__dialog { grid-template-rows: auto minmax(0,1fr);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);min-height:0;overflow:hidden; }
  .shop-quick-preview__content { min-height:0;overflow-y:auto;overscroll-behavior:contain; }
  .shop-quick-preview__footer { position:sticky;bottom:0;z-index:6;margin-bottom:0;padding-top:12px;padding-bottom:4px;background:#171b21;box-shadow:0 -14px 22px rgba(23,27,33,.96); }
  .shop-quick-preview__footer form,.shop-quick-preview__footer form .shop-button { position:static;width:100%;margin:0; }
}

@media (min-width:761px) and (max-height:700px) {
  .shop-quick-preview { padding:12px; }
  .shop-quick-preview__dialog {
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .shop-quick-preview__content { padding-top:24px;padding-bottom:12px; }
}

.shop-equipment-tooltip { position:fixed;z-index:10050;box-sizing:border-box;width:300px;max-width:calc(100vw - 24px);padding:16px 17px;border:1px solid rgba(213,179,107,.5);border-radius:12px;background:rgba(18,21,27,.98);box-shadow:0 18px 48px rgba(0,0,0,.58);color:#d8dce3;pointer-events:none; }
.shop-equipment-tooltip__name { margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid rgba(255,255,255,.08);color:#f0d18a;font-size:16px;font-weight:800; }
.shop-equipment-tooltip__ac { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px; }
.shop-equipment-tooltip__ac span,.shop-equipment-tooltip__label { color:#949ca8;font-size:12px;letter-spacing:.04em; }
.shop-equipment-tooltip__ac strong { color:#f1cf82;font-size:15px; }
.shop-equipment-tooltip__label { margin-bottom:7px; }
.shop-equipment-tooltip__stats { display:grid;gap:5px; }
.shop-equipment-tooltip__stats>div { display:flex;align-items:baseline;justify-content:space-between;gap:18px;line-height:1.45; }
.shop-equipment-tooltip__stats span { color:#d5d9e0; }
.shop-equipment-tooltip__stats strong { color:#e8c982;white-space:nowrap; }
.shop-equipment-tooltip__features { display:grid;gap:6px;margin:0 0 13px;color:#d5d9e0;font-size:13px;line-height:1.5; }
.shop-equipment-tooltip__features>div { padding:7px 9px;border:1px solid rgba(255,255,255,.07);border-radius:7px;background:rgba(255,255,255,.025); }
.shop-equipment-tooltip__loading,.shop-equipment-tooltip__empty { color:#8f97a3;font-size:13px; }
.shop-equipment-tooltip__empty--spaced { margin-bottom:13px; }
.shop-package-item.is-equipment .shop-package-item__name { color:#f0d18a; }

@media (hover:none), (max-width:760px) {
  .shop-equipment-tooltip--mobile { left:12px!important;right:12px!important;top:auto!important;bottom:12px!important;width:auto;max-width:none;max-height:min(70vh,520px);overflow-y:auto;padding:18px 18px 20px;border-radius:16px;box-shadow:0 -12px 42px rgba(0,0,0,.72);pointer-events:auto; }
  .shop-equipment-tooltip--mobile .shop-equipment-tooltip__name { padding-right:36px; }
  .shop-equipment-tooltip__close { position:absolute;right:10px;top:8px;width:34px;height:34px;padding:0;border:0;background:transparent;color:#d8dce3;font-size:26px;line-height:34px;text-align:center;cursor:pointer; }
}
