/* Wrapper spacing */
#cc-menu-root { margin-top: 16px; }

/* Responsive grid */
.cc-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

@media (max-width: 1024px){
  .cc-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .cc-grid{ grid-template-columns: 1fr; }
}

/* Card */
.cc-product{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.cc-product:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
}

.cc-thumb{
  aspect-ratio: 4/3;
  background: rgba(0,0,0,.03);
  display:flex;
  align-items:center;
  justify-content:center;
}
.cc-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}
.cc-noimg{
  width: 100%;
  height: 100%;
}

/* Body */
.cc-body{
  padding: 14px 14px 16px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.cc-title{
  font-size: 16px;
  line-height: 1.25;
  margin: 0;
}
.cc-desc{
  font-size: 13px;
  line-height: 1.4;
  opacity: .8;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 54px;
}

/* Bottom row */
.cc-bottom{
  margin-top: auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

.cc-price{
  font-weight: 700;
  font-size: 15px;
}

/* Qty stepper */
.cc-qtybox{
  display:flex;
  align-items:center;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  overflow:hidden;
  height: 36px;
}
.cc-qty-btn{
  width: 38px;
  height: 36px;
  border: 0;
  background: rgba(0,0,0,.04);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.cc-qty{
  width: 52px;
  height: 36px;
  border: 0;
  text-align:center;
  outline: none;
}


/* =========================================================
   CitiCater Mobile-First UI Polish (Tastyc-like)
   - Menu listing cards
   - Sticky order summary
   - Fluent Forms Step 1/2 (Confirm/Pay)
   - Payment summary table readability
   ========================================================= */

/* ---------- Design tokens (theme-friendly defaults) ---------- */
:root{
  --cc-bg: #ffffff;
  --cc-surface: #ffffff;
  --cc-border: rgba(0,0,0,.08);
  --cc-muted: rgba(0,0,0,.62);
  --cc-text: rgba(0,0,0,.90);

  /* Accent: try to harmonize with tastyc (change if you want) */
  --cc-accent: #ff4d2d;
  --cc-accent-2: #ff7a2f;

  --cc-radius: 14px;
  --cc-shadow: 0 10px 30px rgba(0,0,0,.08);
  --cc-shadow-soft: 0 8px 18px rgba(0,0,0,.06);
}

/* ---------- Layout container safety ---------- */
.cc-order-wrap,
#cc-order,
.cc-order{
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

/* ---------- Menu card list (restaurant template section) ---------- */
/* 아래 selector는 너희 cc-order.js가 만든 카드 구조에 맞춰 유연하게 적용되도록 광범위하게 잡음 */
.cc-menu-list,
.cc-items,
#cc-items,
#cc-menu-items{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cc-menu-card,
.cc-item-card,
.cc-order-item,
#cc-items .cc-item,
#cc-items .item,
.cc-menu-list .item{
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow-soft);
  overflow: hidden;
}

/* 카드 내부 2열: 썸네일 + 내용 */
.cc-menu-card .cc-row,
.cc-item-card .cc-row,
.cc-order-item .cc-row,
#cc-items .cc-row{
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 12px;
  padding: 12px;
  align-items: center;
}

/* 썸네일 */
.cc-menu-card img,
.cc-item-card img,
.cc-order-item img,
#cc-items img{
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--cc-border);
}

/* 제목/설명/가격 */
.cc-item-title,
.cc-menu-title,
#cc-items .title,
#cc-items .cc-title{
  font-weight: 700;
  color: var(--cc-text);
  line-height: 1.25;
  font-size: 16px;
  margin: 0 0 4px 0;
}

.cc-item-desc,
.cc-menu-desc,
#cc-items .desc,
#cc-items .cc-desc{
  color: var(--cc-muted);
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
}

.cc-item-price,
#cc-items .price,
#cc-items .cc-price{
  margin-top: 8px;
  font-weight: 800;
  color: var(--cc-text);
  font-size: 14px;
}

/* Qty 영역 (오른쪽) */
.cc-qty,
.cc-qty-box,
#cc-items .qty,
#cc-items .cc-qty{
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  justify-content: center;
  min-width: 76px;
}

.cc-qty label,
#cc-items .qty label{
  font-size: 12px;
  color: var(--cc-muted);
}

