/* =========================================================
   MODAL BASE
========================================================= */
.clok-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;
  overflow-y: auto;
}

/* =========================================================
   MODAL CONTENT
========================================================= */
.clok-editor-content {
  background: #ffffff;
  width: 96vw;
  max-width: 1280px;
  min-height: 90vh;
  padding: 28px 32px;
  border-radius: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}

.clok-editor-content h3 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
}

/* =========================================================
   EDITOR BODY LAYOUT FIX
========================================================= */
.clok-editor-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}



/* Tool buttons */
.clok-editor-tools {
  display: flex;
  flex-direction: column;   /* STACK buttons */
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.clok-secondary-btn {
  padding: 12px 26px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  font-size: 14px;
  cursor: pointer;
}

/* Save button (MAIN CTA) */
.clok-editor-save {
  padding: 16px 36px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  min-width: 260px;
  text-align: center;
}


/* =========================================================
   CLOSE BUTTON
========================================================= */
.clok-close-editor {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #f2f2f2;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.clok-close-editor:hover {
  background: #e5e5e5;
}

/* ===============================
   EDITOR CANVAS WRAPPER
================================ */
.clok-editor-canvas-wrap {
  width: 100%;
  max-width: 420px;        /* desktop target */
  margin: 20px auto;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  position: relative;
}

/* ===============================
   FABRIC CANVAS
================================ */
#clok-clockCanvas {
  display: block;
  width: 100% !important;  /*  KEY */
  height: auto !important;
  max-width: 100%;
}


/* =========================================================
   EDITOR TOOLS
========================================================= */
.clok-editor-tools {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.clok-editor-tools button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.clok-editor-tools button:hover {
  background: #f3f4f6;
  border-color: #cbd5e1;
}

/* =========================================================
   PRIMARY BUTTON
========================================================= */
.clok-primary-btn {
  margin: 24px auto 0;
  padding: 14px 32px;
  background: #d60000;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.clok-primary-btn:hover {
  background: #b50000;
}

.clok-buy-btn {
  margin-top: 12px;
  padding: 16px;
  font-size: 16px;
  border-radius: 12px;
  width: 100%;
}


/* =========================================================
   CLOCK GRID PAGE
========================================================= */
.clok-clock-page {
  padding: 20px 0;
}

.clok-clock-grid {
  display: grid;
  grid-template-columns: repeat(3, 260px);
  gap: 50px;
  justify-content: center;
}

.clok-clock-card {
  background: #ffffff;
  padding: 18px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clok-clock-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(0,0,0,0.14);
}

.clok-clock-card img {
  width: 100%;
  border-radius: 10px;
}

.clok-clock-card h4 {
  margin: 12px 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.clok-customise-btn {
  background: #d60000;
  color: #ffffff;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.clok-customise-btn:hover {
  background: #b50000;
}

/* =========================================================
   SIZE MODAL LAYOUT
========================================================= */
.clok-size-layout {
  max-width: 1380px;
}

.clok-size-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

/* =========================================================
   WALL PREVIEW
========================================================= */
.clok-preview-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.clok-wall-bg {
  width: 100%;
  max-width: 650px;   /* slightly larger wall */
  height: auto;
  border-radius: 10px;
  display: block;
}

/* Circular Clock Preview */
.clok-clock-preview {
  position: absolute;

  width: 33%;          /* 🔥 responsive instead of 220px */
  max-width: 320px;    /* prevents it from becoming too large */
  height: auto;

  top: 14%;            /* adjust if needed */
  left: 50%;
  transform: translateX(-50%);

  border-radius: 50%;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

/* Square Frame Preview */
#clok-wallClockPreview {
  position: absolute;

  width: 40%;          /* 🔥 responsive */
  max-width: 320px;
  height: auto;

  top: 22%;
  left: 50%;
  transform: translateX(-50%);

  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
}

@media (max-width: 768px) {
  .clok-wall-bg {
    max-width: 100%;
  }

  .clok-clock-preview,
  #clok-wallClockPreview {
    width: 40%;
    top: 10%;
  }
}

/* =========================================================
   DIMENSIONS
========================================================= */
.clok-dimension {
  position: absolute;
  font-size: 13px;
  font-weight: 600;
  color: #000;
  background: rgba(255,255,255,0.85);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.clok-dimension-width {
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.clok-dimension-height {
  left: 10px;
  top: 50%;
  transform: rotate(-90deg) translateX(-50%);
}

.clok-dimension-thickness {
  right: 10px;
  top: 50%;
}

/* =========================================================
   OPTIONS PANEL
========================================================= */
.clok-options-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.clok-options-wrap h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

/* PRICE */
.clok-price-wrap {
  margin-top: 10px;
}

.clok-price-label {
  font-size: 13px;
  color: #666;
}

.clok-price-current {
  font-size: 32px;
  font-weight: 800;
  color: #111;
}

.clok-price-old {
  font-size: 16px;
  color: #999;
  margin-top: 6px;
  text-decoration: line-through;
}

/* =========================================================
   SIZE & THICKNESS BUTTONS
========================================================= */
.clok-sizes,
.clok-thickness {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.clok-sizes button,
.clok-thickness button {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.clok-sizes button:hover,
.clok-thickness button:hover {
  border-color: #d60000;
  color: #d60000;
}

.clok-sizes button.clok-active,
.clok-thickness button.clok-active {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* =========================================================
   MOBILE
========================================================= */
@media (max-width: 768px) {

  .clok-editor-content {
    min-height: 100vh; 
    width: 100vw;
    height: auto;
    max-width: none;
    border-radius: 0;
    padding: 64px 20px 24px;
    overflow: visible;
  }

  .clok-editor-canvas-wrap {
    max-width: 320px;     /* keeps clock inside screen */
    padding: 8px;
  }

  .clok-size-grid {
    grid-template-columns: 1fr;
  }

  .clok-wall-bg {
    max-width: 100%;
  }

  #clok-wallClockPreview {
    max-width: 180px;
  }

  .clok-primary-btn {
    width: 100%;
  }
}

/* Mobile refinement */
@media (max-width: 768px) {
  .clok-editor-tools {
    flex-direction: column;
    width: 100%;
  }

  .clok-editor-tools button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .clok-close-editor {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000000;
  }
}

@media (max-width: 768px) {
  .clok-preview-wrap {
    margin-top: 260px;
    padding-top: 8px;
  }

  .clok-wall-bg {
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  .clok-size-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .clok-size-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .clok-buy-btn {
    margin-top: 24px;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
  }
}
