/* Shadowboard Frontend Styles */

/* === SELETOR DE CORES === */
.shadowboard-color-selector {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 384px;
  margin: 0 !important;
}

.shadowboard-color-selector .color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 !important;
}

.shadowboard-color-selector .color-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  position: relative;
  transition: all 0.3s ease;
}

.shadowboard-color-selector .color-option:hover {
  transform: scale(1.1);
}

.shadowboard-color-selector .color-option input[type="radio"] {
  opacity: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  cursor: pointer;
}

.shadowboard-color-selector .color-option input[type="radio"]:checked + * {
  border-color: #333;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}

.shadowboard-color-selector .color-option input[type="color"] {
  opacity: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  border: none;
  cursor: pointer;
}

.shadowboard-color-selector .color-option.selected {
  border-color: #333;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}

.shadowboard-color-selector .color-option.custom::after {
  content: "+";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* === SELETOR DE TAMANHOS === */
.shadowboard-sizes .size-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: none;
  gap: 10px;
  padding: 0;
  margin-bottom: 12px;
}

.shadowboard-sizes .size-item input {
  width: 24px;
  height: 24px;
}

.shadowboard-sizes .size-item .size-option {
  display: block;
  font-weight: 500;
  margin-bottom: -5px;
  outline: none !important;
}

/* === SELETOR DE TIPOS === */
.shadowboard-type {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.shadowboard-type .type-item {
  display: flex;
  align-items: center;
  border: none;
  gap: 10px;
  padding: 0;
  margin-bottom: 12px;
}

.shadowboard-type .type-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.shadowboard-type .type-item .type-option {
  display: flex;
  align-items: center;
  flex-direction: column !important;
  justify-content: center;
  text-align: center;
  gap: 12px;
  font-weight: 600;
  margin-bottom: -5px;
  outline: none !important;
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.shadowboard-type-img {
  width: 100px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
}

.shadowboard-type-lightbox {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  cursor: zoom-in;
}

.shadowboard-type-lightbox:hover img {
  border: 1px solid #0387cd !important;
}

.shadowboard-type-lightbox:focus {
  outline: none;
  background: transparent;
}

.shadowboard-type-lightbox img {
  border: 1px solid transparent !important;
  background: #f8f8f8;
  padding: 6px;
}

.shadowboard-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  z-index: 100000;
  padding: 24px;
  cursor: zoom-out;
}

.shadowboard-lightbox.is-open {
  display: flex;
}

.shadowboard-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
}

.shadowboard-lightbox-open {
  overflow: hidden;
}

.shadowboard-type .type-item .type-option:hover {
  border-color: #cfe8f4;
}

.shadowboard-type .type-item input:checked + .type-option {
  border-color: #0387cd;
  box-shadow: 0 0 0 2px rgba(3, 135, 205, 0.2);
}

.shadowboard-type .type-item input:checked + .type-option span {
  color: #0387cd;
}

/* === CAMPOS DE TEXTO === */
.shadowboard-text .text-item {
  display: block;
  width: 100%;
  border: none;
  gap: 10px;
  padding: 0;
  margin-bottom: 12px;
}

.shadowboard-text label,
.shadowboard-text input {
  display: block;
}

.shadowboard-text label {
  color: #013958;
}

.shadowboard-text input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 16px !important;
  border-color: #0387cd;
}

/* === UPLOAD DE LOGO === */
.shadowboard-logo {
  margin: 0 !important;
}

.shadowboard-logo input[type="file"] {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* === SHADOWBOARD PRINCIPAL === */
.shadowboard-content-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.shadowboard-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 60%;
}

.shadowboard-products .products-loading {
  grid-column: 1 / span 3;
  font-size: 14px;
}

/* Ajustar grid baseado no número de itens */
.shadowboard-products[data-items="1"] {
  grid-template-columns: 1fr;
  max-width: 20%;
}

.shadowboard-products[data-items="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 40%;
}

.shadowboard-products[data-items="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 60%;
}

.shadowboard-products[data-items="4"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 60%;
}

.shadowboard-products[data-items="5"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 60%;
}

/* Para mais de 5 itens, manter 3 colunas */
.shadowboard-products[data-items="6"],
.shadowboard-products[data-items="7"],
.shadowboard-products[data-items="8"],
.shadowboard-products[data-items="9"],
.shadowboard-products[data-items="10"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 60%;
}

.shadowboard-products .product-item {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1e4bca;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s ease;
}

.shadowboard-products .product-item:hover {
  opacity: 0.85;
  cursor: pointer;
}

.shadowboard-products .product-item img {
  width: 100%;
  max-width: 32px;
  height: 100%;
  max-height: 23px;
  object-fit: contain;
}

.shadowboard-button {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px !important;
  background-color: #0387cd !important;
  border: none;
  font-family: Gotham, sans-serif;
  font-weight: 500;
  border-radius: 4px;
  color: white;
  cursor: pointer;
}

.shadowboard-button:hover {
  background-color: #013958 !important;
}

.shadowboard-button img {
  width: 16px;
  height: 16px;
  margin-right: 8px;
}

.shadowboard-button span {
  display: block;
  /* margin-bottom: -7px; */
  font-size: 14px;
}

.shadowboard {
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto;
  max-width: 400px;
}

.shadowboard .shadowboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-height: 40px;
  padding: 8px;
}

