/* QR offcanvas popups — based on new_qr.html */

.qr-offcanvas .offcanvas-body,
.qr-offcanvas .offcanvas-header {
  font-family: 'Poppins', sans-serif;
}

.qr-offcanvas .offcanvas-header {
  padding: 16px 20px 0;
}

.qr-sheet-handle {
  width: 36px;
  height: 4px;
  background: #E0E0E0;
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.qr-sheet-close {
  width: 30px;
  height: 30px;
  background: #F2F2F2;
  border-radius: 50%;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.qr-sheet-close svg {
  width: 14px;
  height: 14px;
}

/* Fixed height — no jump when switching tabs */
#qrCode {
  --bs-offcanvas-height: min(580px, 92vh);
  height: min(680px, 92vh) !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column;
  overflow-x: hidden !important;
}

.qr-offcanvas-main .offcanvas-header {
  flex-shrink: 0;
}

.qr-offcanvas-main .offcanvas-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.qr-tab-panels-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.qr-offcanvas-main .qr-tab-panel {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: 20px 20px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.qr-offcanvas-main .qr-tab-panel::-webkit-scrollbar {
  display: none;
}

.qr-offcanvas-main .qr-tab-panel.active {
  display: flex;
}

.qr-sheet-title {
  font-size: 17px;
  font-weight: 600;
  color: #111;
}

.qr-sheet-tabs {
  display: flex;
  border-bottom: 1px solid #F0F0F0;
  margin: 16px 20px 0;
  gap: 0;
  flex-shrink: 0;
}

.qr-sheet-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 500;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.18s ease;
  user-select: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.qr-sheet-tab.active {
  color: #111;
  border-bottom-color: #111;
  font-weight: 600;
}

.qr-tab-panel {
  display: none;
  padding: 20px 20px 28px;
}

.qr-tab-panel.active {
  display: flex;
  flex-direction: column;
}

.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 20px;
}

.qr-block svg,
.qr-block img {
  width: 190px;
  height: 190px;
  max-width: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.qr-no-internet-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  background: #F6FFF8;
  border-radius: 12px;
  border: 1px solid #D1FAE5;
  width: 100%;
}

.qr-no-internet-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.qr-no-internet-icon svg {
  width: 18px;
  height: 18px;
}

.qr-no-internet-title {
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  margin-bottom: 3px;
}

.qr-no-internet-desc {
  font-size: 11px;
  color: #6B7280;
  line-height: 1.5;
  margin: 0;
}

.qr-action-list {
  display: flex;
  flex-direction: column;
}

.qr-action-row {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #F4F4F4;
  cursor: pointer;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
}

.qr-action-row:last-child {
  border-bottom: none;
}

.qr-action-row:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.qr-action-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qr-action-row-icon svg {
  width: 17px;
  height: 17px;
}

.qr-action-row-icon.blue {
  background: #EBF4FF;
}

.qr-action-row-icon.blue svg {
  stroke: #2E7FE0;
}

.qr-action-row-icon.green {
  background: #EDFAF3;
}

.qr-action-row-icon.green svg {
  stroke: #1A9E5C;
}

.qr-action-row-icon.purple {
  background: #F3EFFE;
}

.qr-action-row-icon.purple svg {
  stroke: #7C3AED;
}

.qr-action-row-icon.orange {
  background: #FFF4E8;
}

.qr-action-row-icon.orange svg {
  stroke: #E07B1A;
}

.qr-action-row-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #1A1A1A;
}

.qr-action-row-label.copied {
  color: #059669;
}

.qr-action-row-chevron svg {
  width: 13px;
  height: 13px;
  opacity: 0.25;
}

/* Lock page scroll while QR sheets are open */
html.qr-popup-open,
body.qr-popup-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Customize sheet */
#customize_qrCode.offcanvas-bottom {
  --bs-offcanvas-height: min(640px, 92vh);
  height: min(750px, 92vh) !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column;
  overflow-x: hidden !important;
}

#customize_qrCode .offcanvas-header {
  flex-shrink: 0;
}

#customize_qrCode .offcanvas-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.qr-cust-header {
  display: none;
}

.qr-cust-title {
  font-size: 16px;
  font-weight: 600;
  color: #111;
}

.qr-cust-body {
  padding: 20px 20px 32px;
  min-width: 0;
  overflow-x: hidden;
}

.qr-cust-qr-preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #F0F0F0;
  background: #fff;
  margin: 0 -20px 20px;
  flex-shrink: 0;
}

