/* Alpine.js cloak */
[x-cloak] {
  display: none !important;
}

/* Modal — posicionamento real (sobrepõe o demo inline do design system) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 61, 42, 0.28);
  backdrop-filter: blur(3px);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-container {
  position: relative;
  width: min(880px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px -30px rgba(28, 61, 42, 0.5);
  z-index: 50;
}
.modal-header {
  position: absolute;
  top: 0;
  right: 0;
  padding: 16px;
  z-index: 10;
}
.modal-body { padding: 22px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}

/* Modal content refinements: Move separator line to header instead of footer */
.modal-container #modal-zone > form > h2:first-of-type,
.modal-container #modal-zone > div > h2:first-of-type {
  padding-bottom: 1rem;
  margin-bottom: 1.25rem !important;
  border-bottom: 1px solid var(--border);
}

.modal-container #modal-zone .form-actions {
  border-top: none;
  padding-top: 0;
  margin-top: 1rem;
}

/* ====== SLIDEOVER GLOBAL ====== */
.slideover-dialog {
  margin: 0 0 0 auto;
  padding: 0;
  width: 100%;
  max-width: 520px;
  height: 100vh;
  max-height: 100vh;
  background: transparent;
  border: none;
  overflow: visible;
}

.slideover-dialog::backdrop {
  background: rgba(28, 61, 42, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.slideover-panel {
  width: 100%;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border-strong, var(--border));
  box-shadow: -15px 0 40px -10px rgba(28, 61, 42, 0.35);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
}

.slideover-panel.is-open {
  transform: translateX(0);
  opacity: 1;
}

.slideover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.slideover-header h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.slideover-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Slideover Form & Content Layout */
.slideover-form {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  flex: 1;
}

.slideover-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

.slideover-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
}

/* Form Section / Groups */
.form-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0.5rem 0 0.25rem 0;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .form-group-row {
    grid-template-columns: 1fr;
  }
}

.form-hint {
  font-size: 0.78125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Upload Dropzone In Form */
.slideover-logo-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  padding: 1.5rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--bg-surface-elevated, var(--surface));
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.slideover-logo-dropzone:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.slideover-logo-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.slideover-logo-circle img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Media preview picker in slideover */
.slideover-media-picker {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--bg-surface-elevated, var(--surface));
  padding: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
}

.slideover-media-thumb {
  width: 110px;
  height: 75px;
  border-radius: var(--radius-sm, 6px);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.slideover-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slideover-item-card {
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated, var(--surface));
  border-radius: var(--radius-md, 8px);
  padding: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s ease;
}

.slideover-item-card:hover {
  border-color: var(--border-strong, var(--accent));
}

/* ====== DROPZONE AREA ====== */
.dropzone-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md, var(--radius));
  background: var(--surface);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dropzone-area:hover {
  border-color: var(--primary, var(--accent));
  background-color: var(--surface-soft, var(--bg-surface-elevated));
}

/* ====== ADMIN GRID ====== */
.admin-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .admin-grid-2x2 {
    grid-template-columns: 1fr;
  }
}

/* ====== VITRINE ESTUDIO & CARDS ====== */
.vitrine-estudio {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.vitrine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vitrine-header .page-title {
  margin: 0;
}

.vitrine-header .panel-note {
  margin: 0.25rem 0 0;
}

.vitrine-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.card-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
}

.card-preview {
  background: var(--bg-surface-elevated);
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.card-preview p {
  margin: 0 0 0.5rem 0;
}

.card-preview p:last-child {
  margin-bottom: 0;
}

.card-preview ul {
  list-style: disc;
  margin: 0;
  padding-left: 1.25rem;
}

.card-preview li {
  margin-bottom: 0.5rem;
}

.card-preview li:last-child {
  margin-bottom: 0;
}

.card-preview-thumb {
  width: 80px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}

/* ====== MODAL PICKER (BIBLIOTECA) ====== */
#modal-picker {
  z-index: 100;
}

.modal-content {
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
}

.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.picker-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.picker-item {
  cursor: pointer;
  padding: 0.5rem;
  text-align: center;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease;
}

.picker-item:hover {
  border-color: var(--border-strong, var(--border));
}

.picker-item.selected,
.picker-item:has(input[type="radio"]:checked) {
  border-color: var(--accent);
}

.picker-radio,
.picker-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.picker-item:has(input[type="radio"]:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.picker-img,
.picker-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

.picker-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* ====== IDENTIDADE VISUAL & ESTABELECIMENTO ====== */
.preview-container {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-top: 1rem;
}

.logo-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.color-preview {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
}

.color-preview-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

/* ====== GALERIA & UPLOAD CARDS ====== */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .galeria-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }
}

.upload-card {
  padding: 0 !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, var(--radius));
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.upload-card:hover {
  border-color: var(--border-strong, var(--accent));
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.12);
}

.upload-card-media {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  overflow: hidden;
  background: var(--bg-surface-elevated, #f3f4f6);
}

.upload-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.upload-card:hover .upload-card-media img {
  transform: scale(1.03);
}

/* Controles sobrepostos na imagem */
.upload-card-handle {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 38, 26, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: grab;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.upload-card-handle:hover {
  background: rgba(18, 38, 26, 0.95);
  transform: scale(1.06);
}

.upload-card-handle:active {
  cursor: grabbing;
}

.upload-card-btn-action {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 38, 26, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  padding: 0;
  line-height: 1;
  font-size: 1.1rem;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.upload-card-btn-action:hover {
  background: rgba(18, 38, 26, 0.95);
  transform: scale(1.06);
}

.upload-card-badges {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  z-index: 10;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  pointer-events: none;
}

.upload-card-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}

.upload-card-badge--accent {
  background: var(--accent);
  color: var(--on-accent, #ffffff);
}

.upload-card-badge--primary {
  background: var(--primary);
  color: var(--on-primary, #ffffff);
}

.upload-card-badge--surface {
  background: rgba(18, 38, 26, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.upload-card-footer {
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.dropdown-acoes {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
}

.dropdown-acoes .dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 150px;
  z-index: 30;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.dropdown-acoes .dropdown-menu .btn {
  width: 100%;
  text-align: left;
  border: none;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

.dropdown-acoes .dropdown-menu .btn:last-child {
  margin-bottom: 0;
}

.dropdown-acoes .dropdown-menu .btn-danger {
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  border-radius: 0;
}

