.qv-modal[hidden] {
  display: none !important;
}

.qv-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.qv-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 14, .48);
  backdrop-filter: blur(4px);
}

.qv-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(28, 25, 23, .22);
}

.qv-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #f4f1ec;
  color: #1c1917;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qv-modal__close:hover {
  background: var(--color-primary);
  color: #fff;
}

.qv-modal__loading,
.qv-modal__error {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b645c;
  font-size: 15px;
  gap: 10px;
}

.qv-modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 0;
}

.qv-modal__media {
  background: #f6f3ee;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.qv-modal__media img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
}

.qv-modal__thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.qv-modal__thumb {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid #e4ddd3;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
}

.qv-modal__thumb.is-active {
  border-color: var(--color-primary);
}

.qv-modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qv-modal__info {
  padding: 36px 40px 32px 32px;
}

.qv-modal__cat {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8a8278;
}

.qv-modal__info h2 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 800;
  color: #1c1917;
}

.qv-modal__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
  margin-bottom: 16px;
}

.qv-modal__price strong {
  font-size: 26px;
  font-weight: 800;
  color: var(--color-primary-dark, #c41e24);
}

.qv-modal__price span {
  font-size: 13px;
  color: #8a8278;
}

.qv-modal__desc {
  margin: 0 0 22px;
  font-size: 14.5px;
  line-height: 1.65;
  color: #5c564e;
}

.qv-modal__meta {
  margin: 0 0 20px;
  font-size: 13px;
  color: #8a8278;
}

.qv-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.qv-modal__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e4ddd3;
  border-radius: 999px;
  overflow: hidden;
}

.qv-modal__qty button {
  width: 38px;
  height: 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #1c1917;
}

.qv-modal__qty input {
  width: 48px;
  height: 42px;
  border: 0;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}

.qv-modal__add {
  flex: 1 1 160px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--color-primary, #c41e24);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.qv-modal__add:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.qv-modal__more {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #e4ddd3;
  color: #1c1917;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

html.has-qv-open {
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .qv-modal {
    padding: 12px;
    align-items: flex-end;
  }

  .qv-modal__dialog {
    max-height: 92vh;
    border-radius: 18px 18px 12px 12px;
  }

  .qv-modal__grid {
    grid-template-columns: 1fr;
  }

  .qv-modal__media {
    min-height: 220px;
    padding: 20px 20px 8px;
  }

  .qv-modal__info {
    padding: 20px 20px 24px;
  }

  .qv-modal__info h2 {
    font-size: 20px;
    padding-right: 36px;
  }
}
