/* Touchtry Interactive Admin Styles */
.touchtry-wrap { max-width:1200px; }
.touchtry-header { display:flex;align-items:center;justify-content:space-between;margin-bottom:20px; }
.touchtry-header h1 { display:flex;align-items:center;gap:10px;font-size:22px; }
.touchtry-logo { width:32px;height:32px;background:#008060;border-radius:8px;display:flex;align-items:center;justify-content:center;color:white;font-weight:700;font-size:14px; }
.touchtry-badge { background:#f0fdf4;color:#008060;padding:4px 12px;border-radius:20px;font-size:12px;font-weight:600; }

.touchtry-tabs { display:flex;gap:0;border-bottom:1px solid #e3e5e7;margin-bottom:24px; }
.touchtry-tab { padding:12px 20px;font-size:14px;font-weight:500;color:#6d7175;text-decoration:none;border-bottom:2px solid transparent;transition:all 0.2s; }
.touchtry-tab:hover { color:#1a1a1a; }
.touchtry-tab.active { color:#008060;border-bottom-color:#008060;font-weight:600; }

.touchtry-stats { display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:16px;margin-bottom:24px; }
.touchtry-stat { background:white;border:1px solid #e3e5e7;border-radius:12px;padding:20px; }
.stat-label { display:block;font-size:12px;font-weight:500;color:#6d7175;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:8px; }
.stat-value { font-size:28px;font-weight:700;color:#008060; }

.touchtry-products-toolbar { display:flex;gap:12px;margin-bottom:16px;flex-wrap:wrap; }
.touchtry-input { padding:9px 12px;border:1px solid #e3e5e7;border-radius:8px;font-size:14px;font-family:inherit;outline:none; }
.touchtry-input:focus { border-color:#008060; }
.touchtry-select { padding:9px 12px;border:1px solid #e3e5e7;border-radius:8px;font-size:14px;font-family:inherit;outline:none;background:white; }

.touchtry-product-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:16px; }
.touchtry-product-card { background:white;border:1px solid #e3e5e7;border-radius:12px;overflow:hidden;transition:box-shadow 0.2s; }
.touchtry-product-card:hover { box-shadow:0 4px 12px rgba(0,0,0,0.08); }

.product-card-top { display:flex;align-items:center;gap:12px;padding:16px;border-bottom:1px solid #e3e5e7; }
.product-thumb { width:56px;height:56px;border-radius:10px;object-fit:cover;background:#f0f0f0;border:1px solid #e3e5e7;flex-shrink:0; }
.product-info { flex:1;min-width:0; }
.product-name { font-weight:600;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.product-price { font-size:12px;color:#6d7175; }

.ar-badge { display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:20px;font-size:11px;font-weight:600;flex-shrink:0; }
.ar-badge.active { background:#f0fdf4;color:#008060; }
.ar-badge.inactive { background:#f5f5f5;color:#999; }
.ar-badge.has-model { background:#f5f3ff;color:#7c3aed; }

.product-card-body { padding:16px; }
.field-group { margin-bottom:14px; }
.field-label { font-size:12px;font-weight:600;color:#6d7175;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:6px;display:flex;align-items:center;justify-content:space-between; }
.ar-url-row { display:flex;gap:8px; }
.ar-url-row input { flex:1; }

.product-card-footer { padding:12px 16px;border-top:1px solid #e3e5e7;display:flex;align-items:center;justify-content:space-between;background:#fafafa;font-size:13px;font-weight:500; }

.btn { display:inline-flex;align-items:center;gap:6px;padding:10px 18px;border:none;border-radius:8px;font-size:14px;font-weight:600;font-family:inherit;cursor:pointer;transition:all 0.2s; }
.btn-primary { background:#008060;color:white; }
.btn-primary:hover { background:#006e52; }
.btn-purple { background:#7c3aed;color:white; }
.btn-purple:hover { background:#6d28d9; }
.btn-sm { padding:6px 12px;font-size:13px; }

.touchtry-toggle { position:relative;width:44px;height:24px;cursor:pointer;display:inline-block;vertical-align:middle; }
.touchtry-toggle input { opacity:0;width:0;height:0; }
.touchtry-toggle .slider { position:absolute;inset:0;background:#ccc;border-radius:24px;transition:0.3s; }
.touchtry-toggle .slider::before { content:'';position:absolute;width:18px;height:18px;left:3px;bottom:3px;background:white;border-radius:50%;transition:0.3s;box-shadow:0 1px 3px rgba(0,0,0,0.2); }
.touchtry-toggle input:checked + .slider { background:#008060; }
.touchtry-toggle input:checked + .slider::before { transform:translateX(20px); }

/* Modal */
.touchtry-modal { position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:999999;display:flex;align-items:center;justify-content:center; }
.touchtry-modal-content { background:white;border-radius:16px;width:90%;max-width:1000px;max-height:85vh;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,0.3);display:flex;flex-direction:column; }
.touchtry-modal-header { padding:16px 20px;border-bottom:1px solid #e3e5e7;display:flex;align-items:center;justify-content:space-between; }
.touchtry-modal-header h3 { font-size:16px;font-weight:600;margin:0; }
.touchtry-modal-close { background:none;border:none;font-size:24px;cursor:pointer;color:#666;padding:4px 8px; }
.touchtry-modal-body { flex:1;overflow-y:auto;padding:20px; }
.touchtry-loading { text-align:center;padding:60px;color:#6d7175; }

.model-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px; }
.model-card { background:white;border:1px solid #e3e5e7;border-radius:12px;overflow:hidden;cursor:pointer;transition:box-shadow 0.2s; }
.model-card:hover { box-shadow:0 4px 16px rgba(0,0,0,0.12); }
.model-preview { height:160px;background:#f5f5f5;display:flex;align-items:center;justify-content:center; }
.model-preview model-viewer { width:100%;height:100%; }
.model-info { padding:12px; }
.model-name { font-weight:600;font-size:14px;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.model-meta { font-size:11px;color:#888; }

/* Settings */
.touchtry-settings-grid { display:grid;grid-template-columns:1fr 1fr;gap:24px; }
@media (max-width:768px) { .touchtry-settings-grid { grid-template-columns:1fr; } }
.touchtry-card { background:white;border:1px solid #e3e5e7;border-radius:12px;padding:24px;margin-bottom:16px; }
.touchtry-card h3 { font-size:16px;font-weight:600;margin:0 0 16px; }
.form-group { margin-bottom:16px; }
.form-group label { display:block;font-size:13px;font-weight:600;margin-bottom:6px; }

.setup-steps { margin:0; }
.setup-step { display:flex;gap:14px;align-items:flex-start;padding:14px 0;border-bottom:1px solid #f0f0f0; }
.setup-step:last-child { border-bottom:none; }
.step-icon { width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px;flex-shrink:0;color:white; }
.step-icon.purple { background:#7c3aed; }
.step-icon.green { background:#008060; }
.step-icon.orange { background:#d97706; }
.setup-step strong { font-size:14px; }
.setup-step p { font-size:13px;color:#6d7175;margin:4px 0 0;line-height:1.5; }

.important-notes { background:#fef3c7;border-radius:10px;padding:16px;margin-top:16px; }
.important-notes h4 { font-size:14px;margin:0 0 8px; }
.important-notes p { font-size:13px;margin:4px 0;color:#92400e; }




/* =========================
   Touchtry Model Picker UI
   ========================= */

#touchtry-model-modal {
  padding: 20px;
}

#touchtry-model-modal .touchtry-model-shell {
  padding: 8px 2px 18px;
}

#touchtry-model-modal .touchtry-search-wrap {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 18px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  padding-bottom: 10px;
}

#touchtry-model-modal #model-search-input {
  width: 100%;
  max-width: 420px;
  height: 46px;
  border: 1px solid #dedee7;
  border-radius: 14px;
  padding: 0 16px;
  font-size: 15px;
  outline: none;
  background: #fff;
}

#touchtry-model-modal #model-search-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* 1 row me 3 cards */
#touchtry-model-modal .model-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

#touchtry-model-modal .model-card {
  background: #fff;
  border: 1px solid #e7e8f0;
  border-radius: 18px;
  overflow: hidden;
  min-height: 390px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#touchtry-model-modal .model-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.1);
  border-color: #d8cbff;
}

#touchtry-model-modal .model-preview {
  height: 210px;
  background: linear-gradient(180deg, #f8f8fc 0%, #f3f3f8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#touchtry-model-modal .model-preview model-viewer {
  width: 100%;
  height: 100%;
  background: transparent;
  --poster-color: transparent;
}

#touchtry-model-modal .model-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

#touchtry-model-modal .model-name {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
  margin-bottom: 8px;
  min-height: 46px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

#touchtry-model-modal .model-meta {
  font-size: 14px;
  color: #7b8190;
  margin-bottom: 14px;
  line-height: 1.5;
}

#touchtry-model-modal .touchtry-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

#touchtry-model-modal .touchtry-preview-btn,
#touchtry-model-modal .touchtry-select-btn {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

#touchtry-model-modal .touchtry-preview-btn {
  background: #f3f4f8;
  color: #222;
}

#touchtry-model-modal .touchtry-preview-btn:hover {
  background: #eaedf5;
}

#touchtry-model-modal .touchtry-select-btn {
  color: #fff;
  background: linear-gradient(90deg, #6d35ff 0%, #8b46ff 100%);
  box-shadow: 0 8px 18px rgba(125, 58, 237, 0.22);
}

#touchtry-model-modal .touchtry-select-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(125, 58, 237, 0.28);
}

#touchtry-model-modal .touchtry-no-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 600;
}

/* Preview modal */
#touchtry-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 24px;
  backdrop-filter: blur(4px);
}

#touchtry-preview-modal .touchtry-preview-box {
  width: min(980px, 94vw);
  height: min(720px, 90vh);
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

#touchtry-preview-modal .touchtry-preview-header {
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  border-bottom: 1px solid #edf0f5;
  background: #fff;
}

#touchtry-preview-modal .touchtry-preview-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 28px;
  color: #374151;
  background: #f5f6fb;
  z-index: 2;
}

#touchtry-preview-modal .touchtry-preview-close:hover {
  background: #eceef7;
}

#touchtry-preview-modal .touchtry-preview-body {
  height: calc(100% - 68px);
  background: radial-gradient(circle at top, #fafafe 0%, #f3f4f9 100%);
}

#touchtry-preview-modal .touchtry-preview-body model-viewer {
  width: 100%;
  height: 100%;
  background: transparent;
  --poster-color: transparent;
}

/* Responsive */
@media (max-width: 1180px) {
  #touchtry-model-modal .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #touchtry-model-modal .model-grid {
    grid-template-columns: 1fr;
  }

  #touchtry-model-modal .model-preview {
    height: 220px;
  }

  #touchtry-model-modal .touchtry-btn-row {
    grid-template-columns: 1fr;
  }
}


#touchtry-model-modal .model-preview model-viewer {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 210px;
  background: transparent;
  --poster-color: transparent;
}

#touchtry-preview-modal .touchtry-preview-body model-viewer {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 400px;
  background: transparent;
  --poster-color: transparent;
}

#touchtry-model-modal .model-preview model-viewer {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 210px;
  background: transparent;
  --poster-color: transparent;
}

#touchtry-preview-modal .touchtry-preview-body model-viewer {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 400px;
  background: transparent;
  --poster-color: transparent;
}




#touchtry-model-modal .model-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

#touchtry-model-modal .model-card {
  background: #fff;
  border: 1px solid #e7e8f0;
  border-radius: 18px;
  overflow: hidden;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#touchtry-model-modal .model-preview {
  height: 220px !important;
  min-height: 220px !important;
  background: linear-gradient(180deg, #f8f8fc 0%, #f3f3f8 100%);
  display: block !important;
  position: relative;
  overflow: hidden;
}

#touchtry-model-modal .model-preview model-viewer {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 220px !important;
  background: transparent !important;
  --poster-color: transparent;
}

#touchtry-model-modal .model-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

#touchtry-model-modal .model-name {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
  margin-bottom: 8px;
  min-height: 46px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

#touchtry-model-modal .model-meta {
  font-size: 14px;
  color: #7b8190;
  margin-bottom: 14px;
  line-height: 1.5;
}

#touchtry-model-modal .touchtry-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

#touchtry-preview-modal .touchtry-preview-body {
  height: calc(100% - 68px);
  min-height: 420px;
  background: radial-gradient(circle at top, #fafafe 0%, #f3f4f9 100%);
}

#touchtry-preview-modal .touchtry-preview-body model-viewer {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 420px !important;
  background: transparent !important;
  --poster-color: transparent;
}

@media (max-width: 1180px) {
  #touchtry-model-modal .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #touchtry-model-modal .model-grid {
    grid-template-columns: 1fr;
  }
}


#touchtry-model-modal .touchtry-search-wrap {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 18px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  padding-bottom: 10px;
}

#touchtry-model-modal #modal-body {
  overflow-x: hidden;
}



#touchtry-model-modal .model-preview {
  height: 220px;
  min-height: 220px;
  background: linear-gradient(180deg, #f8f8fc 0%, #f3f3f8 100%);
  position: relative;
  overflow: hidden;
}

#touchtry-model-modal .touchtry-model-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}

#touchtry-preview-modal .touchtry-model-frame-large {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}