/* 🔲 Base Styles */
.touch-pad-container {
  /*background-color: #cc0f0f;*/
  border: 1px solid #ccc;
  padding: 1rem;
  border-radius: 8px;
  height: 56.8vh;
}

.container-fluid.mb-2{
  width: 100%;
}

.scrollable-touchpad {
  max-height: 65vh;
  overflow-y: auto;
}

.scrollable-touchpad::-webkit-scrollbar {
  width: 6px;
}

.scrollable-touchpad::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

button {
  font-weight: bold;
}

.btn.btn-light {
  background-color: #ffffff !important;
  border: 1px solid #ced4da;
  color: #5d6165;
}

.number-button{
height: 3rem;  
}

/* ✅ Responsive Tablet/Mobile Styles */
@media (max-width: 800px) {
  .container-fluid {
    padding: 0 1rem;
  }

  /* Stack the top row groups */
  .touch-pad-container .container-fluid.mb-2 > .d-flex {
    flex-direction: column !important;
    align-items: center;
  }

  .touch-pad-container .container-fluid.mb-2 > .d-flex > div {
    justify-content: center;
    width: 100%;
  }

  .touch-pad-container .btn {
    min-width: 80px;
    flex: 1 1 auto;
  }

  /* Main grid stacking */
  .touch-pad-container .row.gx-2 {
    flex-direction: column;
    align-items: center;
  }

  .touch-pad-container .col-3,
  .touch-pad-container .col-2,
  .touch-pad-container .col-7 {
    width: 95% !important;
    margin-bottom: 1rem;
  }

  .touch-pad-container .col-3 .row.gx-1,
  .touch-pad-container .col-2 .row.gx-1,
  .touch-pad-container .col-7 .row.gx-1 {
    display: flex;
    flex-wrap: wrap;
  }

  /* ✅ This ensures 6 columns (≈16.66% each) for 1–30 buttons */
  .touch-pad-container .col-7 .col-2 {
    flex: 0 0 16.6667% !important;
    max-width: 16.6667% !important;
  }

  /* Labels and number pad layout (unchanged logic) */
  .touch-pad-container .col-3 .col-4,
  .touch-pad-container .col-2 .col-4 {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
  }

  .touch-pad-container .col-2 .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .col-2 .btn,
  .col-3 .btn,
  .col-7 .btn {
    font-size: 1rem;
  }

  .scrollable-touchpad {
    max-height: 40vh;
  }
  
}

@media (min-width: 801px) {
  /* Remove container padding on desktop to align buttons edge-to-edge */
  .touch-pad-container .container-fluid.mb-2 {
    padding-left: 0;
    padding-right: 0;
  }

  /* Parent flex row */
  .touch-pad-container .container-fluid.mb-2 > .d-flex {
    /*justify-content: space-between;*/
    flex-wrap: nowrap;
    gap: 2rem;
  }

  /* Left group: CALC to FIELD */
  .touch-pad-container .container-fluid.mb-2 > .d-flex > div:first-child {
    flex: 0 0 45%;
    display: flex;
    justify-content: flex-start;
    padding-left: 0; /* optional: add 1rem if you still want a little breathing room */
  }

  /* Right group: COPY, CLEAR, PR */
  .touch-pad-container .container-fluid.mb-2 > .d-flex > div:last-child {
    flex: 0 0 50%;
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    padding-right: 1rem; /* optional: for symmetry */
  }

  /* Optional: widen left buttons slightly */
  .touch-pad-container .container-fluid.mb-2 > .d-flex > div:first-child button {
    min-width: 120px;
    margin-right: 2rem;
  }


/* Increase COPY button width */
.touch-pad-container .container-fluid.mb-2 > .d-flex > div:last-child button:nth-child(1) {
  min-width: 190px;
  margin-right: 2rem;
  margin-left: 2rem;
}

/* Add 3rem gap between COPY and CLEAR */
.touch-pad-container .container-fluid.mb-2 > .d-flex > div:last-child button:nth-child(2) {
  margin-left: 9rem;
  min-width: 150px;
}

.touch-pad-container .container-fluid.mb-2 > .d-flex > div:last-child button:nth-child(3) {
  min-width: 100px;
  margin-left: 1rem;
}

}

/* 🎯 POS Machine Optimization */
@media (min-width: 900px) and (max-width: 1400px) {

  .touch-pad-container .container-fluid.mb-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    width: 100%;
  }

  .touch-pad-container .container-fluid.mb-2 > .d-flex {
    gap: 1rem;
  }

  .touch-pad-container .container-fluid.mb-2 > .d-flex > div:first-child {
    flex: 0 0 50%;
    justify-content: flex-start;
  }

  .touch-pad-container .container-fluid.mb-2 > .d-flex > div:first-child button {
    min-width: 110px;
    font-size: 0.9rem;
  }

  .touch-pad-container .container-fluid.mb-2 > .d-flex > div:last-child {
    flex: 0 0 50%;
    justify-content: flex-end;
  }

  .touch-pad-container .container-fluid.mb-2 > .d-flex > div:last-child button:nth-child(1) {
    min-width: 160px;
    margin-right: 4rem;
    margin-left: 1rem;
  }

  .touch-pad-container .container-fluid.mb-2 > .d-flex > div:last-child button:nth-child(2) {
    margin-left: 0.3rem;
    min-width: 130px;
  }

  .touch-pad-container .container-fluid.mb-2 > .d-flex > div:last-child button:nth-child(3) {
    min-width: 90px;
    margin-left: 0.5rem;
  }

  .scrollable-touchpad {
  max-height: 60vh;
  overflow-y: auto;
}

}


@media(min-height: 600px) and (max-height: 725px){
 .number-button{
height: 2rem;  
}
}