/* Aldık Sandık — 3B Odalar modülü stilleri
   Prefix: .rooms3d-
   Dokunma hedefleri ≥ 44px, mobil responsive, prefers-reduced-motion desteği. */

.rooms3d-root {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 12px;
  min-height: 560px;
  height: calc(100vh - 220px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #3a2f22;
}

@media (max-width: 800px) {
  .rooms3d-root {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.rooms3d-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f6efe0;
  border: 1px solid #e0d3b5;
  border-radius: 12px;
  padding: 12px;
  overflow-y: auto;
}

.rooms3d-side-block h3 {
  font-size: 13px;
  margin: 0 0 8px;
  color: #6a4d2b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rooms3d-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 8px;
}

.rooms3d-row .rooms3d-room-select {
  flex: 1;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid #cdb98d;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.rooms3d-new-room,
.rooms3d-view-toggle,
.rooms3d-rotate,
.rooms3d-delete,
.rooms3d-save,
.rooms3d-modal-cancel,
.rooms3d-primary {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #cdb98d;
  border-radius: 8px;
  background: #fff8ea;
  color: #3a2f22;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.rooms3d-new-room:hover,
.rooms3d-view-toggle:hover,
.rooms3d-rotate:hover,
.rooms3d-delete:hover,
.rooms3d-save:hover,
.rooms3d-modal-cancel:hover {
  background: #ffefc9;
}

.rooms3d-primary {
  background: #6a4d2b;
  color: #fff;
  border-color: #4a3618;
}

.rooms3d-primary:hover {
  background: #4a3618;
}

.rooms3d-dims {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.rooms3d-dims label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: #6a4d2b;
  gap: 4px;
}

.rooms3d-dims input {
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid #cdb98d;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.rooms3d-cat-group {
  margin-bottom: 12px;
}

.rooms3d-cat-group h4 {
  font-size: 12px;
  margin: 8px 0 6px;
  color: #6a4d2b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rooms3d-cat-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rooms3d-cat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid #e0d3b5;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: #3a2f22;
  transition: background 0.12s;
}

.rooms3d-cat-item:hover {
  background: #fff4d6;
  border-color: #c8a560;
}

.rooms3d-cat-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid #d4c2a0;
  flex-shrink: 0;
}

.rooms3d-cat-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rooms3d-cat-dims {
  font-size: 11px;
  color: #7a6448;
  font-variant-numeric: tabular-nums;
}

.rooms3d-add-own {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px;
  border: 1.5px dashed #cdb98d;
  border-radius: 8px;
  background: transparent;
  color: #6a4d2b;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.rooms3d-add-own:hover {
  background: #fff4d6;
}

.rooms3d-main {
  display: flex;
  flex-direction: column;
  border: 1px solid #e0d3b5;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.rooms3d-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #e0d3b5;
  background: #f6efe0;
  flex-wrap: wrap;
}

.rooms3d-status {
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  min-width: 120px;
  text-align: right;
}

.rooms3d-status[data-type="ok"] {
  color: #1d6b3a;
}

.rooms3d-status[data-type="warn"] {
  color: #b74b1a;
}

.rooms3d-status[data-type="error"] {
  color: #a02020;
}

.rooms3d-status-flash {
  position: relative;
  padding: 4px 8px;
  border-radius: 6px;
  background: #6a4d2b;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}

.rooms3d-status-flash.is-visible {
  opacity: 1;
}

.rooms3d-selpanel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid #e0d3b5;
  background: #fff8ea;
  flex-wrap: wrap;
}

.rooms3d-selpanel[hidden] {
  display: none;
}

.rooms3d-selpanel-name {
  font-weight: 700;
  font-size: 13px;
  color: #6a4d2b;
  margin-right: auto;
}

.rooms3d-selpanel label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6a4d2b;
  font-weight: 600;
}

.rooms3d-selpanel input {
  width: 72px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid #cdb98d;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.rooms3d-selpanel i {
  font-style: normal;
  font-size: 11px;
  color: #9a7a3a;
}

.rooms3d-canvas-wrap {
  flex: 1;
  min-height: 400px;
  position: relative;
  background: #f6efe0;
}

.rooms3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none; /* mobil kaydırma canvas'a sürükleme olarak gelsin */
}

/* Modallar */
.rooms3d-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(36, 28, 12, 0.5);
  z-index: 1000;
  padding: 16px;
}

.rooms3d-modal.is-visible {
  display: flex;
}

.rooms3d-modal-card {
  width: 100%;
  max-width: 420px;
  background: #fff8ea;
  border: 2px solid #cdb98d;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rooms3d-modal-card h3 {
  margin: 0 0 4px;
  color: #6a4d2b;
  font-size: 16px;
}

.rooms3d-modal-card label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #6a4d2b;
  font-weight: 600;
}

.rooms3d-modal-card label input:not([type="color"]) {
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid #cdb98d;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.rooms3d-modal-card input[type="color"] {
  width: 60px;
  height: 40px;
  border: 1px solid #cdb98d;
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}

.rooms3d-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Erişilebilirlik */
@media (prefers-reduced-motion: reduce) {
  .rooms3d-cat-item,
  .rooms3d-status-flash {
    transition: none;
  }
}
