/* Quick-buy modal — light theme */
.qv-modal {
  z-index: 1085;
}

.qv-modal .modal-dialog {
  max-width: 920px;
  margin: 1.25rem auto;
}

.qv-modal .modal-content {
  border: 0;
  border-radius: 1.25rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
}

.qv-modal .modal-body {
  padding: 0;
  background: #fff;
}

.qv-modal-backdrop {
  z-index: 1080;
  backdrop-filter: blur(6px);
  background: rgba(15, 23, 42, 0.35) !important;
}

body.modal-open .app-bottom-nav {
  visibility: hidden;
  pointer-events: none;
}

body.modal-open .go-to,
body.modal-open .js-go-to {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.qv-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  min-height: 520px;
  color: #0f172a;
}

.qv-panel__media {
  position: relative;
  background: linear-gradient(165deg, #f8fafc 0%, #eef2f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  overflow: hidden;
  border-left: 1px solid #e8edf3;
}

.qv-panel__glow {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 110, 253, 0.1), transparent 70%);
}

.qv-panel__media img {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  max-height: 360px;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(15, 23, 42, 0.12));
}

.qv-panel__badges {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 2;
}

.qv-badge {
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
}

.qv-badge--sale {
  background: #ef4444;
  color: #fff;
}

.qv-badge--ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.qv-panel__content {
  background: #fff;
  padding: 1.35rem 1.4rem 1.25rem;
  display: flex;
  flex-direction: column;
}

.qv-panel__eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0d6efd;
  margin-bottom: 0.45rem;
}

.qv-panel__cat {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.qv-panel__title {
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.65;
  color: #0f172a;
  margin: 0 0 0.55rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qv-panel__rating {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  color: #f59e0b;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.qv-panel__rating span {
  color: #64748b;
  margin-right: 0.35rem;
  font-weight: 700;
}

.qv-option {
  margin-bottom: 0.9rem;
}

.qv-option__label {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 0.45rem;
}

.qv-option__label span {
  color: #0d6efd;
  font-weight: 700;
}

.qv-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.qv-color {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 2px solid #e2e8f0;
  box-shadow: inset 0 0 0 2px #fff;
  cursor: pointer;
}

.qv-color.is-active {
  border-color: #0d6efd;
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px rgba(13, 110, 253, 0.2);
}

.qv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.qv-chip {
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 0.65rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.qv-chip.is-active {
  border-color: #0d6efd;
  color: #1d4ed8;
  background: #eff6ff;
}

.qv-chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qv-warranty {
  display: grid;
  gap: 0.4rem;
}

.qv-warranty__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.8rem;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  background: #f8fafc;
}

.qv-warranty__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.qv-warranty__item strong {
  display: block;
  font-size: 0.82rem;
  color: #0f172a;
}

.qv-warranty__item small {
  display: block;
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 0.1rem;
}

.qv-warranty__item > span {
  font-size: 0.75rem;
  font-weight: 800;
  color: #0d6efd;
  white-space: nowrap;
}

.qv-warranty__item.is-active {
  border-color: #0d6efd;
  background: #f8fbff;
}

.qv-panel__footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid #eef2f7;
}

.qv-price {
  margin-bottom: 0.75rem;
}

.qv-price__label {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.qv-price strong {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
}

.qv-price del {
  margin-right: 0.45rem;
  color: #94a3b8;
  font-size: 0.85rem;
}

.qv-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
}

.qv-qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
}

.qv-qty button {
  width: 2.3rem;
  height: 2.55rem;
  border: 0;
  background: #f8fafc;
  color: #334155;
  font-size: 1.1rem;
  font-weight: 700;
}

.qv-qty input {
  width: 2.5rem;
  height: 2.55rem;
  border: 0;
  text-align: center;
  background: #fff;
  color: #0f172a;
  font-weight: 800;
}

.qv-add {
  border: 0;
  border-radius: 0.75rem;
  background: #0d6efd;
  color: #fff;
  font-weight: 900;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.55rem;
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.22);
}

.qv-add:hover {
  background: #0b5ed7;
  color: #fff;
}

.qv-close {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 5;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.qv-close:hover {
  color: #0f172a;
  border-color: #cbd5e1;
}

.qv-loading {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  background: #fff;
  gap: 0.65rem;
  font-weight: 700;
}

.qv-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid #dbe4f0;
  border-top-color: #0d6efd;
  border-radius: 50%;
  animation: qv-spin 0.7s linear infinite;
}

@keyframes qv-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 767.98px) {
  .qv-modal {
    padding: 0 !important;
  }

  .qv-modal .modal-dialog {
    margin: 0;
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    align-items: flex-end;
  }

  .qv-modal .modal-content {
    border-radius: 1.15rem 1.15rem 0 0;
    max-height: min(92dvh, 100%);
    height: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.2);
  }

  .qv-modal .modal-body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
  }

  .qv-panel {
    grid-template-columns: 1fr;
    min-height: 0;
    max-height: min(92dvh, 100%);
    display: flex;
    flex-direction: column;
  }

  .qv-panel__media {
    flex: 0 0 auto;
    min-height: 148px;
    max-height: 28vh;
    padding: 1rem 1rem 0.75rem;
    border-left: 0;
    border-bottom: 1px solid #e8edf3;
  }

  .qv-panel__media img {
    max-height: min(150px, 22vh);
    width: min(100%, 220px);
  }

  .qv-panel__badges {
    top: 0.75rem;
    right: 0.75rem;
  }

  .qv-close {
    top: 0.65rem;
    left: 0.65rem;
    width: 2.4rem;
    height: 2.4rem;
  }

  .qv-panel__content {
    border-top: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 1rem 1rem calc(0.35rem + env(safe-area-inset-bottom, 0));
  }

  .qv-panel__title {
    font-size: 0.98rem;
    -webkit-line-clamp: 2;
  }

  .qv-option {
    margin-bottom: 0.75rem;
  }

  .qv-panel__footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-top: 0.35rem;
    padding: 0.75rem 0 calc(0.35rem + env(safe-area-inset-bottom, 0));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, #fff 28%);
    border-top: 1px solid #eef2f7;
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
  }

  .qv-price {
    margin-bottom: 0.55rem;
  }

  .qv-price strong {
    font-size: 1.2rem;
  }

  .qv-actions {
    grid-template-columns: auto 1fr;
    gap: 0.45rem;
  }

  .qv-qty {
    width: 100%;
  }

  .qv-add {
    min-height: 2.7rem;
    font-size: 0.9rem;
  }

  .qv-loading {
    min-height: 280px;
  }
}

@media (max-width: 767.98px) and (max-height: 640px) {
  .qv-panel__media {
    min-height: 110px;
    max-height: 22vh;
    padding: 0.75rem;
  }

  .qv-panel__media img {
    max-height: 110px;
  }

  .qv-panel__eyebrow {
    display: none;
  }
}
