.popup-form {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.popup-form.show { display: block; }

.popup-form-inner {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    position: relative;
    top: 15%;
}

.popup-form-title{
    font-size: 20px;
    font-weight: bold;
    color: black;
}

.popup-exit {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
}
.popup-exit img {
    width: 40px;
    height: 40px;
    position: relative;
    bottom: 13px;
}

/* ===== Form layout ===== */
.popup-form__form{
    display: flex;
    flex-direction: column;
    row-gap: 14px;
    margin-top: 8px;
}

/* Inputs look like clean text lines */
.popup-form__form input[type="text"],
.popup-form__form input[type="tel"]{
    width: 100%;
    border: none;
    border-bottom: 1px solid #d7d7d7;
    background: transparent;

    padding: 10px 0 8px 0;
    box-sizing: border-box;

    font-size: 16px;           /* одинаковый размер для всех 3 строк */
    line-height: 1.25;
    color: #6f6f6f;
    outline: none;
}

/* Placeholder — серый, одинаковый */
.popup-form__form input::placeholder{
    color: #9a9a9a;
    opacity: 1;
}

/* Subline under phone */
.popup-form__form .checkout-subline{
    margin-top: -8px;          /* подтягиваем под строку телефона */
    font-size: 14px;
    line-height: 1.2;
    color: #9a9a9a;
}

/* Submit button closer to fields */
.popup-form__form input[type='submit']{
    margin-top: 18px;
    width: 100%;
    padding: 14px 0;
    cursor: pointer;
    color: #6f6f6f;
    background-color: #d0d0d0;
    border: none;
}

/* Disable submit button when phone invalid */
.popup-form__form input[type='submit']:disabled,
.popup-form__form button[type='submit']:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== Phone validation UI ===== */
.phone-error {
  display: none;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.25;
  color: #e74c3c;
}
/* ===== /Phone validation UI ===== */

/* ===== Premium order toast ===== */
.order-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2000;
  display: none;
  align-items: center;
  gap: 14px;

  padding: 16px 18px;
  min-width: 280px;
  max-width: 92vw;

  background: rgba(20, 20, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;

  color: #fff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.order-toast.show { display: flex; animation: orderToastIn 180ms ease-out; }
.order-toast.hide { animation: orderToastOut 180ms ease-in forwards; }

.order-toast__icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  flex: 0 0 auto;
}

.order-toast__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.order-toast__title { font-size: 18px; font-weight: 500; line-height: 1.25; }
.order-toast__subtitle { margin-top: 6px; font-size: 14px; line-height: 1.25; opacity: 0.75; }

@keyframes orderToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes orderToastOut { from { opacity: 1; } to { opacity: 0; } }

/* Force-hide legacy green success bar */
.popup-order-sent { display: none !important; }

/* ===== FIX: align "Всього" (total) line with the rest of the checkout popup content ===== */
/* This covers both implementations: .total-price (checkout popup) and .order-total/#order-total-price (shopping-cart page). */
.popup-form .total-price,
.popup-form .order-total,
.popup-form #order-total-price,
.popup-form #total-price {
    display: block;
    width: 100%;
    box-sizing: border-box;

    /* force same left edge as other blocks inside popup */
    margin-left: 0 !important;
    margin-right: 0 !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;

    text-align: left;
}

/* If your popup content is centered via an inner container, keep total inside the same centered width */
.popup-form .popup-form-inner .total-price,
.popup-form .popup-form-inner .order-total,
.popup-form .popup-form-inner #order-total-price {
    width: calc(100% - 80px);
    max-width: 760px;
    margin: 18px auto 0 !important;
}
/* ===== /FIX ===== */

/* ===== Checkout city field textarea ===== */
.popup-form__form textarea[name="comment"]{
    width: 100%;
    border: none;
    border-bottom: 1px solid #d7d7d7;
    background: transparent;
    padding: 4px 0 14px 0;
    box-sizing: border-box;
    font-size: 16px;
    line-height: 1.2;
    color: #6f6f6f;
    outline: none;
    resize: none;
    min-height: 58px;
    overflow: hidden;
    font-family: inherit;
    margin-top: -4px;
}

.popup-form__form textarea[name="comment"]::placeholder{
    color: #9a9a9a;
    opacity: 1;
    white-space: pre-line;
}

@media (max-width: 767px){
  .popup-form__form textarea[name="comment"]{
    font-size: 16px !important;
    line-height: 1.25 !important;
    min-height: 38px !important;
    height: 38px !important;
    max-height: 38px !important;
    padding: 0 0 8px 0 !important;
    margin-top: 0 !important;
  }
}


@media (max-width: 767px){
  .popup-form__form textarea[name="comment"]{
    -webkit-text-size-adjust: 100% !important;
  }
}


/* ===== HARD FIX iPhone Safari focus zoom in checkout popup =====
   Safari zooms fields when calculated font-size is below 16px.
   Keep every checkout editable field at 16px and prevent text autoscaling.
*/
@media screen and (max-width: 768px) {
  html,
  body {
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }

  .popup-form,
  .popup-form *,
  .popup-form__form,
  .popup-form__form * {
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }

  .popup-form__form input[type="text"],
  .popup-form__form input[type="tel"],
  .popup-form__form input[type="search"],
  .popup-form__form input[type="email"],
  .popup-form__form input[type="number"],
  .popup-form__form textarea,
  .popup-form__form select,
  .popup-form__form textarea[name="comment"] {
    font-size: 16px !important;
    line-height: 1.25 !important;
    transform: none !important;
    zoom: 1 !important;
    -webkit-transform: translateZ(0) !important;
    appearance: none;
    -webkit-appearance: none;
  }

  .popup-form__form textarea[name="comment"]::placeholder {
    font-size: 16px !important;
    line-height: 1.25 !important;
  }
}
/* ===== /HARD FIX ===== */

