/* ================================================================
   TON ATELIER — Custom Apparel Studio  v1.0.3
   ================================================================ */
*,*::before,*::after{box-sizing:border-box;}

/* ── Product page ─────────────────────────────────────────────── */
.tac-product-configurator{margin:24px 0;font-family:inherit;}
.tac-section{margin-bottom:24px;}
.tac-label{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:#888;margin:0 0 10px;}
.tac-hint{font-size:12px;color:#aaa;margin:0;}

/* Swatches */
.tac-swatches{display:flex;flex-wrap:wrap;gap:7px;}
.tac-swatch{width:34px;height:34px;border-radius:50%;border:2px solid transparent;cursor:pointer;background-size:cover;background-position:center;padding:0;transition:transform .15s,border-color .15s;}
.tac-swatch:hover{transform:scale(1.15);}
.tac-swatch-active{border-color:#111;transform:scale(1.1);box-shadow:0 0 0 2px #fff,0 0 0 4px #111;}
.tac-selected-color-name{font-size:13px;color:#666;margin:7px 0 0;min-height:16px;}

/* Size grid */
.tac-size-table{width:100%;border-collapse:collapse;font-size:12px;}
.tac-size-table th{background:#f5f5f5;font-size:11px;font-weight:700;text-align:center;padding:5px 3px;border:1px solid #e5e5e5;min-width:46px;}
.tac-size-table td{text-align:center;padding:3px;border:1px solid #eee;}
.tac-size-input{width:46px;text-align:center;border:1px solid #ddd;border-radius:4px;padding:4px 2px;font-size:14px;-moz-appearance:textfield;appearance:textfield;}
.tac-size-input::-webkit-outer-spin-button,.tac-size-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}
.tac-size-input:focus{border-color:#111;outline:none;}
.tac-size-input.tac-out-of-stock{background:#fafafa;color:#ccc;cursor:not-allowed;}
.tac-qty-summary{font-size:14px;color:#555;margin:8px 0 0;}

/* Decoration tabs (product page) */
.tac-deco-tabs{display:flex;gap:8px;flex-wrap:wrap;}
.tac-deco-tab{display:flex;flex-direction:column;align-items:center;gap:3px;padding:10px 14px;border:1.5px solid #e0e0e0;border-radius:10px;background:#fff;cursor:pointer;min-width:100px;text-align:center;transition:border-color .15s,background .15s;}
.tac-deco-tab:hover{border-color:#aaa;background:#fafafa;}
.tac-deco-tab.tac-deco-active{border-color:#111;background:#f0f0f0;}
.tac-deco-icon{font-size:20px;line-height:1;}
.tac-deco-tab strong{font-size:12px;}
.tac-deco-tab small{font-size:11px;color:#888;}

/* Product page price summary */
.tac-price-summary{background:#f8f8f8;border-radius:10px;padding:14px 18px;margin:0 0 18px;}
.tac-price-row{display:flex;justify-content:space-between;font-size:14px;padding:4px 0;border-bottom:1px solid #eee;}
.tac-price-row:last-of-type{border-bottom:none;}
.tac-price-row.tac-grand-total{font-size:16px;font-weight:700;margin-top:5px;padding-top:8px;border-top:2px solid #ddd;}
.tac-price-note{font-size:11px;color:#aaa;margin:6px 0 0;text-align:right;}

.tac-btn-design-now{width:100%;padding:15px;background:#111;color:#fff;border:none;border-radius:10px;font-size:16px;font-weight:700;cursor:pointer;letter-spacing:.02em;transition:background .2s,transform .1s;}
.tac-btn-design-now:hover:not(:disabled){background:#333;}
.tac-btn-design-now:active:not(:disabled){transform:scale(.98);}
.tac-btn-design-now:disabled{background:#ccc;cursor:not-allowed;}
.tac-cta-note{font-size:12px;color:#999;text-align:center;margin:7px 0 0;}

/* ================================================================
   MODAL
   ================================================================ */
body.tac-modal-open{overflow:hidden;}

.tac-overlay{
  position:fixed;inset:0;background:rgba(0,0,0,.58);
  z-index:99999;display:flex;align-items:center;justify-content:center;
  padding:8px;backdrop-filter:blur(4px);
}

.tac-modal{
  background:#fff;border-radius:18px;
  width:100%;max-width:1440px;max-height:96vh;
  display:flex;flex-direction:column;overflow:hidden;
  box-shadow:0 28px 80px rgba(0,0,0,.38);
}

.tac-modal-header{
  display:flex;align-items:center;gap:14px;
  padding:13px 20px;border-bottom:1px solid #eee;
  background:#fafafa;flex-shrink:0;
}
.tac-modal-logo{font-weight:700;font-size:15px;white-space:nowrap;}
.tac-modal-tagline{flex:1;font-size:12px;color:#888;text-align:center;}
.tac-modal-close{background:none;border:none;font-size:20px;cursor:pointer;color:#bbb;padding:4px 8px;border-radius:6px;line-height:1;flex-shrink:0;}
.tac-modal-close:hover{background:#f0f0f0;color:#333;}

.tac-modal-body{display:flex;flex:1;overflow:hidden;min-height:0;}

/* ── Left panel ── */
.tac-left-panel{
  width:300px;flex-shrink:0;overflow-y:auto;
  border-right:1px solid #eee;padding:14px 16px;
  display:flex;flex-direction:column;gap:0;
}

.tac-panel-section{padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid #f0f0f0;}
.tac-panel-section:last-child{border-bottom:none;margin-bottom:0;}
.tac-section-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:#bbb;margin:0 0 8px;}

/* Decoration pills */
.tac-deco-pills{display:flex;gap:6px;flex-wrap:wrap;}
.tac-deco-pill{padding:6px 12px;border:1.5px solid #ddd;border-radius:20px;background:#fff;cursor:pointer;font-size:12px;font-weight:600;transition:all .15s;white-space:nowrap;}
.tac-deco-pill:hover{border-color:#888;}
.tac-deco-pill.tac-pill-active{background:#111;color:#fff;border-color:#111;}
.tac-inline-label{font-size:12px;color:#555;display:flex;align-items:center;gap:6px;}
.tac-input-sm{width:52px;padding:4px 6px;border:1px solid #ddd;border-radius:6px;font-size:13px;text-align:center;}

/* ── Upload zone — always visible ── */
.tac-upload-zone{
  border:2px dashed #ddd;border-radius:10px;padding:18px 14px;
  text-align:center;cursor:pointer;background:#fafafa;
  transition:border-color .15s,background .15s;position:relative;
}
.tac-upload-zone:hover,.tac-upload-zone.tac-drag-over{border-color:#111;background:#f0f0f0;}
/* While upload in progress — subtle pulse */
.tac-upload-zone.tac-uploading{border-color:#666;animation:tacPulse 1s infinite alternate;}
@keyframes tacPulse{from{opacity:1;}to{opacity:.6;}}
/* At file limit */
.tac-upload-zone.tac-at-limit{border-color:#f0c040;background:#fffef0;cursor:default;}
.tac-upload-icon{font-size:24px;display:block;margin-bottom:4px;}
.tac-upload-primary{font-size:13px;margin:0 0 2px;}
.tac-upload-sub{font-size:11px;color:#aaa;margin:0;}
.tac-upload-link{color:#111;text-decoration:underline;cursor:pointer;}

.tac-progress-bar{height:4px;background:#eee;border-radius:3px;overflow:hidden;}
.tac-progress-fill{height:100%;background:#111;width:0;transition:width .2s;border-radius:3px;}

/* ── Artwork library ── */
.tac-library-label{font-size:11px;color:#888;margin-bottom:8px;}
.tac-library-hint{font-size:10px;color:#bbb;}

.tac-library-grid{
  display:grid;grid-template-columns:repeat(2,1fr);gap:8px;
}

.tac-lib-item{
  position:relative;border:2px solid #eee;border-radius:8px;
  overflow:hidden;cursor:pointer;aspect-ratio:1/1;background:#f5f5f5;
  transition:border-color .15s,transform .1s;
}
.tac-lib-item:hover{border-color:#aaa;transform:scale(1.03);}
.tac-lib-item.tac-lib-active{border-color:#111;box-shadow:0 0 0 2px rgba(0,0,0,.15);}
.tac-lib-item img{width:100%;height:100%;object-fit:contain;display:block;pointer-events:none;}

/* Active badge */
.tac-lib-active-badge{
  position:absolute;top:4px;left:5px;
  font-size:9px;color:#111;background:rgba(255,255,255,.9);
  border-radius:50%;width:14px;height:14px;
  display:flex;align-items:center;justify-content:center;
  font-weight:900;line-height:1;
}

/* Remove button on library item */
.tac-lib-remove{
  position:absolute;top:3px;right:3px;
  background:rgba(0,0,0,.55);color:#fff;border:none;
  width:20px;height:20px;border-radius:50%;font-size:11px;
  cursor:pointer;display:flex;align-items:center;justify-content:center;
  opacity:0;transition:opacity .15s;
  line-height:1;padding:0;
}
.tac-lib-item:hover .tac-lib-remove{opacity:1;}

/* View tags on library items (Front, Back…) */
.tac-lib-tags{
  position:absolute;bottom:3px;left:3px;
  display:flex;gap:2px;flex-wrap:wrap;
}
.tac-lib-tag{
  font-size:9px;font-weight:700;background:rgba(0,0,0,.60);
  color:#fff;padding:1px 4px;border-radius:3px;line-height:1.4;
}

/* ── Transform controls ── */
.tac-transform-controls{display:flex;flex-direction:column;gap:8px;}
.tac-transform-controls label{display:grid;grid-template-columns:42px 1fr 66px;align-items:center;gap:6px;font-size:12px;color:#555;}
.tac-transform-controls input[type="range"]{accent-color:#111;width:100%;}
.tac-ctrl-val{font-size:11px;color:#333;font-variant-numeric:tabular-nums;text-align:right;}
.tac-ctrl-val.tac-over-limit{color:#e44;}
.tac-ctrl-btns{display:flex;gap:5px;flex-wrap:wrap;}

/* Placement summary */
.tac-pl-row{display:flex;align-items:center;gap:6px;padding:5px 0;border-bottom:1px solid #f5f5f5;font-size:13px;}
.tac-pl-row:last-child{border-bottom:none;}
.tac-pl-dot{font-size:13px;}
.tac-pl-name{flex:1;font-weight:600;}
.tac-pl-size{font-size:11px;color:#888;}

/* Modal price */
.tac-price-rows{display:flex;flex-direction:column;gap:4px;}
.tac-pr{display:flex;justify-content:space-between;font-size:13px;padding:3px 0;}
.tac-pr-total{font-weight:700;font-size:15px;border-top:1.5px solid #eee;margin-top:3px;padding-top:7px;}

/* CTA */
.tac-cta-row{margin-top:auto;}
.tac-btn-add-cart{width:100%;padding:13px;background:#111;color:#fff;border:none;border-radius:10px;font-size:15px;font-weight:700;cursor:pointer;transition:background .2s;letter-spacing:.02em;}
.tac-btn-add-cart:hover:not(:disabled){background:#333;}
.tac-btn-add-cart:disabled{background:#ccc;cursor:not-allowed;}

/* Small buttons */
.tac-btn-sm{font-size:11px;padding:4px 9px;border:1px solid #ddd;border-radius:6px;background:#fff;cursor:pointer;white-space:nowrap;}
.tac-btn-sm:hover{background:#f5f5f5;}
.tac-btn-sm.tac-danger{border-color:#e55;color:#e55;}
.tac-btn-sm.tac-danger:hover{background:#fff5f5;}

/* ── Right panel ── */
.tac-right-panel{flex:1;display:flex;flex-direction:column;align-items:center;padding:16px 24px;background:#f4f4f4;overflow-y:auto;position:relative;}

.tac-view-tabs{display:flex;gap:6px;margin-bottom:12px;flex-wrap:wrap;justify-content:center;}
.tac-view-tab{padding:7px 18px;font-size:13px;font-weight:600;border-radius:22px;border:1.5px solid #ddd;background:#fff;cursor:pointer;transition:all .15s;}
.tac-view-tab:hover{border-color:#888;}
.tac-view-tab.tac-view-active{background:#111;border-color:#111;color:#fff;}

.tac-canvas-wrap{
  position:relative;width:100%;max-width:700px;
  aspect-ratio:1/1;background:#fff;border-radius:14px;overflow:hidden;
  box-shadow:0 4px 28px rgba(0,0,0,.10);user-select:none;transition:box-shadow .2s;
}
.tac-canvas-wrap.tac-canvas-dragover{box-shadow:0 0 0 3px #111,0 4px 28px rgba(0,0,0,.15);}

.tac-garment-img{width:100%;height:100%;object-fit:contain;display:block;pointer-events:none;transition:object-position .3s ease, transform .3s ease;}

/* Sleeve views: show full image, no zoom — the side image shows the full shirt */
.tac-canvas-wrap[data-view="left_sleeve"] .tac-garment-img,
.tac-canvas-wrap[data-view="right_sleeve"] .tac-garment-img {
  object-fit: contain;
  transform: none;
}

/* Print area — position/size set entirely by JS */
.tac-print-area{
  position:absolute;
  /* left/top/width/height injected by renderPrintArea() */
  border:1.5px solid rgba(210,120,30,.65);
  border-radius:3px;
  pointer-events:none;
  z-index:2;
  box-shadow:0 0 0 1px rgba(255,255,255,.25);
}
/* Corner tick marks (like a crop marker) */
.tac-print-area::before,
.tac-print-area::after{
  content:'';position:absolute;background:rgba(210,120,30,.50);
}
.tac-print-area::before{
  left:-1px;right:-1px;top:50%;height:1px;
  border:none;transform:none;
}
.tac-print-area::after{
  top:-1px;bottom:-1px;left:50%;width:1px;
}
.tac-print-area-label{
  position:absolute;bottom:-20px;left:50%;transform:translateX(-50%);
  font-size:10px;color:rgba(180,100,20,.75);white-space:nowrap;
  background:rgba(255,255,255,.7);padding:1px 6px;border-radius:3px;
}

/* Deco layer */
.tac-deco-layer{position:absolute;inset:0;pointer-events:none;z-index:3;}
.tac-deco-item{position:absolute;cursor:grab;pointer-events:all;transform-origin:center center;}
.tac-deco-item:active{cursor:grabbing;}
.tac-deco-item img{width:100%;display:block;pointer-events:none;user-select:none;-webkit-user-drag:none;}
.tac-deco-item:hover{outline:2px dashed rgba(0,0,0,.22);outline-offset:3px;}

/* Drop hint */
.tac-drop-hint{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.55);border-radius:14px;z-index:4;
  pointer-events:all;cursor:pointer;backdrop-filter:blur(2px);
}
.tac-drop-hint span{
  background:#fff;padding:10px 22px;border-radius:30px;
  box-shadow:0 2px 14px rgba(0,0,0,.12);font-size:14px;font-weight:600;color:#333;
  pointer-events:none;
}

/* View pill */
.tac-view-pill{
  position:absolute;bottom:10px;left:50%;transform:translateX(-50%);
  background:rgba(0,0,0,.40);color:#fff;font-size:11px;
  padding:3px 12px;border-radius:20px;pointer-events:none;
  backdrop-filter:blur(4px);z-index:5;
}

/* Floating size badge */
.tac-size-badge{
  position:absolute;background:rgba(0,0,0,.70);color:#fff;
  font-size:11px;font-weight:700;padding:3px 8px;
  border-radius:6px;pointer-events:none;z-index:10;white-space:nowrap;
}
.tac-size-badge.tac-badge-over{background:rgba(210,60,40,.85);}

.tac-canvas-hint{font-size:11px;color:#aaa;margin-top:8px;text-align:center;}

/* Toast */
.tac-added-notice{
  position:fixed;bottom:22px;right:22px;background:#111;color:#fff;
  padding:13px 18px;border-radius:12px;font-size:14px;z-index:999999;
  box-shadow:0 8px 32px rgba(0,0,0,.28);opacity:0;transform:translateY(16px);
  transition:opacity .3s,transform .3s;display:flex;gap:10px;
  align-items:center;flex-wrap:wrap;max-width:360px;
}
.tac-added-notice.tac-notice-visible{opacity:1;transform:translateY(0);}
.tac-cart-link{color:#adf;text-decoration:underline;}
.tac-notice-close{background:none;border:none;color:#aaa;cursor:pointer;font-size:16px;padding:0 0 0 6px;margin-left:auto;}

/* Responsive */
@media (max-width:900px){
  .tac-modal-body{flex-direction:column-reverse;}
  .tac-left-panel{width:100%;border-right:none;border-top:1px solid #eee;max-height:46vh;}
  .tac-canvas-wrap{max-width:400px;}
  .tac-modal-tagline{display:none;}
}
@media (max-width:480px){
  .tac-overlay{padding:0;}
  .tac-modal{border-radius:0;max-height:100vh;}
  .tac-canvas-wrap{max-width:280px;}
  .tac-library-grid{grid-template-columns:repeat(3,1fr);}
}

/* Sleeve note */
.tac-sleeve-note {
  font-size: 11px;
  color: #888;
  text-align: center;
  margin: 4px 0 0;
  font-style: italic;
}

/* ── Card-style size grid (product page) ── */
.tac-size-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tac-size-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  min-width: 70px;
  transition: border-color .15s;
}
.tac-size-card:hover { border-color: #bbb; }
.tac-size-card-oos { opacity: .5; }

.tac-size-name {
  font-size: 14px;
  font-weight: 700;
  color: #222;
}

.tac-size-price {
  font-size: 11px;
  color: #555;
  font-weight: 600;
}

.tac-size-stock {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
}
.tac-stock-ok  { background: #eafaf1; color: #1a7a4a; }
.tac-stock-low { background: #fff8e1; color: #b07d00; }
.tac-stock-out { background: #fdecea; color: #c0392b; }

.tac-size-input-wrap { margin-top: 4px; }
.tac-size-input {
  width: 56px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 5px 2px;
  font-size: 14px;
  font-weight: 600;
  -moz-appearance: textfield;
  appearance: textfield;
}
.tac-size-input::-webkit-outer-spin-button,
.tac-size-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tac-size-input:focus { border-color: #111; outline: none; }
.tac-size-input.tac-out-of-stock { background: #fafafa; color: #ccc; cursor: not-allowed; }

.tac-qty-totals {
  display: flex;
  gap: 20px;
  padding: 10px 14px;
  background: #f8f8f8;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 4px;
}
.tac-qty-row { display: flex; gap: 8px; align-items: center; }
.tac-qty-row span { color: #666; }
.tac-qty-row strong { color: #111; }

/* ── Modal qty grid ── */
.tac-modal-qty-totals {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}
.tac-modal-qty-totals strong { color: #333; }
.tac-modal-size-price {
  font-size: 11px;
  color: #888;
  text-align: center;
  padding: 2px 3px 5px;
  border: 1px solid #eee;
}

/* ── Volume pricing discount table (product page) ── */
.tac-pricing-table-section { margin-top: 4px; }

.tac-vol-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
}

.tac-vol-table thead th {
  background: #1a1a1a;
  color: #fff;
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}

.tac-vol-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.tac-vol-row { transition: background .12s; }
.tac-vol-row:last-child td { border-bottom: none; }
.tac-vol-row:hover { background: #f9f9f9; }

/* Active tier highlight */
.tac-vol-row-active {
  background: #f0faf4 !important;
}
.tac-vol-row-active .tac-vol-qty {
  font-weight: 700;
  color: #1a7a4a;
}
.tac-vol-row-active .tac-vol-saving {
  font-weight: 700;
}

.tac-vol-qty   { color: #333; }
.tac-vol-price { font-weight: 600; color: #111; font-size: 14px; }

.tac-vol-saving {
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
}
.tac-saving-mid  { color: #b07d00; }
.tac-saving-high { color: #1a7a4a; }

/* ── Per-unit price row ── */
.tac-per-unit-row,
.tac-pr-per-unit {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e0e0e0;
}
.tac-per-unit-row span,
.tac-pr-per-unit span {
  font-size: 12px;
  color: #666;
}
.tac-per-unit-row strong,
.tac-pr-per-unit strong {
  font-size: 16px;
  color: #111;
  font-weight: 800;
}

/* ── Deal / discount price row ── */
.tac-deal-row {
  margin-top: 10px;
  padding: 10px 14px;
  background: #fff8e1;
  border: 1.5px solid #f9c02e;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tac-deal-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #8a6500;
  flex-basis: 100%;
  margin-bottom: 2px;
}
.tac-deal-regular {
  font-size: 13px;
  color: #aaa;
  text-decoration: line-through;
}
.tac-deal-your {
  font-size: 20px;
  font-weight: 900;
  color: #1a1a1a;
}
.tac-deal-badge {
  font-size: 12px;
  font-weight: 800;
  background: #f9c02e;
  color: #5a3e00;
  padding: 3px 8px;
  border-radius: 20px;
  margin-left: auto;
}

/* ── Modal-specific overrides for more compact layout ── */
/* Smaller size inputs in modal qty grid */
#tac-modal-size-grid .tac-size-table th { min-width: 36px; font-size: 10px; padding: 4px 2px; }
#tac-modal-size-grid .tac-size-input { width: 38px; font-size: 12px; padding: 3px 1px; }
#tac-modal-size-grid .tac-modal-size-price { font-size: 10px; padding: 2px 2px; }

/* Tighter price block in modal */
#tac-price-block .tac-pr { padding: 4px 0; }
#tac-price-block .tac-pr-total { padding-top: 8px; margin-top: 2px; }

/* Compact decoration pills in modal */
.tac-deco-pill { font-size: 13px; }
.tac-deco-pill .tac-pill-icon { font-size: 16px; }

/* Modal header more compact */
.tac-modal-header { padding: 10px 18px; }

/* Right panel — center canvas with optimal padding */
.tac-right-panel { padding: 12px 20px 16px; }

/* View tabs above canvas — tighter */
.tac-view-tabs { margin-bottom: 10px; gap: 6px; }

/* ── Print area size bar (below canvas in modal) ── */
.tac-pa-size-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 12px;
  background: #f0f0f0;
  border-radius: 8px;
  font-size: 12px;
  width: 100%;
  max-width: 700px;
  box-sizing: border-box;
}
.tac-pa-size-label {
  color: #888;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.tac-pa-size-field {
  display: flex;
  align-items: center;
  gap: 3px;
}
.tac-pa-size-field input[type="number"] {
  width: 54px;
  padding: 4px 6px;
  border: 1.5px solid #ddd;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  background: #fff;
  -moz-appearance: textfield;
  appearance: textfield;
}
.tac-pa-size-field input[type="number"]:focus {
  border-color: #d2781e;
  outline: none;
}
.tac-pa-size-field input::-webkit-outer-spin-button,
.tac-pa-size-field input::-webkit-inner-spin-button { -webkit-appearance: none; }
.tac-pa-size-unit { color: #999; font-size: 11px; }
.tac-pa-size-sep  { color: #bbb; font-weight: 700; }
.tac-pa-apply-btn {
  margin-left: auto;
  padding: 4px 12px;
  background: #d2781e;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.tac-pa-apply-btn:hover { background: #b5650f; }


/* ── Buy Blank button ── */
.tac-or-divider {
  text-align: center;
  margin: 12px 0;
  position: relative;
  color: #aaa;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.tac-or-divider::before,
.tac-or-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: #e0e0e0;
}
.tac-or-divider::before { left: 0; }
.tac-or-divider::after  { right: 0; }
.tac-or-divider span {
  background: #fff;
  padding: 0 12px;
  position: relative;
  z-index: 1;
}

.tac-btn-buy-blank {
  width: 100%;
  padding: 14px 20px;
  background: #fff;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.tac-btn-buy-blank:not(:disabled):hover {
  background: #1a1a1a;
  color: #fff;
}
.tac-btn-buy-blank:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.tac-blank-note { font-size: 11px; color: #999; margin-top: 4px; }

/* ── Business badge ── */
.tac-business-badge {
  background: linear-gradient(135deg, #1a3a52, #2c5e8f);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(26,58,82,.25);
}

/* ── Business pricing in size grid ── */
.tac-size-price-old {
  color: #aaa;
  text-decoration: line-through;
  font-size: 11px;
  font-weight: 400;
}
.tac-size-price-biz {
  color: #1a3a52;
  font-weight: 800;
}

/* ── Business price in modal qty grid ── */
.tac-modal-price-old {
  color: #aaa;
  text-decoration: line-through;
  font-size: 10px;
  font-weight: 400;
  display: block;
}
.tac-modal-price-biz {
  color: #1a3a52;
  font-weight: 800;
}

/* ═══════════════════════════════════════════════════════════
   Custom Neck Label add-on (per-size uploads)
═══════════════════════════════════════════════════════════ */
#tac-neck-label-section { }

.tac-neck-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
}
.tac-neck-toggle input[type="checkbox"] { flex-shrink: 0; transform: scale(1.1); }
.tac-neck-price-tag {
  display: inline-block;
  font-weight: 500;
  font-size: 12px;
  color: #666;
  margin-left: 4px;
}

.tac-neck-hint {
  font-size: 11px;
  color: #888;
  margin: 6px 0;
  font-style: italic;
}

#tac-neck-slots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}
.tac-neck-slot {
  border: 1.5px dashed #d0d0d0;
  border-radius: 8px;
  padding: 8px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 96px;
  transition: border-color .15s, background .15s;
}
.tac-neck-slot:has(.tac-neck-slot-preview) {
  border-style: solid;
  border-color: #46b450;
  background: #fff;
}
.tac-neck-slot-uploading {
  opacity: 0.5;
  pointer-events: none;
}
.tac-neck-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.tac-neck-slot-head strong { font-size: 13px; }
.tac-neck-slot-qty { color: #888; font-size: 11px; }

.tac-neck-slot-preview {
  width: 100%;
  height: 56px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid #eee;
}
.tac-neck-slot-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}
.tac-neck-slot-filename {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #555;
}
.tac-neck-remove {
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  color: #c33;
  font-size: 11px;
  line-height: 1;
  padding: 0;
}
.tac-neck-remove:hover { background: #fee; border-color: #c33; }

.tac-neck-upload-btn {
  display: block;
  text-align: center;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 18px 8px;
  font-size: 11px;
  color: #555;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.tac-neck-upload-btn:hover {
  background: #f0f7ff;
  border-color: #1a73e8;
  color: #1a73e8;
}

.tac-neck-warn {
  background: #fff8e1;
  border: 1px solid #f9c02e;
  color: #8a6500;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════
   Mouse resize — corner handles on the placed artwork
═══════════════════════════════════════════════════════════ */
.tac-deco-item {
  /* Stronger outline when artwork is placed so resize affordance is visible */
  outline: 1.5px dashed rgba(0, 0, 0, 0.35);
  outline-offset: 4px;
  transition: outline-color .15s;
}
.tac-deco-item:hover {
  outline-color: rgba(0, 115, 230, 0.65);
}

.tac-resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 2px solid #1a73e8;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  z-index: 4;
  /* Slight scale on hover for feedback */
  transition: transform .12s, background .12s;
}
.tac-resize-handle:hover {
  transform: scale(1.18);
  background: #1a73e8;
}

/* Position at the four corners, slightly outside the artwork bounding box */
.tac-handle-tl { top:  -10px; left:  -10px; cursor: nwse-resize; }
.tac-handle-tr { top:  -10px; right: -10px; cursor: nesw-resize; }
.tac-handle-bl { bottom: -10px; left:  -10px; cursor: nesw-resize; }
.tac-handle-br { bottom: -10px; right: -10px; cursor: nwse-resize; }

/* Touch devices: make handles a bit bigger for finger taps */
@media (pointer: coarse) {
  .tac-resize-handle {
    width: 22px;
    height: 22px;
  }
  .tac-handle-tl, .tac-handle-bl { left:  -13px; }
  .tac-handle-tr, .tac-handle-br { right: -13px; }
  .tac-handle-tl, .tac-handle-tr { top:    -13px; }
  .tac-handle-bl, .tac-handle-br { bottom: -13px; }
}

/* ═══════════════════════════════════════════════════════════
   Top-right X delete button on placed artwork
═══════════════════════════════════════════════════════════ */
.tac-deco-delete {
  position: absolute;
  top: -34px;
  right: -10px;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  background: #dc3232;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  z-index: 5;
  font-family: Arial, sans-serif;
  transition: transform .12s, background .12s;
}
.tac-deco-delete:hover {
  transform: scale(1.15);
  background: #b51e1e;
}
.tac-deco-delete:active {
  transform: scale(0.95);
}

/* On coarse pointers (touch), make it larger for finger taps */
@media (pointer: coarse) {
  .tac-deco-delete {
    width: 30px;
    height: 30px;
    top: -40px;
    right: -13px;
    font-size: 20px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Artwork Picker Popup (Saved Designs Library + Upload)
═══════════════════════════════════════════════════════════ */
.tac-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001; /* above the customizer modal */
  background: rgba(0,0,0,0.55);
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: tacFadeIn .15s ease;
}
@keyframes tacFadeIn { from { opacity: 0; } to { opacity: 1; } }

.tac-picker-modal {
  background: #fff;
  border-radius: 14px;
  width: min(720px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  overflow: hidden;
  animation: tacSlideUp .2s ease;
}
@keyframes tacSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.tac-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.tac-picker-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
}
.tac-picker-close {
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
  transition: color .15s;
}
.tac-picker-close:hover { color: #1a1a1a; }

.tac-picker-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}
.tac-picker-section { margin: 0 0 18px; }
.tac-picker-section:last-child { margin-bottom: 0; }
.tac-picker-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

/* Divider between library and upload */
.tac-picker-divider {
  text-align: center;
  margin: 14px 0;
  position: relative;
  color: #aaa;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.tac-picker-divider::before,
.tac-picker-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #ececec;
}
.tac-picker-divider::before { left: 0; }
.tac-picker-divider::after  { right: 0; }
.tac-picker-divider span {
  background: #fff;
  padding: 0 14px;
  position: relative;
  z-index: 1;
}

/* Library grid */
.tac-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 520px) {
  .tac-picker-grid { grid-template-columns: repeat(2, 1fr); }
}

.tac-picker-loading,
.tac-picker-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 12px;
  color: #888;
  font-size: 13px;
}
.tac-picker-empty p { margin: 4px 0; }

.tac-picker-design {
  position: relative;
  border: 1.5px solid #e8e8e8;
  border-radius: 8px;
  padding: 8px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tac-picker-design:hover {
  border-color: #1a73e8;
  background: #f5faff;
  transform: translateY(-1px);
}
.tac-picker-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #f0f0f0;
}
.tac-picker-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.tac-picker-thumb-placeholder {
  font-size: 11px;
  color: #999;
}
.tac-picker-meta { font-size: 11px; }
.tac-picker-fname {
  color: #333;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tac-picker-date { color: #999; font-size: 10px; margin-top: 2px; }

.tac-picker-design-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  padding: 0;
  background: #fff;
  color: #c33;
  border: 1.5px solid #ddd;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s, border-color .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.tac-picker-design:hover .tac-picker-design-remove { opacity: 1; }
.tac-picker-design-remove:hover {
  background: #c33;
  color: #fff;
  border-color: #c33;
}

/* Upload zone inside the popup keeps the same look as the inline one */
.tac-picker-upload-zone.tac-drag-over {
  border-color: #1a73e8;
  background: #f0f7ff;
}

/* Mobile tweaks */
@media (max-width: 520px) {
  .tac-picker-overlay { padding: 12px; }
  .tac-picker-head { padding: 14px 16px; }
  .tac-picker-body { padding: 14px 16px; }
  .tac-picker-modal { border-radius: 12px; }
}

/* ═══════════════════════════════════════════════════════════
   Embroidery pricing error banner (min order, oversize design)
═══════════════════════════════════════════════════════════ */
.tac-embroidery-error {
  background: #fff3e0;
  border: 1.5px solid #ff9800;
  color: #7a4a00;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════
   Embroidery volume pricing — size × qty matrix on product page
═══════════════════════════════════════════════════════════ */
.tac-vol-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tac-vol-matrix thead th {
  background: #1a1a1a;
  color: #fff;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 10px 8px;
  text-align: center;
  border: 0;
}
.tac-vol-matrix .tac-vol-corner {
  text-align: left;
  padding-left: 14px;
}
.tac-vol-matrix tbody th.tac-vol-srow {
  text-align: left;
  font-weight: 600;
  padding: 10px 14px;
  background: #fafafa;
  color: #1a1a1a;
  border-bottom: 1px solid #ececec;
}
.tac-vol-matrix tbody td.tac-vol-cell {
  text-align: center;
  padding: 10px 8px;
  border-bottom: 1px solid #ececec;
  font-weight: 600;
  color: #1a1a1a;
  transition: background-color .15s;
}
/* Highlight the customer's current qty column */
.tac-vol-matrix thead th.tac-vol-col-active {
  background: #0c3a26; /* dark green to match the existing tier-active accent */
}
.tac-vol-matrix tbody td.tac-vol-cell-active {
  background: #ecf7f0;
  color: #0c5132;
}
.tac-vol-matrix tbody tr:hover td.tac-vol-cell:not(.tac-vol-cell-active) {
  background: #fafafa;
}

.tac-pricing-min {
  font-size: 12px;
  color: #555;
  margin: 10px 0 0;
  padding: 8px 10px;
  background: #fff8e1;
  border-left: 3px solid #f9c02e;
  border-radius: 0 4px 4px 0;
}
.tac-pricing-empty {
  padding: 16px;
  text-align: center;
  color: #999;
  font-size: 13px;
  background: #fafafa;
  border-radius: 6px;
}

/* Small-screen tweak: allow horizontal scroll if the matrix overflows */
@media (max-width: 540px) {
  #tac-pricing-table-inner { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tac-vol-matrix { min-width: 460px; }
}

/* ═══════════════════════════════════════════════════════════
   Per-unit decoration sub-line (+ embroidery bracket info)
═══════════════════════════════════════════════════════════ */
.tac-price-meta {
  margin: -4px 0 6px;
  padding: 2px 0;
  font-size: 11px;
  color: #777;
  font-weight: 500;
  font-style: italic;
  text-align: right;
}
.tac-price-meta::before {
  content: '↳ ';
  margin-right: 2px;
  color: #aaa;
  font-style: normal;
}


/* ═══════════════════════════════════════════════════════════
   "Select sizes first" guidance — button + message + pulse
═══════════════════════════════════════════════════════════ */
/* Buttons that look disabled but stay clickable so we can show guidance */
.tac-btn-needs-sizes {
  opacity: 0.5;
  cursor: pointer; /* still allow clicks — we intercept to show the message */
}
.tac-btn-needs-sizes:hover {
  opacity: 0.65;
}

/* The friendly inline message */
.tac-needs-sizes-msg {
  background: #fff8e1;
  border: 1.5px solid #f9c02e;
  color: #7a4a00;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.tac-needs-sizes-msg strong { color: #5a3500; }

/* Pulse animation on the size grid — draws the eye to where action is needed */
@keyframes tacGridPulse {
  0%   { box-shadow: 0 0 0 0 rgba(249, 192, 46, 0); }
  30%  { box-shadow: 0 0 0 6px rgba(249, 192, 46, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(249, 192, 46, 0); }
}
.tac-grid-pulse {
  border-radius: 12px;
  animation: tacGridPulse 1.2s ease-out 2;
}