.cc-qty input,
.cc-qty-box input,
#cc-items input[type="number"]{
  width: 74px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--cc-border);
  padding: 6px 10px;
  font-weight: 800;
  text-align: center;
  outline: none;
}

/* ---------- Order summary box (below items) ---------- */
.cc-summary,
#cc-summary,
.cc-order-summary{
  margin-top: 14px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  padding: 14px;
}

.cc-summary-row,
.cc-order-summary .row,
#cc-summary .row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 7px 0;
}

.cc-summary-row span,
.cc-order-summary .label{
  color: var(--cc-muted);
  font-size: 13px;
}

.cc-summary-row b,
.cc-order-summary .value{
  color: var(--cc-text);
  font-weight: 900;
}

.cc-summary-total{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--cc-border);
}

.cc-summary-total b{
  font-size: 16px;
}

/* 거리/무료배달 안내 */
.cc-distance-note,
.cc-free-delivery-note,
#cc-summary .note{
  margin-top: 8px;
  color: rgba(0,0,0,.55);
  font-size: 12px;
}

/* ---------- Primary buttons: ORDER NOW / Next / Previous / Pay Now ---------- */
.cc-btn,
#cc-order-now,
button.cc-order-now,
.ff-btn,
.fluentform .ff-btn,
.fluentform button,
.fluentform input[type="button"],
.fluentform input[type="submit"]{
  border-radius: 14px !important;
}

/* ORDER NOW 버튼 강조 */
#cc-order-now,
button#cc-order-now,
.cc-order-now{
  width: 100%;
  max-width: 340px;
  margin: 14px auto 0;
  display: block;
  padding: 13px 16px;
  font-weight: 900;
  letter-spacing: .2px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--cc-accent), var(--cc-accent-2));
  box-shadow: 0 12px 26px rgba(255, 77, 45, .25);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

#cc-order-now:hover,
button#cc-order-now:hover{
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 14px 30px rgba(255, 77, 45, .30);
}

#cc-order-now:active,
button#cc-order-now:active{
  transform: translateY(0px);
}

/* Fluent Forms buttons (Next/Previous/Pay) - theme-like */
.fluentform .ff-btn,
.fluentform button.ff-btn,
.fluentform input.ff-btn{
  padding: 12px 16px !important;
  font-weight: 800 !important;
  border: 1px solid var(--cc-border) !important;
  background: #fff !important;
  color: var(--cc-text) !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}

.fluentform .ff-btn:hover{
  transform: translateY(-1px);
}

/* Pay Now button: make it accent */
.fluentform .ff-btn.ff-btn-submit,
.fluentform button[type="submit"]{
  border: 0 !important;
  color: #fff !important;
  background: linear-gradient(135deg, var(--cc-accent), var(--cc-accent-2)) !important;
}

/* ---------- Fluent Forms Step layout polish ---------- */
.fluentform,
.ff-el-form-control{
  font-family: inherit;
}

.fluentform .ff-el-group{
  margin-bottom: 14px !important;
}

.fluentform .ff-el-form-control{
  border-radius: 14px !important;
  border: 1px solid var(--cc-border) !important;
  padding: 11px 12px !important;
  min-height: 44px;
  box-shadow: 0 8px 18px rgba(0,0,0,.04);
}

.fluentform .ff-el-input--label label,
.fluentform .ff-el-input--label{
  font-weight: 800;
  color: var(--cc-text);
}

/* Step bar */
.fluentform .ff-step-header,
.fluentform .ff_step_header,
.fluentform .ff-step-header-wrapper{
  border-radius: var(--cc-radius);
  overflow: hidden;
  border: 1px solid var(--cc-border);
  box-shadow: var(--cc-shadow-soft);
}

.fluentform .ff-step-titles,
.fluentform .ff-step-title{
  font-weight: 800;
}

/* ---------- “You are ordering from” banner ---------- */
#cc-restaurant-banner{
  border-radius: var(--cc-radius) !important;
  border: 1px solid var(--cc-border) !important;
  box-shadow: var(--cc-shadow-soft);
  background: var(--cc-surface);
}

#cc-ordering-from{
  font-weight: 900;
  color: var(--cc-text);
}

/* ---------- Payment Summary: always readable on mobile ---------- */
/* 네가 겪은 문제: Fluent Form이 payment summary table을 display:none로 숨김
   -> 우리는 CSS로 '표시 가능 상태'까지 보정 (JS로도 처리 중이지만, CSS를 추가로 안전망으로 둠)
*/
.ff_payment_summary .input_items_table{
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
}

