.accordion-gallery {
  --ag-accent: #c5f15a;
  --ag-overlay: #06070b;
  --ag-text: #fff;
  --ag-gap: 10px;
  --ag-radius: 18px;
  --ag-media-size: 420px;
  display: flex;
  flex-direction: row;
  gap: var(--ag-gap);
  width: 100%;
  max-width: 100%;
  height: 440px;
  perspective: 1400px;
  perspective-origin: 50% 50%;
}

.accordion-gallery--vertical { flex-direction: column; }

.ag-panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: block;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--ag-radius);
  outline: none;
  background: #0a0b10;
  color: var(--ag-text);
  cursor: pointer;
  box-shadow: 0 18px 42px -28px rgba(0, 0, 0, .9);
  transform-style: preserve-3d;
  transform-origin: center;
  will-change: flex-grow, transform;
  -webkit-tap-highlight-color: transparent;
}

.ag-panel:hover,
.ag-panel--active { border-color: rgba(255, 255, 255, .23); }

.ag-panel:focus-visible {
  box-shadow: 0 0 0 2px var(--ag-accent), 0 18px 42px -28px rgba(0, 0, 0, .9);
}

.ag-panel__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: block;
  border-radius: inherit;
}

.ag-panel__media {
  --ag-gray: 1;
  --ag-dim: .35;
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--ag-media-size);
  height: 100%;
  filter: grayscale(var(--ag-gray));
  will-change: transform, filter;
}

.accordion-gallery--vertical .ag-panel__media {
  width: 100%;
  height: var(--ag-media-size);
}

.ag-panel__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.ag-panel__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, var(--accent-dark, #2f2449), #11131a 62%);
  font-size: clamp(20px, 2.7vw, 42px);
  font-weight: 850;
  letter-spacing: -.05em;
  text-align: center;
}

.ag-panel__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 35%, color-mix(in srgb, var(--ag-overlay) 88%, transparent) 100%),
    color-mix(in srgb, var(--ag-overlay) calc(var(--ag-dim, .35) * 100%), transparent);
}

.ag-panel__index,
.ag-panel__badge {
  position: absolute;
  z-index: 3;
  top: 18px;
  color: rgba(255, 255, 255, .7);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  pointer-events: none;
}

.ag-panel__index { left: 18px; }

.ag-panel__rail-name {
  position: absolute;
  z-index: 3;
  left: 18px;
  bottom: 20px;
  max-height: calc(100% - 84px);
  overflow: hidden;
  color: rgba(255, 255, 255, .88);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .045em;
  line-height: 1;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  opacity: .92;
  transition: opacity .25s ease, transform .4s ease;
  pointer-events: none;
}

.ag-panel--active .ag-panel__rail-name {
  opacity: 0;
  transform: rotate(180deg) translateY(-8px);
}

.ag-panel__badge {
  right: 18px;
  max-width: calc(100% - 62px);
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--ag-accent) 55%, transparent);
  border-radius: 999px;
  background: rgba(7, 8, 12, .68);
  color: var(--ag-accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.ag-panel__label {
  position: absolute;
  z-index: 2;
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: flex-end;
  gap: 13px;
  pointer-events: none;
}

.ag-panel__bar {
  flex: 0 0 auto;
  width: 3px;
  height: 50px;
  border-radius: 3px;
  background: var(--ag-accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--ag-accent) 60%, transparent);
  opacity: 0;
}

.ag-panel__caption {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 6px;
  opacity: 0;
}

.ag-panel__caption-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.ag-panel__text {
  min-width: 0;
  overflow: hidden;
  color: var(--ag-text);
  font-size: clamp(1.15rem, 2.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .65);
}

.ag-panel__price {
  flex: 0 0 auto;
  color: var(--ag-accent);
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .65);
}

.ag-panel__description {
  max-width: 510px;
  overflow: hidden;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 15px;
  color: #737680;
  font-size: 10px;
}

.gallery-hint strong { color: #bfc1c8; font-weight: 700; }

@media (max-width: 760px) {
  .accordion-gallery { height: 390px; }
  .ag-panel__description { display: none; }
}

@media (max-width: 620px) {
  .accordion-gallery {
    flex-direction: column;
    height: 680px;
    perspective: none;
  }
  .ag-panel { min-height: 78px; transform: none !important; }
  .accordion-gallery .ag-panel__media { width: 100%; height: var(--ag-media-size); }
  .ag-panel__label { left: 16px; right: 16px; bottom: 15px; }
  .ag-panel__bar { height: 38px; }
  .ag-panel__text { font-size: 1.15rem; }
  .ag-panel__price { font-size: 1rem; }
  .ag-panel__index, .ag-panel__badge { top: 12px; }
  .ag-panel__index { left: 14px; }
  .ag-panel__badge { right: 12px; }
  .ag-panel__rail-name {
    left: 16px;
    right: 16px;
    bottom: 14px;
    max-width: calc(100% - 32px);
    max-height: none;
    font-size: 12px;
    letter-spacing: .01em;
    writing-mode: horizontal-tb;
    transform: none;
  }
  .ag-panel--active .ag-panel__rail-name {
    opacity: 0;
    transform: translateY(7px);
  }
  .gallery-hint { display: block; line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  .ag-panel,
  .ag-panel__media { will-change: auto; }
}
