/* ThatShop Designer — full-screen customizer (premium) */

.tsd-launcher { margin: 14px 0; }
html.tsd-noscroll { overflow: hidden; }

.tsd-app {
	display: none; position: fixed; inset: 0; z-index: 999999;
	background: #f1ede4; flex-direction: column;
	font-family: "Poppins", "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
	color: #1d2330; -webkit-font-smoothing: antialiased;
}
.tsd-app.is-open { display: flex; }

/* Top bar */
.tsd-topbar {
	display: flex; align-items: center; justify-content: space-between;
	background: #2b3742; color: #fff; padding: 12px 20px; flex: 0 0 auto;
	box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.tsd-brand { display: flex; align-items: center; gap: 14px; }
.tsd-close {
	background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #fff;
	font-size: 16px; width: 38px; height: 38px; border-radius: 8px; cursor: pointer; transition: .15s;
}
.tsd-close:hover { background: rgba(255,255,255,.16); }
.tsd-app-title { font-weight: 600; font-size: 15px; letter-spacing: .2px; }
.tsd-topbar-right { display: flex; align-items: center; gap: 14px; }
.tsd-price { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.tsd-btn {
	border: 0; padding: 11px 22px; border-radius: 8px; cursor: pointer;
	font-size: 13px; font-weight: 600; letter-spacing: .2px; transition: .15s;
	background: #ffffff; color: #2b3742;
}
.tsd-btn:hover { background: #eef0f3; }
.tsd-btn--primary { background: #2b3742; color: #fff; box-shadow: 0 6px 16px rgba(43,55,66,.28); }
.tsd-btn--primary:hover { background: #1f2932; }
.tsd-btn:disabled { opacity: .55; cursor: default; box-shadow: none; }

/* Body */
.tsd-body { flex: 1 1 auto; display: flex; min-height: 0; }

/* Left panel */
.tsd-panel {
	width: 312px; flex: 0 0 312px; background: #fff; border-right: 1px solid #eceef1;
	padding: 8px 18px 24px; overflow-y: auto;
}
.tsd-group { padding: 16px 0; border-bottom: 1px solid #f2f3f5; }
.tsd-group:last-child { border-bottom: 0; }
.tsd-group-label {
	display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
	letter-spacing: 1px; color: #9aa0ab; margin-bottom: 11px;
}
.tsd-subhead { display:block; font-size: 11px; font-weight:700; letter-spacing:.8px; text-transform:uppercase; color:#9aa0ab; margin: 12px 0 8px; }

/* Pills */
.tsd-style-tabs, .tsd-sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.tsd-pill {
	border: 1.5px solid #e3e5ea; background: #fff; border-radius: 9px;
	padding: 9px 16px; font-size: 13px; font-weight: 500; cursor: pointer; color: #1d2330; transition: .15s;
}
.tsd-pill:hover { border-color: #c4c8d0; }
.tsd-pill.is-active { background: #2b3742; color: #fff; border-color: #2b3742; }
.tsd-sizes .tsd-pill { text-transform: uppercase; min-width: 44px; text-align: center; }

/* Colours */
.tsd-colors { display: flex; flex-wrap: wrap; gap: 9px; }
.tsd-swatch {
	width: 30px; height: 30px; border-radius: 50%; border: 1px solid #d9dce1;
	cursor: pointer; padding: 0; box-shadow: inset 0 0 0 2px #fff; transition: .12s;
}
.tsd-swatch:hover { transform: scale(1.08); }
.tsd-swatch.is-active { outline: 2px solid #b8924f; outline-offset: 2px; }

/* Inputs */
.tsd-material, .tsd-qty {
	width: 100%; padding: 11px 12px; border: 1.5px solid #e3e5ea; border-radius: 9px;
	font-size: 14px; color: #1d2330; background: #fff;
}
.tsd-qty { width: 110px; }
.tsd-material:focus, .tsd-qty:focus { outline: none; border-color: #b8924f; }

/* Tools */
.tsd-tool {
	width: 100%; padding: 12px 14px; margin-bottom: 9px; text-align: left;
	background: #2b3742; color: #fff; border: 0; border-radius: 9px; cursor: pointer;
	font-size: 13px; font-weight: 600; transition: .15s;
}
.tsd-tool:hover { background: #1f2932; }
.tsd-tool--ghost { background: #f4f5f7; color: #1d2330; border: 1.5px solid #e7e9ed; }
.tsd-tool--ghost:hover { background: #ebedf0; }

.tsd-text-tools, .tsd-img-tools {
	display: flex; flex-direction: column; gap: 9px; padding: 12px;
	background: #fafbfc; border: 1px solid #eef0f2; border-radius: 10px; margin: 6px 0 10px;
}
.tsd-text-tools label, .tsd-slider { display: flex; flex-direction: column; font-size: 12px; color: #6b7280; gap: 4px; }
.tsd-text-tools input, .tsd-text-tools select { padding: 8px 10px; border: 1.5px solid #e3e5ea; border-radius: 7px; font-size: 13px; }

/* Text style buttons */
.tsd-text-style { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.tsd-tt {
	min-width: 34px; height: 34px; padding: 0 9px; border: 1.5px solid #e3e5ea; background: #fff;
	border-radius: 7px; cursor: pointer; font-size: 14px; line-height: 1; color: #1d2330; transition: .12s;
}
.tsd-tt:hover { background: #f0f1f3; }
.tsd-tt.is-on { background: #2b3742; color: #fff; border-color: #2b3742; }
.tsd-tt-gap { width: 10px; }

/* Image tools */
.tsd-img-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tsd-mini {
	flex: 1 1 auto; min-width: 64px; padding: 8px 6px; border: 1.5px solid #e3e5ea; background: #fff;
	border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 600; color: #1d2330; transition: .12s;
}
.tsd-mini:hover { background: #f0f1f3; }
.tsd-slider input[type=range] { width: 100%; accent-color: #b8924f; }

/* Stage */
.tsd-stage {
	flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
	padding: 28px; min-width: 0; gap: 14px; position: relative;
}
/* The white surface must sit on Fabric's wrapper, NOT the raw <canvas>
   (Fabric adds a transparent upper-canvas; a white bg there hides everything). */
.tsd-stage .canvas-container { background: #fff; border-radius: 4px; box-shadow: 0 10px 40px rgba(16,20,30,.10); }
.tsd-stage canvas { max-width: 100%; max-height: 100%; }
/* Status text as a floating top toast (always visible) */
.tsd-msg {
	position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 30;
	margin: 0; font-size: 13px; font-weight: 600; pointer-events: none; white-space: nowrap;
	background: rgba(43,55,66,.94); color: #fff; padding: 7px 16px; border-radius: 999px;
	box-shadow: 0 6px 20px rgba(16,20,30,.22);
}
.tsd-msg:empty { display: none; }

/* Zoom bar */
.tsd-zoom {
	display: flex; align-items: center; gap: 10px; background: #fff; padding: 8px 14px;
	border-radius: 999px; box-shadow: 0 4px 18px rgba(16,20,30,.10); position: absolute; bottom: 18px; right: 24px;
}
.tsd-zoom button {
	width: 26px; height: 26px; border-radius: 50%; border: 0; background: #f0f1f3; color: #1d2330;
	font-size: 16px; line-height: 1; cursor: pointer;
}
.tsd-zoom button:hover { background: #e3e5ea; }
.tsd-zoom-range { width: 120px; accent-color: #b8924f; }
.tsd-zoom-val { font-size: 12px; font-weight: 600; color: #6b7280; min-width: 40px; text-align: right; }

/* ---------- Responsive: tablets ---------- */
@media (max-width: 860px) {
	.tsd-app { height: 100dvh; }
	.tsd-topbar { flex-wrap: wrap; padding: 8px 12px; gap: 8px 10px; }
	.tsd-brand { gap: 10px; flex: 1 1 auto; min-width: 0; }
	.tsd-app-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.tsd-close { width: 34px; height: 34px; flex: 0 0 auto; }
	.tsd-topbar-right { gap: 8px; flex: 0 0 auto; }
	.tsd-btn { padding: 9px 14px; font-size: 12.5px; }

	.tsd-body { flex-direction: column; min-height: 0; }
	/* Canvas on top (fixed area), tools below and fully scrollable */
	.tsd-stage { flex: 0 0 auto; height: 50vh; padding: 12px; order: -1; }
	.tsd-panel {
		width: 100%; flex: 1 1 auto; min-height: 0; max-height: none; order: 0;
		border-right: 0; border-top: 1px solid #eceef1;
		overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 40px;
	}
	.tsd-zoom { bottom: 10px; right: 10px; left: auto; transform: none; padding: 5px 8px; gap: 6px; }
	.tsd-zoom-range { width: 78px; }
}

/* ---------- Responsive: phones ---------- */
@media (max-width: 560px) {
	.tsd-topbar { padding: 8px 10px; }
	/* Back + title on row 1; price + Add to Cart + Checkout share row 2, all shrinkable */
	.tsd-topbar-right { width: 100%; gap: 6px; flex-wrap: nowrap; }
	.tsd-price-toggle { flex: 0 1 auto; min-width: 0; padding: 6px 2px; font-size: 13px; white-space: nowrap; }
	.tsd-price-caret { display: none; }
	.tsd-btn { flex: 1 1 0; min-width: 0; text-align: center; padding: 10px 4px; font-size: 12px; white-space: nowrap; }
	.tsd-app-title { font-size: 13px; }
	.tsd-stage { height: 46vh; padding: 8px; }
	.tsd-panel { padding-left: 14px; padding-right: 14px; }
}


.tsd-crop-actions { display: flex; gap: 6px; margin-top: 6px; }
.tsd-crop-actions .tsd-crop-apply { background: #2b3742; color: #fff; border-color: #2b3742; }

/* Price toggle + breakdown popup */
.tsd-price-toggle {
	display: inline-flex; align-items: center; gap: 6px; background: transparent;
	border: 0; color: #fff; cursor: pointer; font: inherit; padding: 6px 8px; border-radius: 6px;
}
.tsd-price-toggle:hover { background: rgba(255,255,255,.08); }
.tsd-price-caret { font-size: 10px; opacity: .8; }
.tsd-price-pop {
	position: fixed; inset: 0; z-index: 1000001; display: flex; align-items: center; justify-content: center;
	padding: 20px; background: rgba(10,13,20,.45);
}
.tsd-price-pop[hidden] { display: none; }
.tsd-price-pop__card {
	background: #fff; color: #1d2330; border-radius: 14px; box-shadow: 0 24px 64px rgba(16,20,30,.32);
	padding: 16px 18px; width: min(360px, 100%); max-height: calc(100vh - 48px); overflow: auto;
}
.tsd-price-pop__head {
	display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px;
}
.tsd-pp-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: #9aa0ab; }
.tsd-pp-close {
	border: 0; background: #f0f1f3; color: #1d2330; width: 30px; height: 30px; border-radius: 8px;
	font-size: 20px; line-height: 1; cursor: pointer; flex: 0 0 auto;
}
.tsd-pp-close:hover { background: #e3e5ea; }
.tsd-price-pop__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tsd-price-pop__table td { padding: 6px 0; }
.tsd-price-pop__table td:last-child { text-align: right; font-weight: 600; }
.tsd-pp-total-row td { border-top: 1px solid #eceef1; padding-top: 10px; font-size: 15px; color: #b8924f; }

/* See-the-price button */
.tsd-see-price {
	width: 100%; display: flex; align-items: center; justify-content: space-between;
	background: #f7f1e6; color: #9a7732; border: 1.5px solid #e7dcc2; border-radius: 10px;
	padding: 12px 14px; font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s;
}
.tsd-see-price:hover { background: #f1e9d8; }
.tsd-see-price__amt { font-weight: 700; }

/* Added-items (layers) list */
.tsd-layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tsd-layer { display: flex; align-items: center; gap: 6px; background: #f7f8fa; border: 1px solid #eceef1; border-radius: 8px; }
.tsd-layer__name {
	flex: 1 1 auto; text-align: left; background: transparent; border: 0; cursor: pointer;
	padding: 10px 12px; font-size: 13px; color: #1d2330; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tsd-layer__del {
	flex: 0 0 auto; width: 34px; height: 34px; margin: 3px; border: 0; border-radius: 7px;
	background: #f4f5f7; color: #2b3742; font-size: 20px; line-height: 1; cursor: pointer;
}
.tsd-layer__del:hover { background: #e7e9ed; }

/* ===== Brand palette (thatshop.ae): navy + cream + gold ===== */
.tsd-app .tsd-btn { background:#ffffff !important; color:#2b3742 !important; border:1.5px solid #cfd6dc !important; box-shadow:none; }
.tsd-app .tsd-btn:hover { background:#eef1f4 !important; }
.tsd-app .tsd-btn--primary { background:#2b3742 !important; color:#ffffff !important; border-color:#2b3742 !important; }
.tsd-app .tsd-btn--primary:hover { background:#1f2932 !important; }
.tsd-app .tsd-price { color:#d8b878 !important; }
.tsd-app .tsd-see-price { color:#9a7732 !important; }
.tsd-app .tsd-swatch.is-active { outline-color:#b8924f !important; }

/* ====== Hard override: kill theme red on every control (thatshop palette) ====== */
.tsd-app.tsd-app .tsd-close { color:#fff !important; background:rgba(255,255,255,.10) !important; border:1px solid rgba(255,255,255,.18) !important; }
.tsd-app.tsd-app .tsd-pill { color:#2b3742 !important; background:#fff !important; border:1.5px solid #e3e5ea !important; }
.tsd-app.tsd-app .tsd-pill:hover { border-color:#b8924f !important; }
.tsd-app.tsd-app .tsd-pill.is-active { color:#fff !important; background:#2b3742 !important; border-color:#2b3742 !important; }
.tsd-app.tsd-app .tsd-tool { color:#fff !important; background:#2b3742 !important; border:0 !important; }
.tsd-app.tsd-app .tsd-tool:hover { background:#1f2932 !important; }
.tsd-app.tsd-app .tsd-tool--ghost { color:#2b3742 !important; background:#f4f5f7 !important; border:1.5px solid #e7e9ed !important; }
.tsd-app.tsd-app .tsd-tool--ghost:hover { background:#ebedf0 !important; }
.tsd-app.tsd-app .tsd-mini, .tsd-app.tsd-app .tsd-tt { color:#2b3742 !important; background:#fff !important; border:1.5px solid #e3e5ea !important; }
.tsd-app.tsd-app .tsd-tt.is-on { color:#fff !important; background:#2b3742 !important; border-color:#2b3742 !important; }
.tsd-app.tsd-app .tsd-material, .tsd-app.tsd-app .tsd-qty { color:#2b3742 !important; background:#fff !important; border:1.5px solid #e3e5ea !important; }
.tsd-app.tsd-app .tsd-material:focus, .tsd-app.tsd-app .tsd-qty:focus { border-color:#b8924f !important; outline:none !important; }
.tsd-app.tsd-app .tsd-btn { color:#2b3742 !important; background:#fff !important; border:1.5px solid #cfd6dc !important; }
.tsd-app.tsd-app .tsd-btn:hover { background:#eef1f4 !important; }
.tsd-app.tsd-app .tsd-btn--primary { color:#fff !important; background:#2b3742 !important; border-color:#2b3742 !important; }
.tsd-app.tsd-app .tsd-btn--primary:hover { background:#1f2932 !important; }
.tsd-app.tsd-app .tsd-price, .tsd-app.tsd-app .tsd-price-toggle { color:#d8b878 !important; }
.tsd-app.tsd-app .tsd-price-toggle { border:0 !important; background:transparent !important; box-shadow:none !important; }
.tsd-app.tsd-app .tsd-see-price { color:#9a7732 !important; background:#f7f1e6 !important; border:1.5px solid #e7dcc2 !important; }
.tsd-app.tsd-app .tsd-see-price:hover { background:#f1e9d8 !important; }
.tsd-app.tsd-app a { color:#2b3742 !important; }
.tsd-app.tsd-app .tsd-zoom-val { color:#6b7280 !important; }

/* ====== Final sweep: layers, swatches, focus rings — no theme red ====== */
.tsd-app.tsd-app .tsd-layer { background:#f7f8fa !important; border:1px solid #eceef1 !important; }
.tsd-app.tsd-app .tsd-layer__name { color:#2b3742 !important; background:transparent !important; border:0 !important; box-shadow:none !important; }
.tsd-app.tsd-app .tsd-layer__del { color:#2b3742 !important; background:#eef1f4 !important; border:0 !important; box-shadow:none !important; }
.tsd-app.tsd-app .tsd-layer__del:hover { background:#e0e4e9 !important; }
.tsd-app.tsd-app .tsd-swatch { box-shadow:inset 0 0 0 2px #fff !important; border:1px solid #d9dce1 !important; }
.tsd-app.tsd-app .tsd-swatch.is-active { outline:2px solid #b8924f !important; outline-offset:2px !important; }
.tsd-app.tsd-app button:focus, .tsd-app.tsd-app input:focus,
.tsd-app.tsd-app select:focus, .tsd-app.tsd-app a:focus,
.tsd-app.tsd-app .tsd-swatch:focus { outline-color:#b8924f !important; box-shadow:none !important; }
/* Catch-all: any button inside the app the theme tries to tint red */
.tsd-app.tsd-app button { border-color:#e3e5ea; }
.tsd-app.tsd-app .tsd-pp-close { color:#2b3742 !important; background:#eef1f4 !important; border:0 !important; }

/* Multi-side / view switcher */
.tsd-views-group .tsd-views { display:flex; flex-wrap:wrap; gap:10px; }
.tsd-view-btn {
  position:relative; width:64px; height:64px; border:2px solid #d9d2c4; border-radius:8px;
  background:#fff center/contain no-repeat; cursor:pointer; padding:0; overflow:hidden;
}
.tsd-view-btn.is-active { border-color:#b8974a; box-shadow:0 0 0 2px rgba(184,151,74,.25); }
.tsd-view-lbl {
  position:absolute; left:0; right:0; bottom:0; font-size:10px; line-height:1.4;
  background:rgba(43,58,74,.82); color:#fff; padding:1px 2px; text-align:center;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* ---- Right-floating SIDE switcher (Merchlist-style, modern) ---- */
.tsd-side-rail {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 12px; z-index: 6;
  padding: 12px 12px; background: rgba(255,255,255,.72); backdrop-filter: blur(8px);
  border: 1px solid rgba(43,58,74,.10); border-radius: 18px;
  box-shadow: 0 8px 26px rgba(43,58,74,.14);
  animation: tsd-rail-in .45s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes tsd-rail-in { from { opacity:0; transform: translateY(-50%) translateX(18px);} to { opacity:1; transform: translateY(-50%) translateX(0);} }
.tsd-side-rail .tsd-view-btn {
  position: relative; width: 60px; height: 60px; border-radius: 12px; padding: 0;
  border: 2px solid #e5ded0; background: #fff center/contain no-repeat;
  cursor: pointer; overflow: hidden; outline: none;
  transition: transform .2s cubic-bezier(.2,.9,.3,1), box-shadow .2s ease, border-color .2s ease;
  animation: tsd-view-pop .4s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes tsd-view-pop { from { opacity:0; transform: translateX(14px) scale(.9);} to { opacity:1; transform: translateX(0) scale(1);} }
.tsd-side-rail .tsd-view-btn:hover { transform: scale(1.08); border-color: #cbb98a; box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.tsd-side-rail .tsd-view-btn.is-active { border-color: #b8974a; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #b8974a; }
.tsd-side-rail .tsd-view-lbl {
  position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; line-height: 1.5;
  background: rgba(43,58,74,.85); color: #fff; padding: 1px 3px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .3px;
}
@media (max-width: 860px) {
  .tsd-side-rail {
    position: absolute; right: 8px; top: 50%; bottom: auto; left: auto;
    transform: translateY(-50%); order: 0; align-self: auto;
    flex-direction: column; gap: 8px; padding: 6px; border-radius: 14px;
    background: rgba(255,255,255,.82);
  }
  .tsd-side-rail .tsd-view-btn { width: 42px; height: 42px; border-radius: 10px; }
  .tsd-side-rail .tsd-view-lbl { font-size: 8px; }
}
