/* ==============================
   ROOT WRAPPER
============================== */
.taf-builder {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: Inter, Arial, sans-serif;
}

/* ==============================
   CANVAS AREA
============================== */

/* Remove grey / dashed preview background */
.taf-canvas-wrap {
    position: relative;          /* REQUIRED */
    background: transparent;
    border: none;
    box-shadow: none;
    margin: 0 auto 20px;         /* enter properly */
    text-align: center;
    cursor: pointer;
    max-width: 420px; 
    width: 100%;

}

/* Optional: keep canvas centered & clean */
#tafCanvas {
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.taf-canvas-wrap canvas {
  width: 100%;
  height: auto;
  border-radius: 8px;
  
}

/* Upload overlay */
.taf-canvas-wrap::after {
    content: "Preview";
    position: absolute;
    inset: 0;                    /*perfect alignment */
    background: rgba(255,255,255,0.75);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #555;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
}

/* Show only before upload */
.taf-canvas-wrap:not(.taf-has-image):hover::after {
    opacity: 1;
}

/* Hide forever after upload */
.taf-canvas-wrap.taf-has-image::after {
    display: none;
}

.taf-canvas-wrap.taf-replace-armed::after {
  content: "Tap again to replace photo";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  pointer-events: none;
}

.taf-shapes {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.taf-shapes button {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}

.taf-shapes button.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* DIMENSION LABELS */

.taf-dimension{
  position:absolute;
  background:#fff;
  padding:6px 10px;
  border-radius:8px;
  font-size:13px;
  font-weight:600;
  box-shadow:0 2px 6px rgba(0,0,0,0.15);
  pointer-events:none;
  z-index:10;
  display:none;
}

.taf-dim-width{
  bottom: 0px;
  left:50%;
  transform:translateX(-50%);
}

.taf-dim-height{
  left:-40px;
  top:50%;
  transform:translateY(-50%) rotate(-90deg);
}

.taf-dim-thickness{
  top:10px;
  right:10px;
}

/* Default canvas background */
.taf-builder .canvas-container{
   background: transparent;
}

/* After image upload */
.taf-builder .taf-canvas-wrap.taf-has-image .canvas-container{
   background:#607d8b;
}
/* ==========================================
   SHAPE MOCKUP BACKGROUND (UX PREVIEW)
========================================== */

.taf-canvas-wrap {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  transition: background-image 0.3s ease;
}

/* Hide preview after upload */
.taf-canvas-wrap.taf-has-image {
  background-image: none !important;
}

/* ==============================
   TOOLS
============================== */
.taf-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.taf-tools button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #d0d0d0;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.taf-tools button:hover {
  background: #f1f1f1;
}

/* ==============================
   FRAME COLORS
============================== */
.taf-frame-colors {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 25px;
}

.taf-frame-colors span {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
}

.taf-frame-colors span[data-color="black"] { background: #000; }
.taf-frame-colors span[data-color="white"] { background: #fff; }
.taf-frame-colors span[data-color="gold"]  { background: #d4af37; }
.taf-frame-colors span[data-color="red"]   { background: #e53935; }

.taf-frame-colors span.active {
  outline: 3px solid #000;
}

/* ==============================
   HEADINGS
============================== */
.taf-builder h4 {
  margin: 20px 0 10px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

/* ==============================
   SIZE & THICKNESS
============================== */
.taf-sizes,
.taf-thickness {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.taf-sizes button,
.taf-thickness button {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.taf-sizes button:hover,
.taf-thickness button:hover {
  background: #f2f2f2;
}

.taf-sizes button.active,
.taf-thickness button.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* Disable size & thickness before upload */
.taf-disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}
/* ==============================
   PRICE
============================== */
.taf-price {
  text-align: center;
  margin: 25px 0;
  font-size: 22px;
  font-weight: 700;
}

.taf-price del {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  color: #888;
  font-weight: 400;
}

/* ==============================
   BUY BUTTON
============================== */
.taf-buy-btn {
  display: block;
  width: 45%;
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  border-radius: 12px;
  border: none;
  background: #2db400;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.taf-buy-btn:hover {
  background: #25a100;
}

/* ==============================
   RESPONSIVE
============================== */
@media (max-width: 768px) {
  .taf-builder {
    padding: 20px 15px;
  }

  .taf-price {
    font-size: 20px;
  }

  .taf-buy-btn {
    font-size: 16px;
  }
}
