/*
 * Module      : Scope (styles)
 * Description : Styles for the scope view: the fullscreen close-look overlay
 *               for a single piece, its media, head (EN/JP name and price),
 *               and detail rows.
 */

.scope {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}
.scope.active { pointer-events: auto; }

.scope-backdrop {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%),
    var(--bg-atmosphere);
  opacity: 0;
  transition: opacity 0.4s ease;
  cursor: pointer;
}
.scope.active .scope-backdrop { opacity: 1; animation: scopeBackdropIn 0.4s ease both; }
@keyframes scopeBackdropIn { from { opacity: 0; } to { opacity: 1; } }

.scope-reticle {
  position: absolute;
  top: 50%; left: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%) scale(0.96);
  pointer-events: none;
  border: none;
  border-radius: var(--radius-lg);
  opacity: 0; transition: opacity 0.4s ease, transform 0.4s ease;
}
.scope-reticle::before, .scope-reticle::after {
  content: ""; position: absolute;
  background: rgba(230, 181, 168,0.3);
}
.scope-reticle::before {
  left: 50%; top: -14px; bottom: -14px; width: 1px; transform: translateX(-50%);
}
.scope-reticle::after {
  top: 50%; left: -14px; right: -14px; height: 1px; transform: translateY(-50%);
}
.scope-corners {
  position: absolute; inset: -1px;
  pointer-events: none;
}
.scope-corners i {
  position: absolute; width: 18px; height: 18px;
  border: 2px solid var(--accent-cyan);
}
.scope-corners i.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.scope-corners i.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.scope-corners i.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.scope-corners i.br { bottom: 0; right: 0; border-left: none; border-top: none; }

.scope.active .scope-reticle { opacity: 1; transform: translate(-50%,-50%) scale(1); }

.scope-window {
  position: absolute;
  top: 50%; left: 50%;
  width: min(82vw, 1380px);
  height: min(72vh, 820px);
  max-height: calc(100vh - 200px);
  transform: translate(-50%, calc(-50% - 70px + 2vh));
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  filter: drop-shadow(0 30px 80px rgba(0,0,0,0.6));
  opacity: 0;
  transition: opacity 0.35s ease 0.1s;
}
.scope-window > .scope-media,
.scope-window > .scope-body {
  background: var(--panel-bg-solid);
  border: 1px solid var(--panel-border-hover);
  overflow: hidden;
}
.scope.active .scope-window { opacity: 1; animation: scopeWindowIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes scopeWindowIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% - 70px + 2vh)) scale(0.985); filter: blur(2px); }
  to   { opacity: 1; transform: translate(-50%, calc(-50% - 70px + 2vh)) scale(1);     filter: blur(0); }
}

.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 8px 0 32px;
}
.brand-card {
  text-align: left;
  padding: 22px 20px;
  background: rgba(20,8,12,0.55);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  color: var(--text-bright);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--font);
}
.brand-card:hover {
  background: rgba(40,16,22,0.7);
  border-color: var(--panel-border-hover);
  transform: translateY(-1px);
}
.brand-card-name {
  font-family: var(--font-title);
  font-size: 22px; font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-bright);
}
.brand-card-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}
.scope-window.scope-window--single {
  grid-template-columns: 1fr;
}

.scope-media {
  background: linear-gradient(180deg, #15304f, #091527);
  position: relative;
  display: flex; flex-direction: column;
}
.scope-hero {
  flex: 1;
  position: relative;
  background:
    repeating-linear-gradient(135deg, rgba(230, 181, 168,0.03) 0 10px, rgba(230, 181, 168,0.07) 10px 20px),
    linear-gradient(180deg, var(--water-top), var(--water-bot));
  display: flex; align-items: center; justify-content: center;
  color: rgba(200,220,240,0.4);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.15em;
  overflow: hidden;
}
.scope-hero.has-img { background: #000; }
.scope-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.scope-body {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}
.scope-head {
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--panel-border);
  display: flex; align-items: start; justify-content: space-between;
}
.scope-name {
  font-family: var(--font-title);
  font-size: 22px; font-weight: 500;
  color: var(--text-bright);
  letter-spacing: 0.04em;
  text-wrap: pretty;
  line-height: 1.15;
}
.scope-close {
  display: none;
  position: absolute; top: 10px; right: 12px;
  width: 28px; height: 28px;
  background: var(--chrome-panel);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  color: var(--text-mid);
  cursor: pointer;
  z-index: 5;
}
.scope-close:hover { color: var(--text-bright); border-color: var(--panel-border-hover); }

.scope-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 22px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(230, 181, 168,0.3) transparent;
}
.scope-scroll::-webkit-scrollbar { width: 6px; }
.scope-scroll::-webkit-scrollbar-thumb { background: rgba(230, 181, 168,0.3); border-radius: 3px; }

