@import url('https://fonts.googleapis.com/css2?family=Futura&display=swap');

body {
  font-family: 'Futura', sans-serif;
  margin: 0;
  background-color: #f4f4f4;
}

header {
  background-color: #1f3641;
  color: #f4e3c3;
  padding: 20px;
  text-align: center;
  position: relative;
}

.logo {
  width: 100px;
}

.home-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: #1f3641;
  color: #f4e3c3;
  padding: 10px 15px;
  text-decoration: none;
  font-size: 16px;
  border-radius: 5px;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.shoe-card {
  background-color: #f4e3c3;
  width: 45%;
  margin: 10px;
  padding: 20px;
  text-align: center;
}

.shoe-card h3 {
  color: #1f3641;
}

.shoe-card img {
  width: 100%;
  max-width: 300px;
  height: auto;
  border: 3px solid #1f3641;
}

.container {
  display: flex;
  max-width: 1200px;
  margin: 20px auto;
}

.left, .right {
  flex: 1;
  padding: 20px;
}

.frame {
  position: relative;
  background-color: #f4e3c3;
  padding: 20px;
  text-align: center;
  overflow: hidden;
}

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#upload-preview {
  position: absolute;
  z-index: 1;
  opacity: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#upload-img {
  width: 300px;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

#upload-preview.move-active {
  border: 3px dashed red;
  z-index: 3;
  opacity: 0.5;
}

.resize-handle {
  width: 15px;
  height: 15px;
  background: red;
  position: absolute;
  display: none;
}

#upload-preview.move-active .resize-handle {
  display: block;
}

.resize-handle.nw { top: -8px; left: -8px; cursor: nwse-resize; }
.resize-handle.ne { top: -8px; right: -8px; cursor: nesw-resize; }
.resize-handle.sw { bottom: -8px; left: -8px; cursor: nesw-resize; }
.resize-handle.se { bottom: -8px; right: -8px; cursor: nwse-resize; }
.resize-handle.n { top: -8px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.resize-handle.e { right: -8px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.resize-handle.s { bottom: -8px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.resize-handle.w { left: -8px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }

#shoe-image {
  max-width: 100%;
  height: auto;
  width: 100%;
  display: block;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.right {
  background-color: #f4e3c3;
  text-align: center;
}

input[type="file"], input[type="text"], select {
  width: 80%;
  padding: 10px;
  margin: 10px 0;
  background-color: #1f3641;
  color: #f4e3c3;
  border: none;
  font-size: 16px;
}

button {
  background-color: #1f3641;
  color: #f4e3c3;
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  margin-top: 10px;
}

body {
  font-size: 16px;
}

.grid {
  flex-direction: column;
  align-items: center;
}

.shoe-card {
  width: 90%;
  margin-bottom: 20px;
}

/* Make buttons and inputs full-width for easier tapping */
input[type="file"],
input[type="text"],
select,
button {
  width: 100%;
  max-width: 400px;
}

/* CUSTOMIZER LAYOUT STACKED FOR MOBILE */
.container {
  flex-direction: column;
}

.left,
.right {
  width: 100%;
  padding: 10px;
}

.frame {
  width: 100%;
  box-sizing: border-box;
}

/* Center overlay preview and shoe image */
#upload-preview,
#shoe-image {
  display: block;
  margin: 0 auto;
}

/* --- Tablet & Desktop overrides --- */
@media (min-width: 768px) {
  .grid {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .shoe-card {
    width: 45%;
  }

  .container {
    flex-direction: row;
  }

  .left,
  .right {
    width: 50%;
    padding: 20px;
  }

  input[type="file"],
  input[type="text"],
  select,
  button {
    width: 80%;
  }
}

@media screen and (max-width: 768px) {
  #upload-img {
    width: 50vw;
  }

  .frame {
    padding: 10px;
  }
}

#upload-preview {
  touch-action: none; /* prevent scrolling while dragging */
  border: 2px dashed #aaa;
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form input[type="number"] {
  width: 100%;
  padding: 8px 12px;
  margin: 6px 0;
  border: 2px solid #0055ff;
  border-radius: 6px;
  background-color: #f0f8ff;
  color: #003399;
  font-size: 16px;
}

#paypal-button-container {
  max-width: 300px;
  margin: 20px auto;
}

#order-form {
  margin-top: 30px;
  background: #eaf2ff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 85, 255, 0.1);
}

