/* Page Editor Floating Toolbar */
.page-editor-toolbar-container {
  z-index: 1030 !important; /* Below Bootstrap Modal backdrop (1050) & dialog (1055) */
  background: rgba(27, 59, 43, 0.95) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(200, 155, 60, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: all 0.3s ease;
}

.page-editor-toolbar-container .text-gold {
  color: #C89B3C !important;
}

.z-max {
  z-index: 1030 !important;
}

/* Edit Mode Highlighting & Outlines */
body.page-editor-editing [contenteditable="true"] {
  outline: 1.5px dashed rgba(200, 155, 60, 0.6) !important;
  outline-offset: 2px !important;
  transition: outline 0.2s ease, background-color 0.2s ease;
  cursor: text !important;
}

body.page-editor-editing [contenteditable="true"]:hover {
  outline: 2px solid #C89B3C !important;
  background-color: rgba(200, 155, 60, 0.08) !important;
  border-radius: 4px;
}

body.page-editor-editing [contenteditable="true"]:focus {
  outline: 2px solid #1B3B2B !important;
  background-color: rgba(27, 59, 43, 0.05) !important;
  border-radius: 4px;
}

/* Icons within editable text remain non-editable */
body.page-editor-editing [contenteditable="false"],
body.page-editor-editing svg,
body.page-editor-editing i.bi {
  user-select: none !important;
  pointer-events: auto !important;
}

/* Images in edit mode */
body.page-editor-editing main img,
body.page-editor-editing .page-editor-editable-img {
  cursor: pointer !important;
  transition: transform 0.2s ease, outline 0.2s ease;
  outline: 2px dashed #C89B3C !important;
  outline-offset: 3px !important;
}

body.page-editor-editing main img:hover,
body.page-editor-editing .page-editor-editable-img:hover {
  outline: 3px solid #1B3B2B !important;
  filter: brightness(0.92);
}

/* Image Loading Spinner Overlay */
.page-editor-img-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(27, 59, 43, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: 4px;
  backdrop-filter: blur(3px);
  transition: opacity 0.2s ease;
}

/* Link Badge Button Overlays */
.page-editor-link-wrapper {
  position: relative !important;
  display: inline-block;
}

.page-editor-link-badge,
.page-editor-floating-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #1B3B2B;
  color: #C89B3C;
  border: 1px solid #C89B3C;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 12px;
  cursor: pointer;
  z-index: 100;
  margin-left: 4px;
  vertical-align: middle;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.page-editor-link-badge:hover,
.page-editor-floating-badge:hover {
  transform: scale(1.2);
  background-color: #C89B3C;
  color: #1B3B2B;
}

.page-editor-card-link-container {
  position: relative !important;
}

.page-editor-card-link-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 500;
  background-color: #1B3B2B;
  color: #C89B3C;
  border: 1px solid #C89B3C;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.page-editor-card-link-badge:hover {
  background-color: #C89B3C;
  color: #1B3B2B;
}

/* Modal Custom Styling & Height Controls */
#editorGalleryModal .modal-dialog {
  max-height: calc(100vh - 120px);
  margin-bottom: 90px !important; /* Prevents modal bottom edge from overlapping floating bar */
}

#editorGalleryModal .modal-body {
  height: 520px;
  min-height: 520px;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#editorGalleryModal .tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#editorGalleryModal .tab-pane {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
}

#editorGalleryModal .tab-pane.active {
  display: flex !important;
}

/* Custom Nav Pills with Website Colors */
#gallery-source-tabs .nav-link {
  background-color: #f1f5f9;
  color: #1B3B2B !important;
  border: 1.5px solid #cbd5e1;
  transition: all 0.25s ease;
  font-size: 13px;
  letter-spacing: 0.5px;
}

#gallery-source-tabs .nav-link:hover {
  background-color: #e2e8f0;
  color: #1B3B2B !important;
  border-color: #94a3b8;
}

#gallery-source-tabs .nav-link.active {
  background-color: #1B3B2B !important;
  color: #C89B3C !important;
  border-color: #C89B3C !important;
  box-shadow: 0 4px 12px rgba(27, 59, 43, 0.25) !important;
}

/* Fixed Grid Height Across All Tabs */
.gallery-grid {
  height: 380px;
  min-height: 380px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Gallery Image Cards */
.gallery-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #fff;
}

.gallery-card:hover {
  transform: translateY(-3px);
  border-color: #C89B3C;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.gallery-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.gallery-card-label {
  font-size: 11px;
  color: #555;
  padding: 6px 8px;
  background: #f9f9f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background-color: rgba(220, 53, 69, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  z-index: 10;
}

.gallery-delete-btn:hover {
  background-color: #dc3545;
  transform: scale(1.1);
}

/* Product Showcase Category Cards (No Empty White Space) */
.product-cat-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  height: 350px;
}

.product-cat-card:hover {
  border-color: #C89B3C;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(27, 59, 43, 0.18);
}

.product-cat-card img {
  height: 240px;
  width: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

.product-cat-card .cat-card-body {
  padding: 12px 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}