.scope-section { margin-bottom: 16px; }
.scope-section h4 {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px dashed var(--panel-border);
}
.size-btn {
  min-width: 44px; padding: 8px 10px;
  background: rgba(20,40,70,0.4);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  color: var(--text-mid);
  font-family: var(--font);
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.size-btn:hover { background: rgba(230, 181, 168,0.1); color: var(--text-bright); }
.size-btn.active {
  background: rgba(196, 216, 154,0.18);
  border-color: var(--ok);
  color: var(--ok);
}

.measure-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono); font-size: 22px;
}
.measure-table th, .measure-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(230, 181, 168,0.08);
  text-align: left;
}
.measure-table th { color: var(--text-dim); font-weight: 500; letter-spacing: 0.1em; }
.measure-table td { color: var(--text-bright); }
.measure-table tr:last-child td { border-bottom: none; }

.spec-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px 11px;
  font-size: 11px;
}
.spec-grid .k { color: var(--text-dim); letter-spacing: 0.04em; }
.spec-grid .v { color: var(--text-bright); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

.scope-cta {
  padding: 14px 22px;
  border-top: 1px solid var(--panel-border);
  display: flex; gap: 8px;
  background: rgba(5,11,20,0.5);
}
.btn {
  flex: 1;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.btn.primary {
  background: linear-gradient(135deg, var(--ok) 0%, #4f9a72 100%);
  color: #07140d;
  border-color: var(--ok);
}
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 0 22px rgba(196, 216, 154,0.35); }
.btn.ghost {
  background: transparent;
  border-color: var(--panel-border);
  color: var(--text-mid);
}
.btn.ghost:hover { color: var(--text-bright); border-color: var(--panel-border-hover); }
.btn.wide { flex: 2; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; filter: none; box-shadow: none; }

.scope.scope-product .scope-window {
  background: transparent;
  border: none;
}

.scope.scope-product .scope-window > .scope-media {
  background: transparent !important;
  border: none !important;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  position: relative;
}

.scope-product-stage {
  flex: 1;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 0;
}
.scope-product-imgbox {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scope-product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
}
.scope-product-empty {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: rgba(255, 248, 236, 0.7);
  text-align: center;
  padding: 24px;
  border: 1px dashed rgba(255, 248, 236, 0.35);
  border-radius: 4px;
}

.scope-product-chev {
  flex: 0 0 auto;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 58%;
  min-height: 96px;
  padding: 0;
  border: none;
  background: none;
  color: rgba(255, 248, 236, 0.6);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, transform 0.12s ease, opacity 0.2s ease;
}
.scope-product-chev svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
}
.scope-product-chev:hover:not([disabled]) { color: rgba(255, 248, 236, 0.98); }
.scope-product-chev:active:not([disabled]) { transform: scale(0.9); }
.scope-product-chev[disabled] { opacity: 0; pointer-events: none; }
.scope-product-segs {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  width: min(60%, 280px);
  margin: 12px auto 2px;
}
.scope-product-seg {
  flex: 1 1 0;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 248, 236, 0.22);
  transition: background 0.2s ease;
}
.scope-product-seg.is-active {
  background: rgba(255, 248, 236, 0.92);
}

.scope.scope-product .scope-window > .scope-body {
  background: #fff8ec;
  border-left: 1px solid #c9a08a;
  color: #2a1410;
  padding: 36px 40px 24px;
  display: flex;
  flex-direction: column;
}

.scope-product-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(201, 160, 138, 0.5);
  margin-bottom: 18px;
}
.scope-product-name {
  font-size: 33px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: #2a1410;
}
.scope-product-price {
  font-family: var(--font-mono);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  color: #6b4a3a;
  white-space: nowrap;
}

.scope-product-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
}

.scope-product-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  border-bottom: 1px dashed rgba(201, 160, 138, 0.35);
  padding-bottom: 10px;
}
.scope-product-k {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #b0907e;
  flex: 0 0 110px;
}
.scope-product-v {
  font-size: 20px;
  font-weight: 500;
  color: #2a1410;
  flex: 1;
  text-align: right;
}

.scope-product-desc {
  font-size: 17px;
  line-height: 1.6;
  color: #4a3024;
  margin-top: 4px;
  white-space: pre-wrap;
}

.scope-product-cta {
  margin-top: 20px;
  padding: 16px 0 4px;
  border-top: 1px solid rgba(201, 160, 138, 0.5);
  background: transparent;
  display: flex;
  gap: 12px;
}

.scope.scope-product .scope-product-cta .btn.ghost {
  background: transparent;
  border: 1px solid #c9a08a;
  color: #6b4a3a;
}
.scope.scope-product .scope-product-cta .btn.ghost:hover {
  background: rgba(201, 160, 138, 0.15);
  color: #2a1410;
}

