.calculator-popup__second-container-wrap {
    display: none;
    position: fixed;
    z-index: 901;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;           /* fit viewport */
    background-color: rgb(235, 235, 235);
    border-radius: 25px;
    flex-direction: column;
    overflow: hidden;           /* contain content */
}

@media (max-height: 700px) {
    .calculator-popup__second-container-wrap {
        height: 580px;
    }
    .calculator-popup__close2 {
        transform: scale(0.9);
    }
    .calculator-popup_goback {
        transform: scale(0.9);
    }
    .calculator-popup__second-container-wrap-funcs {
        top: 3% !important;
    }
}
.calculator-popup__second-container-wrap-funcs {
    flex: 0 0 auto;             /* does not shrink */
    position: sticky;           /* sticks at top */
    top: 0;
    left: 0;
    width: 90%;
    display: flex;
    align-self: center;
    align-items: center;
    justify-content: space-between;
    z-index: 910;
    height: auto;
    background-color: rgb(235, 235, 235);
    padding-top: 30px;
    padding-bottom: 15px;
}
.calculator-popup__close2 {
    width: 25px;
    transition: transform 0.3s ease;
    height: 25px;
}
.calculator-popup_goback {
    width: 100px;
}

.calculator-popup__second-container {
    display: flex;
    flex-direction: column;

}


.calculator-popup_goback {
    width: auto;
    padding: 8px 18px;
    font-size: 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(145deg, #ffd700, #ffcc33);
    color: #1e1e2f;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 0 6px rgba(255, 255, 255, 0.5);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
    font-family: 'Fredoka', Arial, Helvetica, sans-serif;
}
.calculator-popup_goback:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 15px 35px rgba(255, 204, 0, 0.2);
}


/* MAIN CONTAINER */
.calculator-popup__second-container {
    flex: 1 1 auto;             /* take remaining space */
    overflow-y: auto;           /* scroll if too tall */
    padding-bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 20px;
}

/* TITLE */
.second-popup__container-title {
    font-size: 28px;
    font-weight: 600;
    color: #222;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* BUTTONS (Normal + Permanent) */
.second-popup__container-buttons {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.second-popup__container-buttons-normal,
.second-popup__container-buttons-permanent {
    padding: 10px 22px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;

    background: linear-gradient(145deg, #ffffff, #dcdcdc);
    box-shadow:
        0 4px 7px rgba(0,0,0,0.2),
        inset 0 0 6px rgba(255,255,255,0.5);
    transition: 0.25s ease;
}

/* ADD BUTTON */
.second-popup__container-add {
    width: 60%;
    padding: 12px 20px;
    font-size: 18px;
    font-weight: 700;
    color: white;

    background: linear-gradient(145deg, #265dff, #002eb5);
    border-radius: 16px;
    border: none;
    cursor: pointer;

    box-shadow:
        0 8px 16px rgba(0,0,0,0.25),
        inset 0 0 8px rgba(255,255,255,0.3);

    transition: 0.25s ease;
}










/* WRAPPER */
.quantity-wrapper {
  display: flex;
  align-items: center;
  min-width: 235px;           /* large, modern size */
  height: 60px;
  border-radius: 12px;
  overflow: hidden;
  background-color: #f8f8f8;
  border: 2px solid #ccc;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1),
              inset 0 2px 4px rgba(255,255,255,0.5);
}

/* SIDE BUTTONS */
.quantity-btn {
  width: 60px;              /* matches height */
  height: 100%;
  border: none;
  background-color: #ffffff;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  user-select: none;
}

/* HOVER EFFECT */
.quantity-btn:hover {
  background-color: #f0f0f0;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

/* ACTIVE PRESS EFFECT */
.quantity-btn:active {
  transform: translateY(0);
  background-color: #e6e6e6;
}

/* INPUT FIELD */
.second-popup__container-quantity-input {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  background-color: #ffffff;
  color: #333;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Remove number arrows in Chrome/Edge */
.second-popup__container-quantity-input::-webkit-inner-spin-button,
.second-popup__container-quantity-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* MOBILE RESPONSIVE */
@media (max-width: 500px) {
  .quantity-wrapper { width: 180px; height: 50px; }
  .quantity-btn { width: 50px; font-size: 24px; }
  .second-popup__container-quantity-input { font-size: 20px; }
}









.second-popup__container-box {
    height: 130px;
    width: 230px;
    background-color: white;
    border-radius: 10px;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.12),
        inset 0 0 8px rgba(255, 255, 255, 0.4);
    padding: 8px;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    cursor: pointer;
}


.second-popup__container-box-img-box {
    height: 70%;
    width: 100%;
    background-color: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    padding-top: 4px;
}

.second-popup__container-box-img {
    width: 80px;
    max-width: 80%;

    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25));
    transition: transform 0.15s ease;
}

.second-popup__container-box-title-box {
    height: 30%;
    display: flex;
    align-items: top;
    justify-content: center;
    width: 100%;
    padding-top: 2px;

    font-weight: 600;
    font-size: 15px;
    color: #333;
    text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}