#qrcode_customize {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  line-height: 0;
}

.qr-cust-qr-preview #qrcode_customize svg,
.qr-cust-qr-preview #qrcode_customize canvas {
  width: 140px !important;
  height: 140px !important;
  max-width: 140px !important;
  max-height: 140px !important;
  display: block;
}

#qrcode_export {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}

#qrcode_saving {
  font-size: 14px;
  font-weight: 500;
  color: #111;
  margin-top: 10px;
}

.qr-cust-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  min-width: 0;
}

.qr-cust-row-label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
  width: 58px;
  flex-shrink: 0;
}

.qr-chip-group {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.qr-chip-group::-webkit-scrollbar {
  display: none;
}

.qr-style-chip {
  flex: 1;
  min-width: 58px;
  height: 58px;
  border: 1.5px solid #EBEBEB;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
  background: #FAFAFA;
  margin: 0;
}

.qr-style-chip.active {
  border-color: #4A90D9;
  background: #F0F7FF;
}

.qr-style-chip img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.qr-cust-divider {
  height: 1px;
  background: #F4F4F4;
  margin: 4px 0 20px;
}

.qr-add-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  border: 1.5px dashed #DDD;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #999;
  cursor: pointer;
  margin-bottom: 12px;
}

.qr-add-logo svg {
  width: 16px;
  height: 16px;
}

.qr-remove-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  border: 1.5px solid #FECACA;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #E53535;
  cursor: pointer;
  margin-bottom: 20px;
  background: #FFF5F5;
  width: 100%;
}

.qr-color-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.qr-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.qr-swatch:active {
  transform: scale(0.92);
}

.qr-swatch.active::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.qr-swatch-rainbow {
  background: conic-gradient(
    #FF0000, #FF9500, #FFFF00, #34C759,
    #007AFF, #AF52DE, #FF2D55, #FF0000
  );
}

.qr-swatch-rainbow.open::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.qr-hex-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid #EBEBEB;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 0;
  transition: border-color 0.15s;
}

.qr-hex-trigger.open {
  border-color: #EBEBEB;
  border-radius: 12px 12px 0 0;
  border-bottom: none;
}

.qr-hex-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.qr-hex-value {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  font-family: 'Poppins', sans-serif;
  flex: 1;
  text-transform: uppercase;
}

.qr-hex-chevron {
  transition: transform 0.2s ease;
}

.qr-hex-chevron svg {
  width: 14px;
  height: 14px;
}

.qr-color-picker-panel {
  border: 1px solid #EBEBEB;
  border-top: none;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  margin-bottom: 20px;
  display: none;
  background: #fff;
  padding: 12px 14px 14px;
}

.qr-color-picker-panel.open {
  display: block;
}

.qr-cust-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.qr-cust-btn {
  flex: 1;
  padding: 15px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
}

.qr-cust-btn.reset {
  border: 1.5px solid #EBEBEB;
  color: #E53535;
  background: #fff;
}

.qr-cust-btn.save {
  background: #111;
  color: #fff;
}

#final_qr_img {
  display: none !important;
}

#customize_qrCode #qr_code_color {
  width: 100%;
  max-width: 100%;
}

#customize_qrCode #qr_code_color .IroColorPicker {
  margin: 0 auto;
  width: 100% !important;
}

#customize_qrCode #qr_code_color .IroBox {
  margin: 0 auto 14px;
  border-radius: 14px;
  overflow: hidden;
}

#customize_qrCode #qr_code_color .IroBox svg {
  display: block;
  border-radius: 14px;
}

#customize_qrCode #qr_code_color .IroSlider {
  margin: 0 auto;
  height: 18px !important;
  border-radius: 999px;
  overflow: hidden;
}

#customize_qrCode #qr_code_color .IroSlider svg {
  display: block;
  border-radius: 999px;
}

#customize_qrCode #qr_code_color .IroHandle {
  top: -11px !important;
  left: -11px !important;
  width: 22px !important;
  height: 22px !important;
}

#customize_qrCode #qr_code_color .IroHandle circle:first-child {
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 2;
}

#qr_logo_section {
  margin-bottom: 20px;
}

#qr_logo_section .croppie {
  margin: 0 auto;
}

#qr_logo_section .qr-crop-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

#qr_logo_section .qr-crop-actions .qr-cust-btn {
  flex: unset;
  padding: 12px 20px;
  font-size: 13px;
}