.shadowboard .shadowboard-header .shadowboard-header-title-1 {
  display: block;
  font-weight: 700;
  width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shadowboard .shadowboard-header .shadowboard-header-title-2 {
  display: block;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shadowboard .shadowboard-body {
  background-color: #1e4bca;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  max-height: 800px;
  overflow-y: auto;
}

.shadowboard .shadowboard-body .shadowboard-area {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  max-height: 752px; /* 800px - 48px de padding */
}

.shadowboard .shadowboard-body .shadowboard-area .product-item {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s ease;
  cursor: grab;
  user-select: none;
  border-radius: 4px;
}

.shadowboard .shadowboard-body .shadowboard-area .product-item:hover {
  cursor: grab;
}

.shadowboard .shadowboard-body .shadowboard-area .product-item img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  /* object-fit: contain; */
  pointer-events: none;
}

.shadowboard .shadowboard-body .shadowboard-area .product-item.dragging {
  cursor: grabbing;
  z-index: 1000;
}

.shadowboard .shadowboard-body .shadowboard-area .product-item.overlap-target {
  border: 2px solid #ffd700;
  background-color: rgba(255, 215, 0, 0.2);
}

.shadowboard .shadowboard-body .shadowboard-area .product-item.overlapping {
  border: 2px solid #ff6b6b;
  background-color: rgba(255, 107, 107, 0.2);
}

.shadowboard .shadowboard-body .shadowboard-area .product-item.returning {
  pointer-events: none;
  z-index: 999;
}

.shadowboard .showboard-header-logo {
  display: flex;
  align-items: center;
}

.shadowboard .showboard-header-logo img {
  max-width: 60px;

  object-fit: contain;
}

/* Classe para ocultar itens vazios */
.product-item.hidden {
  display: none;
}

/* Alerta de espaço insuficiente */
.space-alert {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #ff6b6b;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.space-alert.show {
  opacity: 1;
  transform: translateX(0);
}

/* Responsividade */
@media (max-width: 768px) {
  .shadowboard-content-header {
    flex-direction: column;
    align-items: stretch;
  }

  .shadowboard-products {
    max-width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shadowboard {
    max-width: 100%;
  }
}

/* === ACCORDION STYLES === */
.shadowboard-unified-container {
  margin: 20px 0;
}

.shadowboard-form-info-container {
  margin: 20px 0;
  padding: 0 4px;
}

.shadowboard-accordion-item {
  border: none;
  border-radius: none;
  margin-bottom: 32px;
  /* overflow: hidden; */
  background: none !important;
}

.shadowboard-accordion-header {
  width: 100% !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #013958 !important;
  transition: background 0.3s ease;
}

.shadowboard-accordion-icon {
  transition: transform 0.3s ease;
  font-size: 12px;
}

.shadowboard-accordion-icon.rotated {
  transform: rotate(180deg);
}

.shadowboard-accordion-content {
  display: none;
  padding: 16px 0px;
}

.shadowboard-main-wrapper {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid #0387cd;
}

/* SHADOWBOARD 3º ETAPA */
.shadowboard .shadowboard-result-header {
  display: flex;
  /* flex-direction: column; */
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-height: 40px;
  padding: 8px;
}

.shadowboard .shadowboard-result-header .shadowboard-header-title-2 {
  font-weight: 500;
  font-size: 18px;
  text-align: right;
}
