/**
 * Ajándéktárgy szerkesztő – UI fix (cache-bust külön fájl)
 * Betöltés: index.php INLINE + ez a fájl új URL-lel
 */

/* ---- Bögre: teljes szélességű vízszintes Bal | Közép | Jobb ---- */
#mugMessage.mug-bar {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 6px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

#mugMessage .mug-bar-caption {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #65676b !important;
  padding: 0 4px 2px !important;
  flex: none !important;
}

#mugMessage .mug-bar-track {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  width: 100% !important;
  min-height: 36px !important;
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
  flex: none !important;
}

#mugMessage .mug-bar-track > .mug-left,
#mugMessage .mug-bar-track > .mug-center,
#mugMessage .mug-bar-track > .mug-right {
  flex: 1 1 0% !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 9px 6px !important;
  margin: 0 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-radius: 0 !important;
  border: none !important;
  border-left: none !important;
  border-right: none !important;
  float: none !important;
  position: static !important;
  height: auto !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  cursor: default !important;
  box-sizing: border-box !important;
}

#mugMessage .mug-bar-track > .mug-left {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%) !important;
  color: #9a3412 !important;
  border-right: 1px dashed rgba(234, 88, 12, 0.4) !important;
}

#mugMessage .mug-bar-track > .mug-center {
  background: #ffffff !important;
  color: #1c1e21 !important;
  border-right: 1px dashed rgba(234, 88, 12, 0.4) !important;
  box-shadow: inset 0 -3px 0 #ff6600 !important;
}

#mugMessage .mug-bar-track > .mug-right {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%) !important;
  color: #9a3412 !important;
}

/* Régi chip / stacked layout tiltása */
#mugMessage .mug-bar-label,
#mugMessage .mug-segments {
  display: none !important;
}

/* ---- Gomb hierarchia ---- */
button.btn-upload,
#uploadTrigger.btn-upload {
  background: #ff6600 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 10px rgba(255, 102, 0, 0.28) !important;
}

button.btn-grid,
#toggleGridButton.btn-grid,
button.btn-auto,
#autoArrangeButton.btn-auto {
  background: #fff !important;
  color: #4b5563 !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

#autoArrangeButton.btn-auto:disabled {
  background: #f3f4f6 !important;
  color: #9ca3af !important;
  border-color: #e5e7eb !important;
}

button.delete-all-button,
.delete-all-button {
  background: transparent !important;
  color: #dc2626 !important;
  border: none !important;
  box-shadow: none !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
}

/* ---- Objektum eszköztár: világos ---- */
.obj-buttons {
  display: grid !important;
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

.obj-buttons button {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  color: #374151 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  flex-direction: column !important;
  padding: 9px 4px !important;
}

.obj-buttons button i,
.obj-buttons button small {
  color: #6b7280 !important;
}

.obj-buttons button:hover {
  background: #fff7ed !important;
  border-color: #fdba74 !important;
}

.obj-buttons button:hover i {
  color: #ff6600 !important;
}

#deleteObject {
  background: #fff5f5 !important;
  border-color: #fecaca !important;
}

#deleteObject i,
#deleteObject small {
  color: #dc2626 !important;
}

@media (max-width: 1100px) {
  .obj-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* ---- CTA: kosár zöld, mentés semleges ---- */
button.btn-cart,
#exportButton.btn-cart,
#exportButtonMobile.btn-cart {
  background: #2f9e3a !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(47, 158, 58, 0.3) !important;
}

button.btn-save,
#saveButton.btn-save {
  background: #fff !important;
  color: #374151 !important;
  border: 1px solid #d1d5db !important;
}

button.btn-load,
#openSavedProductsButton.btn-load {
  background: transparent !important;
  color: #6b7280 !important;
  border: 1px solid transparent !important;
}

button.btn-change-product,
#changeProductBtn.btn-change-product {
  background: #fff !important;
  color: #4b5563 !important;
  border: 1px solid #d1d5db !important;
}