/* table cell */
.ff_payment_summary .input_items_table th,
.ff_payment_summary .input_items_table td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-size: 13px;
}

.ff_payment_summary .input_items_table thead th{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: rgba(0,0,0,.58);
}

/* Make it responsive (stack-ish feel) */
@media (max-width: 520px){
  .cc-menu-card .cc-row,
  .cc-item-card .cc-row,
  .cc-order-item .cc-row,
  #cc-items .cc-row{
    grid-template-columns: 70px 1fr;
    grid-template-areas:
      "img content"
      "qty qty";
    align-items: start;
  }

  /* try mapping */
  .cc-menu-card img,
  .cc-item-card img,
  .cc-order-item img,
  #cc-items img{
    width: 70px;
    height: 70px;
  }

  .cc-qty,
  .cc-qty-box,
  #cc-items .qty,
  #cc-items .cc-qty{
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--cc-border);
  }

  .cc-qty input,
  .cc-qty-box input,
  #cc-items input[type="number"]{
    width: 96px;
  }

  /* Payment Summary table: reduce density */
  .ff_payment_summary .input_items_table th,
  .ff_payment_summary .input_items_table td{
    padding: 9px 8px;
    font-size: 12.5px;
  }
}

/* ---------- Optional: keep bottom CTA visible on mobile ---------- */
@media (max-width: 520px){
  .cc-summary,
  #cc-summary,
  .cc-order-summary{
    position: sticky;
    bottom: 10px;
    z-index: 20;
    backdrop-filter: blur(6px);
  }
}

/* =========================================================
   CitiCater UX Upgrade (Mobile + Sticky + Payment Summary)
   Append-only block
========================================================= */

/* 1) Menu list layout tuning */
.cc-menu,
#cc-menu,
.cc-order-menu {
  display: grid;
  gap: 14px;
}

.cc-menu-item,
.cc-menu-card,
.cc-item {
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
}

.cc-menu-item__row,
.cc-menu-card__row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
}

.cc-menu-item img,
.cc-menu-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
}

.cc-menu-title,
.cc-item-title,
.cc-menu-item h4,
.cc-menu-card h4 {
  font-size: 16px;
  line-height: 1.2;
  margin: 0 0 6px;
  font-weight: 700;
}

.cc-menu-desc,
.cc-item-desc,
.cc-menu-item p,
.cc-menu-card p {
  margin: 0;
  font-size: 13px;
  opacity: .78;
  line-height: 1.35;
}

.cc-menu-price,
.cc-item-price {
  font-weight: 800;
  font-size: 14px;
  margin-top: 8px;
}

/* 2) Qty controls (+/-) */
.cc-qty {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 92px;
}

.cc-qty-label {
  font-size: 12px;
  opacity: .65;
}

.cc-qty-controls {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.cc-qty-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.cc-qty-btn:active {
  transform: scale(.98);
}

.cc-qty-input {
  width: 44px;
  height: 36px;
  border: 0;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  outline: none;
  background: transparent;
}

/* 3) Sticky order summary (bottom) */
.cc-order-summary,
#cc-order-summary,
.cc-summary {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
  padding: 14px;
}

/* 모바일에서 하단 sticky */
@media (max-width: 768px) {
  .cc-order-summary,
  #cc-order-summary,
  .cc-summary {
    position: sticky;
    bottom: 12px;
    z-index: 999;
  }

  /* sticky가 컨텐츠 가리는 문제 방지 */
  body {
    padding-bottom: 130px;
  }
}

/* 4) Summary typography + layout */
.cc-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  margin: 4px 0;
}

.cc-summary-row b {
  font-weight: 900;
}

.cc-summary-total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,.08);
  font-size: 16px;
}

.cc-summary-distance {
  margin-top: 6px;
  opacity: .75;
  font-size: 12px;
}

/* 5) Buttons match theme-ish */
.cc-btn,
#cc-order-now,
button.cc-order-now,
.ff-btn,
.fluentform .ff-btn,
.fluentform button[type="submit"],
.fluentform .ff-btn-next,
.fluentform .ff-btn-prev {
  border-radius: 999px !important;
  padding: 12px 18px !important;
  font-weight: 800 !important;
}

