/* === GENERAL PAGE STYLING === */
body {
  background-image: none;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #045380;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

#quotesHeader {
  display: none;
}

/* === FORM CONTAINER === */
form#quoteForm {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  background: #045380;
  padding: 24px;
  border-radius: 10px;
  max-width: 740px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 2px solid #fff;
}

form#quoteForm label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  min-width: 120px;
  flex: 1 1 140px;
}

form#quoteForm label.checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: auto;
  flex: 1 1 auto;
  white-space: normal;
  max-width: 100%;
}

.checkbox-row {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  align-items: center;
  flex-wrap: wrap;
}

form#quoteForm input[type="text"],
form#quoteForm input[type="number"],
form#quoteForm input[type="date"],
form#quoteForm select.styled-dropdown {
  height: 26px;
  font-size: 0.9rem;
  padding: 4px 8px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 6px;
  background-color: #fff;
  color: #2d2b24;
  outline: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  margin-top: 5px;
}

form#quoteForm select.styled-dropdown {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20,50 70,100 120,50' stroke='%232d2b24' stroke-width='20' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

form#quoteForm input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #fff;
}

form#quoteForm button {
  margin-top: 10px;
  background-color: #02735F;
  color: #fff;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  flex: 1 1 100px;
  align-self: flex-end;
  transition: background-color 0.3s ease;
}

form#quoteForm button:hover:not(.disabled-remove) {
  background-color: #7cbc41;
}

/* === PIECE GROUPS === */
#pieceGroupsContainer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
  width: 100%;
  max-width: 740px;
}

.piece-group {
  border: 1px solid #fff;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 15px;
  background-color: #045380;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.title-checkbox-container {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  width: 100%;
}

.title-checkbox-container > h4 {
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
  color: #7cbc41;
  font-weight: 700;
  font-size: 1.1rem;
}

.checkbox-row-horizontal {
  display: flex;
  gap: 20px;
  align-items: center;
  white-space: nowrap;
  flex-wrap: wrap;
}

.piece-group .checkbox-row-horizontal label.checkbox-label {
  flex: 0 0 auto;
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: #f3c537;
  display: flex;
  align-items: center;
  gap: 8px;
}

.piece-group .checkbox-row-horizontal label.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #f3c537;
}

.piece-group .inputs-checkboxes-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.piece-group .input-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.piece-group .input-row > label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.9rem;
  color: #f3c537;
  min-width: 60px;
  max-width: 140px;
  flex: 1 1 0;
  box-sizing: border-box;
  margin: 0;
}

.piece-group .input-row > label input[type="number"],
.piece-group .input-row > label input[type="text"] {
  width: 100%;
  max-width: 120px;
  height: 26px;
  padding: 4px 8px;
  background-color: #f5ecd1;
  border: 2px solid #a3751b;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  color: #2d2b24;
  outline: none;
  box-sizing: border-box;
}

/* === PIECE BUTTONS === */
button.remove-piece {
  padding: 10px 18px;
  font-size: 0.8rem;
  line-height: 1;                /* Prevent extra vertical spacing */
  background-color: #400e2f;
  color: #f3c537;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  flex: 0 0 auto;
  margin-top: 10px;
  margin-left: auto;

  display: flex;                /* Force inner alignment */
  align-items: center;         /* Center vertically */
  justify-content: center;     /* Center horizontally */
  box-sizing: border-box;      /* Important for consistent sizing */
}


button.remove-piece:hover:not(.disabled-remove) {
  background-color: #5a1347;
}

button.remove-piece.disabled-remove {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  background-color: #5c3c2a;
  border: 1px solid #3a2a1d;
  box-shadow: none;
  color: #f3c537;
}

button#addPieceGroup {
  background-color: #7f5514;
  color: #f3c537;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  margin-top: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: auto;
  flex: 0 0 auto;
  align-self: flex-end;
}

button#addPieceGroup:hover {
  background-color: #5a1347;
}

/* === LOADER AND ERROR MESSAGES === */
#loader {
  display: none;
  text-align: center;
  padding: 20px;
  color: #f3c537;
}

#error {
  color: #ffcccc;
  margin-top: 15px;
  font-weight: bold;
  background-color: #3a0e0e;
  padding: 10px 14px;
  border-radius: 6px;
}

@media screen and (min-width: 769px) {
  button.remove-piece {
    padding: 10px 18px !important; /* More padding for size */
    font-size: 0.8rem !important;    /* Slightly bigger text */
    height: auto !important;       /* Let padding control height */
    min-width: 140px !important;   /* Force a bigger width */
    border-radius: 8px !important; /* Match other buttons */
    background-color: #02735F !important; /* Same green as other buttons */
    color: #fff !important; 
    flex: 0 0 auto !important;     /* Prevent flex stretching */
    align-self: flex-start !important; /* Prevent stretching */
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
  }

  button.remove-piece:hover:not(.disabled-remove) {
    background-color: #7cbc41 !important; /* Keep hover color */
  }
}