.editor-action-bar {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 10px !important;
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

.save-actions {
  display: flex !important;
  gap: 6px !important;
  margin-top: 0 !important;
}

/* Lebegő kosár – ha a sáv elhagyja a képernyőt */
.ajt-floating-cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: auto;
  z-index: 9990;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 10px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e5e7eb;
  border-top: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.ajt-floating-cart-bar.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.ajt-floating-cart-bar.is-hidden-by-modal,
.ajt-floating-cart-bar.is-hidden-by-modal.is-visible {
  transform: translateY(-110%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.modalcart {
  z-index: 10050 !important;
}
.ajt-floating-cart-btn {
  width: 100% !important;
  max-width: 720px;
  margin: 0 auto !important;
  display: flex !important;
}
.ajt-floating-cart-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.ajt-floating-cart-actions .btn-preview,
.ajt-floating-cart-actions .btn-cart {
  flex: 1 1 0;
  min-width: 0;
}
.ajt-floating-cart-actions .btn-cart { order: 1; }
.ajt-floating-cart-actions .btn-preview { order: 2; }
.cart-actions .btn-cart { order: 1; }
.cart-actions .btn-preview { order: 2; }
.cart-actions {
  display: flex !important;
  gap: 8px !important;
}
@media (min-width: 900px) {
  .cart-actions {
    flex-direction: column !important;
  }
}
@media (max-width: 899px) {
  .cart-actions {
    flex-direction: row !important;
  }
  #previewButton.desktop-only-cart,
  #exportButton.desktop-only-cart {
    display: none !important;
  }
}
.btn-preview {
  background: #fff !important;
  color: #374151 !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer !important;
}
html.ajt-cart-floating body {
  padding-top: 0;
  padding-bottom: 0;
}

@media (min-width: 900px) {
  .ajt-floating-cart-bar {
    left: auto;
    right: 18px;
    top: 18px;
    bottom: auto;
    width: min(360px, calc(100vw - 36px));
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    transform: translateY(-110%);
  }
  .ajt-floating-cart-bar.is-visible {
    transform: translateY(0);
  }
  .ajt-floating-cart-btn {
    box-shadow: 0 10px 28px rgba(47, 158, 58, 0.35) !important;
    border-radius: 12px !important;
  }
  .ajt-floating-preview-btn {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12) !important;
    border-radius: 12px !important;
    background: #fff !important;
  }
  html.ajt-cart-floating body {
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Vágás modal – viewportba férő, arányos kép */
.modal_vagas.is-open {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
  overflow: auto;
}
.modal-content_vagas {
  margin: 0 auto !important;
  max-width: 560px !important;
  width: 100% !important;
  max-height: calc(100dvh - 24px) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  box-sizing: border-box !important;
}
.crop-image-wrap {
  width: 100%;
  height: min(62vh, calc(100dvh - 150px));
  min-height: 180px;
  overflow: hidden;
  background: #f3f4f6;
  border-radius: 10px;
  position: relative;
}
.crop-image-wrap img,
#imageToCrop {
  display: block;
  max-width: 100%;
  max-height: 100%;
  height: auto;
}
.crop-image-wrap .cropper-container {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
}
#confirmCrop {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: #ff6600;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.canvas-container {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08) !important;
  border: 1px solid #e5e7eb !important;
}

.ajt-desktop-tabs .ajt-tab-btn.active,
.ajt-mobile-tabs .ajt-tab-btn.active,
.ajt-tab-btn.active {
  background: #ff6600 !important;
  border-color: #ff6600 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.22) !important;
}

/* Welcome lépések – átláthatóbb */
.canvas-welcome-steps {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px 8px !important;
}
.canvas-welcome-hint {
  margin-top: -2px !important;
}

/* Mentett termékek – függőleges, átlátható lista */
.saved-products-modal {
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px 40px;
  background: rgba(15, 23, 42, 0.55) !important;
}
.saved-products-modal[style*="flex"],
.saved-products-modal[style*="block"] {
  display: flex !important;
}
.saved-products-list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  max-height: min(62vh, 560px) !important;
  -webkit-overflow-scrolling: touch !important;
}
@media (min-width: 700px) {
  .saved-products-list {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
.saved-product-item {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  cursor: pointer !important;
}
.saved-product-item.is-selected {
  border-color: #ff6600 !important;
  box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.18) !important;
}
.saved-products-toolbar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 0 10px !important;
  padding: 10px 12px !important;
  background: #f8fafc !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
}
.saved-bulk-delete-btn {
  border: none !important;
  border-radius: 8px !important;
  background: #dc2626 !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  height: 36px !important;
  padding: 0 12px !important;
  cursor: pointer !important;
}
.saved-bulk-delete-btn:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
}
.saved-select-wrap {
  position: absolute !important;
  top: 8px !important;
  left: 8px !important;
  z-index: 3 !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  background: rgba(255,255,255,0.94) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.saved-product-media {
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  min-height: 0 !important;
  background: #eef2f7 !important;
  overflow: hidden;
  flex: none !important;
}
.saved-product-media img,
.saved-product-item > img {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  object-fit: cover !important;
  display: block !important;
}
.saved-product-meta {
  padding: 10px 12px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.saved-product-date {
  color: #64748b !important;
  font-size: 12px !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}
.saved-product-item > .delete-button {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  width: 32px !important;
  height: 32px !important;
  border: none !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,0.92) !important;
  color: #dc2626 !important;
  z-index: 2 !important;
}
.saved-product-buttons,
.saved-product-buttons .open-button {
  display: none !important;
}
.saved-products-load-info,
.canvas-welcome-hint {
  display: none !important;
}

/* Mobil: kompaktabb eszköztár + kevesebb zaj */
@media (max-width: 899px) {
  .obj-buttons button {
    padding: 8px 2px !important;
    min-height: 52px;
  }
  .obj-buttons button small {
    font-size: 9px !important;
  }
  .ajt-mobile-tabs .ajt-tab-btn {
    padding: 9px 6px !important;
    font-size: 12px !important;
  }
  .panel-card-header {
    padding: 9px 10px !important;
  }
  .editor-action-bar {
    gap: 6px !important;
    padding: 8px !important;
  }
}
