/* === Layout Containers === */
.builder2 {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 0;
}

/* ===== Desktop / Default ===== */
.builder-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
}

#stage-wrap {
  flex-shrink: 0;
  max-width: 700px;
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
}

/* === Sidebar Styling === */
.builder-sidebar {
  width: 260px;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 14px;
}

.builder-sidebar h3 {
  margin-top: 0;
  font-size: 16px;
  font-weight: bold;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.builder-sidebar label {
  font-weight: 600;
  margin-bottom: 2px;
}

.builder-sidebar select,
.builder-sidebar input[type="number"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
}

.builder-sidebar .price {
  color: red;
  font-weight: bold;
  margin: 0 0 10px 0;
}

.builder-sidebar button {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

#upload-section {
  margin-top: 20px;
  text-align: center;
  background: #fafafa;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.toggle-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

#save-design {
  background: #007bff;
  color: #fff;
  margin-bottom: 8px;
}

#add-cart {
  background: #28a745;
  color: #fff;
}

/* === Upload Section === */
.upload-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  max-width: 1100px;
  margin: 0 auto;
}

.upload-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  background: #fafafa;
}

.upload-block h4 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: bold;
}

.upload-label {
  font-weight: 600;
  margin-bottom: 2px;
}

.upload-block input[type="text"],
.upload-block input[type="file"],
.upload-block select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

/* === Embroidery sub-row (Font | Color | Emblem) === */
.embroidery-options-row {
  display: flex;
  flex-direction: row;
  gap: 15px;
  margin-top: 10px;
}

.embroidery-options-row > div {
  flex: 1;
}

.embroidery-options-row input[type="file"] {
  width: 100%;
}

/* === Logo + Branding === */
.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  color: transparent !important;
}

.logo-img {
  height: 40px;
  margin-right: 10px;
}

.logo-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(to right, silver, #00f0ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 5px #00f0ff, 0 0 10px #00f0ff, 0 0 20px #0099cc;
}

.logo-link .logo-text,
.logo-link .logo-text:link,
.logo-link .logo-text:visited,
.logo-link .logo-text:hover,
.logo-link .logo-text:active {
  letter-spacing: 2px;
  color: transparent !important;
}

.logo-link {
  pointer-events: none;
  cursor: default;
  text-decoration: none;
  color: inherit;
}

/* === Disabled Button === */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================================================
   📱 RESPONSIVE DESIGN
   ========================================================= */

/* Tablets (≤ 1024px) */
@media (max-width: 1024px) {
  .builder-top {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  #stage-wrap {
    max-width: 90%;
  }

  .builder-sidebar {
    width: 90%;
    padding: 15px;
  }

  .upload-row {
    flex-direction: column;
    align-items: center;
  }

  .embroidery-options-row {
    flex-wrap: wrap;
  }

  .embroidery-options-row > div {
    flex: 1 1 45%;
  }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
  .builder2 {
    padding: 10px;
  }

  .builder-top {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  #stage-wrap {
    width: 100%;
    max-width: 100%;
  }

  .builder-sidebar {
    width: 100%;
    font-size: 15px;
    padding: 15px;
  }

  .sidebar-section {
    gap: 6px;
  }

  #upload-section {
    padding: 10px;
  }

  .toggle-row {
    flex-direction: column;
    align-items: center;
  }

  .upload-block {
    width: 100%;
    padding: 10px;
  }

  .embroidery-options-row {
    flex-direction: column;
    gap: 10px;
  }

  .embroidery-options-row > div {
    width: 100%;
  }

  button,
  input,
  select {
    font-size: 16px; /* easier to tap */
  }
}

/* Ultra-small (≤ 480px) */
@media (max-width: 480px) {
  .builder-sidebar {
    padding: 12px;
  }

  .builder-sidebar h3 {
    font-size: 15px;
  }

  .price {
    font-size: 16px;
  }

  #save-design,
  #add-cart {
    font-size: 15px;
    padding: 12px;
  }

  .upload-label {
    font-size: 14px;
  }

  .toggle-row label {
    font-size: 14px;
  }
}

/* =========================================================
   🧭 MOBILE / TABLET SCROLL FIX
   ========================================================= */

/* Allow full-page scrolling on all devices */
html, body {
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Let builder layout expand naturally instead of locking height */
.builder2,
.builder-top {
  height: auto;
  min-height: 100vh;
  overflow: visible;
  flex-wrap: wrap;
}

/* Make sure no child containers clip overflow */
#stage-wrap,
.builder-sidebar,
#upload-section {
  overflow: visible;
  max-width: 100%;
}

/* On mobile: stack elements and allow scrolling */
@media (max-width: 768px) {
  .builder2 {
    flex-direction: column;
    align-items: stretch;
  }

  .builder-top {
    flex-direction: column;
    align-items: center;
  }

  #stage-wrap {
    width: 100%;
    height: auto;
  }

  .builder-sidebar {
    width: 100%;
    position: static;
  }

  #upload-section {
    margin-bottom: 40px; /* some breathing room at bottom */
  }
}

