.ftlo-modal-overlay{
  position:fixed !important;
  top:0 !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  width:100vw !important;
  height:100vh !important;
  height:100dvh !important;
  background:rgba(0,0,0,0.55);
  z-index:999999 !important;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  overflow:hidden !important;
}

body.ftlo-modal-open{
  overflow:hidden !important;
}

.ftlo-modal{
  width:min(520px, 95vw);
  max-height:calc(100vh - 36px);
  max-height:calc(100dvh - 36px);
  background:#fff;
  border-radius:18px;
  box-shadow:0 18px 60px rgba(0,0,0,0.25);
  font-family:system-ui, -apple-system, Segoe UI, Roboto, Arial;
  display:flex;
  flex-direction:column;
  overflow:hidden !important;
  position:relative;
}

.ftlo-modal-header{
  flex:0 0 auto;
  background:#fff;
  padding:16px 16px 10px;
  border-bottom:1px solid rgba(0,0,0,0.06);
  position:relative;
  z-index:20;
}

.ftlo-modal-body{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto !important;
  -webkit-overflow-scrolling:touch !important;
  overscroll-behavior:contain;
  padding:12px 16px;
  background:#fff;
}

.ftlo-modal-footer{
  flex:0 0 auto;
  background:#fff;
  padding:10px 16px 16px;
  border-top:1px solid rgba(0,0,0,0.08);
  position:relative;
  z-index:20;
}

.ftlo-modal-close{
  position:absolute;
  right:12px;
  top:10px;
  border:0;
  background:#3e3b92;
  color:#fff;
  width:36px;
  height:36px;
  border-radius:12px;
  cursor:pointer;
  font-size:18px;
  font-weight:900;
  z-index:50;
  line-height:36px;
  text-align:center;
}

.ftlo-modal-head{
  display:flex;
  gap:14px;
  align-items:flex-start;
  padding-right:44px;
}

.ftlo-modal-img{
  width:84px;
  height:84px;
  object-fit:cover;
  border-radius:16px;
  background:#f1f1f1;
  flex-shrink:0;
}

.ftlo-modal-info{
  flex:1;
  min-width:0;
}

.ftlo-modal-title{
  font-size:18px;
  font-weight:900;
  margin-bottom:4px;
  color:#222;
}

.ftlo-modal-price{
  font-size:14px;
  font-weight:800;
  opacity:0.85;
  margin-bottom:6px;
}

.ftlo-modal-desc{
  font-size:14px;
  line-height:1.45;
  color:#6b7280;
  max-height:80px;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}

.ftlo-closed-msg{
  background:#3e3b92;
  color:#fff;
  padding:10px 12px;
  border-radius:14px;
  font-weight:900;
  margin:0 0 12px;
  text-align:center;
}

.ftlo-qty{
  display:flex;
  gap:8px;
  align-items:center;
  margin:0 0 14px;
}

.ftlo-qty-btn{
  width:42px;
  height:42px;
  border-radius:12px;
  border:0;
  font-size:18px;
  font-weight:900;
  cursor:pointer;
  background:#3e3b92;
  color:#fff;
  flex:0 0 auto;
}

.ftlo-qty-input{
  flex:1;
  min-width:0;
  text-align:center;
  border-radius:0;
  border:1px solid rgba(0,0,0,0.15);
  padding:10px 12px;
  height:42px;
  font-weight:900;
  background:#fff;
}

.ftlo-options-title{
  font-weight:700;
  margin-top:8px;
  margin-bottom:8px;
  color:#333;
}

.ftlo-opt-group{
  border:1px solid #eee;
  border-radius:12px;
  padding:10px;
  margin-bottom:10px;
  background:#fff;
}

.ftlo-opt-group-title{
  font-weight:700;
  margin-bottom:8px;
  color:#333;
}

.ftlo-required{
  color:#d32f2f;
  font-weight:800;
  margin-left:4px;
}

.ftlo-opt{
  display:grid;
  grid-template-columns:28px 1fr auto;
  align-items:center;
  gap:10px;
  padding:8px 6px;
  border-radius:10px;
  cursor:pointer;
}

.ftlo-opt:hover{
  background:#f5f5f5;
}

.ftlo-opt input{
  margin:0;
}

.ftlo-opt-price{
  font-weight:700;
  color:#111;
  white-space:nowrap;
}

.ftlo-opt-missing{
  border-color:#d32f2f;
  box-shadow:0 0 0 3px rgba(211,47,47,0.12);
}

.ftlo-extras-title{
  font-weight:900;
  margin:12px 0 8px;
  color:#333;
}

.ftlo-extra{
  display:grid;
  grid-template-columns:28px 1fr auto;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  background:#f6f7fb;
  margin-bottom:8px;
  cursor:pointer;
}

.ftlo-extra input{
  margin:0;
  transform:scale(1.1);
}

.ftlo-extra-price{
  font-weight:900;
  color:#111;
  white-space:nowrap;
}

.ftlo-extras-none{
  color:#6b7280;
  font-size:14px;
  padding:8px 0;
}

.ftlo-total{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:15px;
  margin:0 0 10px;
}

.ftlo-total strong{
  font-weight:900;
}

.ftlo-add-cart{
  width:100%;
  border:0;
  padding:12px 14px;
  border-radius:16px;
  font-weight:900;
  background:#2ecc71;
  color:#fff;
  cursor:pointer;
  font-size:15px;
  text-transform:uppercase;
}

.ftlo-add-cart.disabled,
.ftlo-add-cart:disabled{
  background:#cfcfcf;
  cursor:not-allowed;
  color:#fff;
}

@media (max-width:600px){

  .ftlo-modal-overlay{
    align-items:center !important;
    justify-content:center !important;
    padding:10px !important;
  }

  .ftlo-modal{
    width:calc(100vw - 20px) !important;
    height:calc(100vh - 20px) !important;
    height:calc(100dvh - 20px) !important;
    max-height:none !important;
    border-radius:16px !important;
  }

  .ftlo-modal-header{
    padding:14px 14px 10px;
  }

  .ftlo-modal-body{
    padding:10px 14px;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch !important;
  }

  .ftlo-modal-footer{
    padding:10px 14px 14px;
  }

  .ftlo-modal-close{
    right:10px;
    top:10px;
    width:36px;
    height:36px;
    border-radius:12px;
  }

  .ftlo-modal-head{
    gap:10px;
    padding-right:42px;
  }

  .ftlo-modal-img{
    width:72px;
    height:72px;
    border-radius:14px;
  }

  .ftlo-modal-title{
    font-size:17px;
  }

  .ftlo-modal-price{
    font-size:14px;
  }

  .ftlo-modal-desc{
    font-size:13px;
    max-height:64px;
  }

  .ftlo-qty-btn{
    width:40px;
    height:40px;
  }

  .ftlo-qty-input{
    height:40px;
  }

  .ftlo-opt{
    grid-template-columns:26px 1fr auto;
    gap:8px;
    padding:9px 6px;
  }

  .ftlo-extra{
    grid-template-columns:26px 1fr auto;
    gap:8px;
  }
}