/* =========================
   MODAL BASE
========================= */
.nampl-editor-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* =========================
   MODAL CONTENT
========================= */
.nampl-editor-content {
  background: #ffffff;
  width: 96vw;
  max-width: 1280px;
  min-height: 92vh;
  padding: 32px 36px;
  border-radius: 16px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
}
.nampl-editor-modal {
  align-items: flex-start; /* important for scrolling */
}

.nampl-editor-content {
  max-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
}

#nampl-sizeModal .nampl-editor-content {
  max-height: 100vh;
  overflow-y: auto;
}

/* =========================
   BACK BUTTON
========================= */
.nampl-back-btn {
  background: #f1f1f1;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #333;
}

.nampl-back-btn:hover {
  background: #e5e5e5;
}

#nampl-sizeModal .nampl-back-btn {
  margin-right: auto;
}

/* =========================
   CLOSE BUTTON
========================= */
.nampl-close-editor {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #f1f1f1;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
}

.nampl-close-editor:hover {
  background: #e5e5e5;
}

/* =========================
   CANVAS WRAPPER (TEXT ONLY)
========================= */
.nampl-editor-canvas-wrap {
  margin: 20px auto;
  padding: 12px;
  background: #ffffff;
  border-radius: 14px;
  width: fit-content;
  /*box-shadow: inset 0 0 0 1px #e5e7eb;*/
  cursor: default; /* no upload cursor */
}

#nampl-editorCanvas {
  display: block;
  background: #ffffff;
  border-radius: 10px;
}

/* =========================
   PRIMARY BUTTON
========================= */
.nampl-primary-btn {
  margin-top: 22px;
  padding: 13px 26px;
  background: #d60000;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.nampl-primary-btn:hover {
  background: #b50000;
}

.nampl-primary-btn:active {
  transform: scale(0.97);
}

.nampl-primary-btn:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}

/* =========================
   EDITOR ERROR
========================= */
.nampl-editor-error {
  margin-top: 12px;
  color: #d60000;
  font-size: 14px;
  font-weight: 600;
  background: #fff0f0;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #f5c2c2;
  display: none;
}

/* =========================
   SIZE & THICKNESS
========================= */
.nampl-sizes,
.nampl-thickness {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.nampl-sizes button,
.nampl-thickness button {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  cursor: pointer;
  font-size: 14px;
}

.nampl-sizes button.nampl-active,
.nampl-thickness button.nampl-active {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* =========================
   WALL PREVIEW
========================= */
.nampl-wall-mockup {
  position: relative;
  width: 100%;
  height: 520px;
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  background-image: url('https://crialicgifts.com/wp-content/uploads/2026/03/wall-09.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.nampl-wall-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 85%;
  display: flex;
  justify-content: center;
}

.nampl-wall-frame img {
  max-width: 100%;
  height: auto;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  display: block;
}

/* =========================
   FRAME GRID
========================= */

.nampl-frame-grid {
  display: grid;
  grid-template-columns: repeat(3, 260px);
  gap: 50px;
  justify-content: center;
}

/* Tablet */
@media (max-width: 1024px) {
  .nampl-frame-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 600px) {
  .nampl-frame-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   CARD
========================= */

.nampl-frame-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nampl-frame-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* =========================
   THUMB
========================= */

.nampl-frame-thumb {
  width: 100%;
  aspect-ratio: 4 / 5;   /* Change to 1 / 1 for square preview */
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Image control (IMPORTANT) */
.nampl-frame-thumb img {
  width: 100%;
  height: 100% !important;
  object-fit: contain;   /* use 'cover' if you want cropped fill */
  display: block;
}

.nampl-slide-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  object-fit: contain;
  transition: opacity 0.6s ease-in-out;
  z-index: 2;
}

.nampl-frame-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100% !important;
  object-fit: contain;
  pointer-events: none;
}

/* =========================
   BODY
========================= */

.nampl-frame-body {
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.nampl-frame-body h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

/* =========================
   BUTTON
========================= */

.nampl-customise-btn {
  margin-top: auto;
  background: #d60000;
  color: #ffffff;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.nampl-customise-btn:hover {
  background: #b50000;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 600px) {
  .nampl-editor-content {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 20px;
  }

  .nampl-wall-mockup {
    width: 100%;
    height: 300px;
  }
}

.nampl-size-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}

.nampl-size-options {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nampl-price-current {
  font-size: 32px;
  font-weight: 700;
}

.nampl-price-old {
  font-size: 16px;
  color: #999;
  text-decoration: line-through;
}

.nampl-sizes button,
.nampl-thickness button {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
}

.nampl-sizes button.nampl-active,
.nampl-thickness button.nampl-active {
  background: #000;
  color: #fff;
  border-color: #000;
}

.nampl-dimension {
  position: absolute;
  background: rgba(255,255,255,0.95);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  white-space: nowrap;
}

/* Width bottom */
.nampl-dimension-width {
  left: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
}

/* Height left */
.nampl-dimension-height {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

/* Thickness right */
.nampl-dimension-thickness {
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}


.nampl-disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* =========================
   EDITOR RESPONSIVE FIX
========================= */

@media (max-width: 768px) {

  .nampl-editor-layout {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
    height: auto;
  }

  .nampl-editor-canvas-wrap {
    width: 100%;
    padding: 10px;
  }

  #nampl-editorCanvas {
    width: 100% !important;
    height: auto !important;
  }

  .nampl-editor-text-panel {
    width: 100%;
    max-height: 45vh;
    overflow-y: auto;
    padding-bottom: 20px;
  }

  .nampl-primary-btn {
    width: 100%;
  }
}

@media (max-width: 768px) {

  /* Stack preview + options */
  .nampl-size-layout {
    display: flex !important;
    flex-direction: column;
    gap: 24px;
  }

  /* Make modal scrollable */
  #nampl-sizeModal .nampl-editor-content {
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

}
@media (max-width: 768px) {
  .nampl-dimension {
    font-size: 12px;
    padding: 4px 8px;
  }

  .nampl-dimension-height {
    display: none;
  }
}

@media (max-width: 768px) {

  .nampl-wall-mockup {
    max-width: 100%;
    margin-bottom: 20px;
  }

}
@media (max-width: 768px) {

  .nampl-editor-content h2 {
    margin-top: 35px;
  }

}

