/* modal.css — product detail modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: stretch;
  justify-content: center;
}
.modal[aria-hidden="false"] { display: flex; }

.modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal .modal-panel {
  position: relative;
  z-index: 1;
  background: #fff;
  width: 100%;
  max-width: 70rem;
  margin: auto 0 0;
  max-height: 95vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr;
  animation: modalIn 0.25s var(--ease);
}

@media (min-width: 834px) {
  .modal .modal-panel {
    margin: auto;
    max-height: 90vh;
    grid-template-columns: 1.2fr 1fr;
  }
}

@keyframes modalIn {
  from { transform: translateY(2rem); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal .modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.modal .modal-close svg { width: 0.875rem; height: 0.875rem; }

.modal .modal-gallery {
  background: var(--color-bg-alt);
  display: flex;
  flex-direction: column;
}
.modal .gallery-main {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  touch-action: pan-y;
}
.modal .gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.2s ease;
}

/* Prev/next overlay arrows */
.modal .gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  border: 0;
  cursor: pointer;
  font-size: 1.75rem;
  line-height: 1;
  transition: background 0.2s var(--ease);
  z-index: 2;
}
.modal .gallery-nav:hover,
.modal .gallery-nav:focus-visible { background: #fff; }
.modal .gallery-nav-prev { left: 0.75rem; }
.modal .gallery-nav-next { right: 0.75rem; }

/* Counter badge */
.modal .gallery-counter {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.25rem 0.625rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 400;
  z-index: 2;
}

.modal .gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  overflow-x: auto;
}
.modal .gallery-thumbs button {
  flex: 0 0 auto;
  width: 5.5rem;
  height: 4.125rem;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 2px solid transparent;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.2s var(--ease), border-color 0.2s var(--ease);
}
.modal .gallery-thumbs button img {
  width: 100%; height: 100%; object-fit: cover;
}
.modal .gallery-thumbs button.active { opacity: 1; border-color: #111; }
.modal .gallery-thumbs button:hover { opacity: 1; }

@media (max-width: 833px) {
  .modal .gallery-nav { width: 2.25rem; height: 2.25rem; font-size: 1.5rem; }
}

.modal .modal-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 834px) {
  .modal .modal-info { padding: 2.5rem; }
}

.modal .modal-info h2 {
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.modal .modal-info .meta {
  color: var(--color-muted);
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.03em;
}
.modal .modal-info .price-block {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--color-border-soft);
  border-bottom: 1px solid var(--color-border-soft);
}
.modal .modal-info .price-eur {
  font-size: 1.25rem;
  font-weight: 400;
  color: #000;
}
.modal .modal-info .price-converted {
  font-size: 0.875rem;
  color: var(--color-muted);
}
.modal .modal-info .variant-select label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.modal .modal-info .variant-select span {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.modal .modal-info .variant-select select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border-soft);
  background: #fff;
  font-size: 0.9375rem;
  cursor: pointer;
}

.modal .modal-info .description {
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.7;
  color: #333;
  white-space: pre-wrap;
}

.modal .modal-loading {
  padding: 3rem;
  text-align: center;
  color: var(--color-muted);
  grid-column: 1 / -1;
}