/* 6) Step2 Payment Summary: force visible + bigger */
.ff_payment_summary_fallback {
  display: block !important; /* 이게 핵심: 숨김 방지 */
}

#cc-payment-summary {
  display: block !important; /* 숨김 방지 */
}

#cc-payment-summary table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
}

#cc-payment-summary th,
#cc-payment-summary td {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

#cc-payment-summary th {
  font-size: 12px;
  opacity: .75;
  text-transform: none;
}

#cc-payment-summary .cc-totals {
  margin-top: 12px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

#cc-payment-summary .cc-totals .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 15px;
}

#cc-payment-summary .cc-totals .row.total {
  border-top: 1px solid rgba(0,0,0,.08);
  margin-top: 8px;
  padding-top: 10px;
  font-size: 18px;
  font-weight: 900;
}

#cc-payment-summary .cc-totals .row.total b {
  font-weight: 900;
}

/* ===== Order Form Full Width ===== */
.ff_form_container,
.ff-el-group,
.ff-step-container {
    max-width: 100% !important;
    width: 100% !important;
}

.cc-checkout-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .cc-checkout-wrapper {
        padding: 0 14px;
    }
}

/* Qty Buttons */
.cc-qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: #f2f2f2;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

.cc-qty-btn:hover {
    background: #111;
    color: #fff;
}

.cc-qty {
    width: 42px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}


/* Payment Summary Card */
#cc-payment-summary {
    background: #fafafa;
    padding: 20px;
    border-radius: 14px;
    margin-top: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

#cc-payment-summary table {
    width: 100%;
    font-size: 15px;
}

#cc-payment-summary th {
    font-weight: 600;
}

#cc-payment-summary tr:last-child td {
    font-weight: 700;
}

/* Total 강조 블록 */
.cc-total-highlight {
    background: #111;
    color: #fff;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 700;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
}

.cc-menu-card {
    border-radius: 16px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.04);
    margin-bottom: 18px;
}

.cc-menu-card img {
    border-radius: 12px;
}

/* =========================================
   QTY VERTICAL CENTER FIX (Mobile Perfect)
========================================= */

.cc-qty-wrap {
    display: flex;
    align-items: center;     /* 핵심: 수직 중앙 */
    justify-content: center;
    gap: 6px;
    height: 38px;            /* 전체 높이 고정 */
}

.cc-qty-wrap button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;     /* 버튼 안 텍스트 중앙 */
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.cc-qty-wrap input {
    width: 40px;
    height: 32px;
    text-align: center;
    padding: 0;
    margin: 0;
    line-height: 32px;       /* 핵심: height와 동일 */
    display: block;
    border-radius: 8px;
}

/* 모바일에서 더 정교하게 */
@media (max-width: 768px) {

    .cc-qty-wrap {
        height: 34px;
    }

    .cc-qty-wrap button,
    .cc-qty-wrap input {
        height: 30px;
        line-height: 30px;
    }

}

/* ===== Qty vertical centering fix ===== */
.cc-qty-control {
  display: flex;
  align-items: center;   /* 수직 중앙 */
  justify-content: center;
  height: 38px;
}

.cc-qty-control input {
  height: 38px;
  line-height: 38px;     /* 숫자 수직 중앙 */
  text-align: center;
  padding: 0;
  border: none;
  background: transparent;
  font-weight: 600;
}

.cc-qty-control button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  width: 38px;
  border-radius: 50%;
  font-size: 18px;
}

@media (max-width: 768px) {

  .cc-menu-card {
    display: flex;
    align-items: center;   /* 이미지 + 텍스트 정렬 */
    justify-content: space-between;
  }

  .cc-menu-card .cc-menu-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }

}
.cc-qty-control input {
  font-size: 16px;
  min-width: 24px;
}

/* ✅ Fluent Form datepicker(Flatpickr)만 폭/오버플로우 보정 */
.fluentform .flatpickr-calendar,
.ff-el-form-control.flatpickr-input + .flatpickr-calendar,
.flatpickr-calendar.open {
  max-width: 310px;
  width: 310px;
  box-sizing: border-box;
}

/* ✅ 모바일에서 화면 밖으로 나가는 것 방지 */
@media (max-width: 480px) {
  .fluentform .flatpickr-calendar.open {
    width: min(310px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    left: 12px !important;
    right: auto !important;
  }
}