.scope.scope-product .scope-close {
  color: #fff8ec;
  font-size: 28px;
}

@media (max-width: 960px) {
  .scope.scope-product .scope-window > .scope-media { padding: 18px 12px; }
  .scope.scope-product .scope-window > .scope-body { padding: 22px 22px 18px; }
  .scope-product-name { font-size: 26px; }
  .scope-product-price { font-size: 21px; }
  .scope-product-k { flex-basis: 86px; font-size: 12px; }
  .scope-product-v { font-size: 17px; }
  .scope-product-desc { font-size: 15px; }
  .scope-product-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .scope-product-row { flex-direction: column; gap: 4px; align-items: flex-start; }
  .scope-product-v { text-align: left; }
}

@media (max-width: 640px) {
  .scope.active .scope-window { animation: none; }
  .scope-window {
    position: absolute;
    display: flex;
    flex-direction: column;
    top: 0; left: 0;
    transform: none;
    width: 100%;
    height: 100%;
    max-height: 100%;
    gap: 12px;
    padding: 92px 10px 150px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .scope-window > .scope-body { order: 1; flex: 0 0 auto; overflow: visible; min-height: 0; }
  .scope-window > .scope-media { order: 2; flex: 0 0 auto; height: 56vh; min-height: 220px; }
  .scope-body { overflow: visible; }
  .scope-head { position: static; }
  .scope-scroll { overflow: visible; flex: 0 0 auto; }
  /* Product scope on mobile: photo first, full-bleed width, natural height
     (capped) so tall runway shots get their height back; arrows overlay the
     photo edges; segs stay beneath. Non-product scopes keep the old order. */
  .scope.scope-product .scope-window > .scope-media { order: 1; padding: 0; height: auto; }
  .scope.scope-product .scope-window > .scope-body { order: 2; }
  .scope.scope-product .scope-product-imgbox { height: auto; }
  .scope.scope-product .scope-product-img { height: auto; max-height: 74vh; }
  .scope.scope-product .scope-product-chev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 42%;
    min-height: 80px;
    width: 30px;
    z-index: 2;
  }
  .scope.scope-product .scope-product-chev:active:not([disabled]) { transform: translateY(-50%) scale(0.9); }
  .scope.scope-product .scope-product-chev:first-of-type { left: 2px; }
  .scope.scope-product .scope-product-chev:last-of-type { right: 2px; }
  .scope.scope-product .scope-product-segs { margin: 10px auto 4px; }

  .scope-window--filter {
    top: 96px; left: 8px; right: 8px; bottom: 10px;
    transform: none;
    width: auto;
    height: auto;
    max-height: none;
    padding: 0;
    overflow-y: visible;
  }
  .scope-window--filter .ff-foot { padding-left: 92px; padding-right: 52px; }
}

.scope-product-names {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.scope-product-name-ja {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: #6b4a3a;
}

.scope-window--filter {
  display: flex; flex-direction: column;
  width: min(560px, 92vw); max-width: 560px;
  max-height: 86vh;
}
.ff-title {
  font-family: var(--font-title);
  font-size: 22px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-bright);
  padding: 22px 26px 14px;
  border-bottom: 1px solid var(--panel-border);
}
.ff-scroll { flex: 1; overflow-y: auto; padding: 18px 26px; display: flex; flex-direction: column; gap: 22px; }
.ff-section { display: flex; flex-direction: column; gap: 10px; }
.ff-label {
  font-family: var(--font-title);
  font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-pink);
}
.ff-search, .ff-range input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--text-bright);
  font-family: var(--font); font-size: 17px;
  padding: 12px 14px; width: 100%;
}
.ff-search:focus, .ff-range input:focus { outline: none; border-color: var(--accent-pink); }
.ff-range { display: flex; align-items: center; gap: 10px; }
.ff-range input { flex: 1; min-width: 0; }
.ff-cur { font-size: 17px; color: var(--text-mid); font-family: var(--font-mono); }
.ff-dash { color: var(--text-dim); }
.ff-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ff-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: var(--text-mid);
  font-family: var(--font); font-size: 15px; font-weight: 500;
  padding: 8px 16px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ff-chip:hover { color: var(--text-bright); border-color: var(--panel-border-hover); }
.ff-chip.active { background: var(--accent-pink); border-color: var(--accent-pink); color: #1a0a10; }
.ff-empty { color: var(--text-dim); font-size: 14px; font-style: italic; }
.ff-foot {
  display: flex; gap: 10px; align-items: center;
  padding: 16px 26px;
  border-top: 1px solid var(--panel-border);
}
.ff-foot .btn { font-size: 15px; }
