/* =====================================================
   BASE RESET
===================================================== */
#prem-acrylic-frame-builder,
#prem-acrylic-frame-builder * {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#prem-acrylic-frame-builder button {
  cursor: pointer;
}

@media (max-width: 768px) {

  #prem-acrylic-frame-builder {
    padding-left: center;
    padding-right: center;
  }

  #prem-editorCanvas {
    max-width: 100%;
    height: auto !important;
  }
}

#prem-acrylic-frame-builder .canvas-container{
   background: transparent;
}

#prem-acrylic-frame-builder .prem-editor-canvas-wrap.prem-has-image .canvas-container{
   background:#607d8b;
}
/* =====================================================
   MODAL BASE
===================================================== */
.prem-editor-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ================================
DIMENSION LABELS
================================ */

.prem-dimension{
display:none;
}
.prem-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);
  z-index:10;
  pointer-events:none;
}

/* width bottom center */
.prem-dim-width{
  bottom: 7px;
  left:50%;
  transform:translateX(-50%);
}

/* height left center */
.prem-dim-height{
  left:-40px;
  top:50%;
  transform:translateY(-50%) rotate(-90deg);
}

/* thickness top right */
.prem-dim-thickness{
  top:10px;
  right:10px;
}
/* =====================================================
   MODAL CONTENT
===================================================== */
.prem-editor-content {
  background: #fff;
  width: 96vw;
  max-width: 1300px;
  min-height: 92vh;
  padding: 32px 36px;
  border-radius: 18px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* =====================================================
   CLOSE BUTTON
===================================================== */
.prem-close-editor {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f1f1;
  font-size: 22px;
  line-height: 1;
}

.prem-close-editor:hover {
  background: #e2e2e2;
}

/* =====================================================
   CANVAS AREA
===================================================== */
.prem-editor-canvas-wrap {
  margin: 18px auto;
  background: #fafafa;
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  width: fit-content;
  max-width: 100%;
}

/* Fabric canvas */
#prem-editorCanvas {
  border: 2px dashed #d1d5db;
  background: transparent !important;
  display: block;
}

/* ==========================================
   FRAME PREVIEW BACKGROUND
========================================== */

.prem-editor-canvas-wrap {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: background-image .3s ease, opacity .3s ease;
}

/* Hide background when image uploaded */
.prem-editor-canvas-wrap.prem-has-image {
  background-image: none !important;
}

#prem-editorCanvas {
  max-width: 100%;
  height: auto;
}

#prem-editorCanvas {
  width: 100% !important;
  display: block;
}

.prem-frame-shapes {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}

.prem-frame-shapes button {
  padding: 6px 18px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 14px;
}

.prem-frame-shapes button.prem-active {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* =====================================================
   CLICK TO UPLOAD OVERLAY
===================================================== */
.prem-editor-canvas-wrap::after {
  content: "Click to upload photo";
  position: absolute;
  inset: 12px;
  background: rgba(255,255,255,0.85);
  border-radius: 10px;
  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;
}

.prem-editor-canvas-wrap:not(.prem-has-image):hover::after {
  opacity: 1;
}

.prem-editor-canvas-wrap.prem-has-image::after {
  display: none;
}

/* =====================================================
   EDITOR TOOLS
===================================================== */
.prem-editor-tools {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
}

.prem-editor-tools button {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 14px;
  transition: all .15s ease;
}

.prem-editor-tools button:hover {
  background: #f3f4f6;
}

/* =====================================================
   FRAME COLORS
===================================================== */
.prem-frame-colors {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 18px 0;
}

.prem-frame-colors span {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid #ddd;
}

.prem-frame-colors span[data-color="black"] { background:#000; }
.prem-frame-colors span[data-color="white"] { background:#fff; }
.prem-frame-colors span[data-color="gold"]  { background:#d4af37; }
.prem-frame-colors span[data-color="red"]   { background:#c00; }

.prem-frame-colors span.prem-active {
  outline: 3px solid #000;
}

/* =====================================================
   SIZE & THICKNESS
===================================================== */
.prem-size-section {
  margin-top: 12px;
}

.prem-sizes,
.prem-thickness {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.prem-sizes button,
.prem-thickness button {
  padding: 6px 14px;
  font-size: 13px;
}


.prem-sizes button:hover,
.prem-thickness button:hover {
  border-color: #d60000;
  color: #d60000;
}

.prem-sizes button.prem-active,
.prem-thickness button.prem-active {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* Disable state */
.prem-sizes button.prem-disabled,
.prem-thickness button.prem-disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* =====================================================
   PRICE
===================================================== */
.prem-price-wrap {
  margin: 20px 0 16px;
  text-align: center;
}

.prem-price-current {
  font-size: 36px;
  font-weight: 800;
  color: #111;
}

.prem-price-old {
  font-size: 16px;
  color: #999;
  text-decoration: line-through;
  margin-top: 6px;
}

/* =====================================================
   BUY BUTTON
===================================================== */
.prem-primary-btn {
  padding: 14px 26px;
  border-radius: 12px;
  border: none;
  background: #1faa00;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease;
}

.prem-primary-btn:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}

.prem-primary-btn:active {
  transform: scale(.97);
}

.prem-buy-btn {
  width: 100%;
  max-width: 360px;
  padding: 12px 18px;
  font-size: 15px;
  border-radius: 10px;

  display: block;
  margin: 0 auto;
}
/* =====================================================
   MOBILE
===================================================== */
@media (max-width: 768px) {

  .prem-editor-content {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    padding: 20px;
  }

  .prem-editor-tools button {
    font-size: 13px;
    padding: 6px 12px;
  }

  .prem-price-current {
    font-size: 30px;
  }
}