/* =========================================================
   Customization Modal - Layout & Structure (Refined)
   ========================================================= */

#otherInputContainer {
  visibility: hidden;
  opacity: 0;
  height: auto;
  transition: opacity 0.3s ease-in-out;
}

#otherCheckbox:checked ~ #otherInputContainer {
  visibility: visible;
  opacity: 1;
}

/* ---------------------------------------------------------
   Form and Info Structure
   --------------------------------------------------------- */

#customizationModal .form-group {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
}

#customizationModal .form-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 4px;
  gap: 8px;
  flex-wrap: nowrap;
}

#customizationModal .error-message {
  font-size: 12px;
  white-space: nowrap;
  display: inline-block;
  min-width: auto;
  flex-shrink: 0;
}

#customizationModal .char-counter {
  font-size: 12px;
  text-align: right;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  min-width: auto;
}

#customizationModal input.form-control {
  width: 100%;
}

#customizationModal .error-icon {
  position: absolute;
  right: 18px;
  top: 40%;
  cursor: pointer;
  font-size: 1.2rem;
}

#customizationModal .error-icon:hover {
  font-size: 1.5rem;
}

#customizationModal .reset-icon {
  position: absolute;
  right: 10px;
  top: 35px;
  cursor: pointer;
  z-index: 10;
}

/* ---------------------------------------------------------
   Condensed Modal Layout Adjustments
   --------------------------------------------------------- */

#customizationModal .modal-dialog {
  max-width: 850px;
}

#customizationModal .modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 10px 20px 0 20px; /* Top/side padding reduced; bottom removed */
}

#customizationModal .container-fluid {
  padding: 0; /* Removes Bootstrap’s default spacing */
}

/* Reduce spacing around image */
#customizationModal img.img-fluid,
.preview-image {
  display: block;
  margin: 4px auto 8px auto; /* tighter vertical spacing */
  border: 1px solid #000;
  max-height: 34vh; /* slightly reduced */
  object-fit: contain;
}

/* Tighten up grid spacing slightly */
#customizationModal .row.g-3 {
  --bs-gutter-x: 0.75rem;
  --bs-gutter-y: 0.75rem;
}

/* Add a buffer equal to the button height before footer */
#customizationModal .modal-body::after {
  content: "";
  display: block;
  height: 56px; /* approximate Add-to-Cart button height */
}

/* Keep footer snug */
#customizationModal .modal-footer {
  padding: 12px 20px;
  border-top: none;
}

/* ---------------------------------------------------------
   General Layout
   --------------------------------------------------------- */

#customizationModal,
#customizationModal .modal-dialog,
#customizationModal .modal-content {
  overflow: visible;
}

#container-customization {
  text-align: center;
  border-radius: 10px;
  padding: 10px;
}

#customizationModal input:focus {
  outline-offset: 2px;
  box-shadow: none;
}

.preview-image {
  max-width: 100%;
  height: auto;
}

.form-container {
  flex: 1;
}

@media (max-width: 768px) {
  .preview-image {
    max-width: 70%; /* reduce shrinkage on mobile */
  }
}

.product-pricing {
  display: flex;
  align-items: center;
}

.product-size-select {
  margin-left: auto;
}

/* Make the entire modal smaller overall */
#customizationModal .modal-dialog {
  max-width: 750px; /* try 700–800px depending on your taste */
}

/* Keep modal content proportionate and tight */
#customizationModal .modal-content {
  border-radius: 8px;
  overflow: hidden;
}

/* Limit the form width so it doesn't stretch awkwardly */
#customizationModal .form-section {
  max-width: 90%; /* reduces width inside the 8-col area */
  margin: 0 auto; /* centers the form */
}

/* Adjust the image and form vertical alignment */
#customizationModal .row.align-items-start {
  align-items: center !important; /* better centering between image/form */
}

/* Reduce image height slightly for better balance */
#customizationModal img.img-fluid {
  max-height: 32vh;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

/* Make modal adapt its height to content */
#customizationModal .modal-body {
  padding: 10px 20px;
  max-height: 80vh;
  overflow-y: auto;
}
