/* ============================================================
   The Food Palace — shop styles (cart / checkout / payment / success)
   ============================================================ */

/* ---- header cart icon + badge ---- */
.cart-link {
  position: relative;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink); background: #fff; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, color .18s ease;
}
.cart-link:hover { color: var(--primary); transform: translateY(-2px); }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 50px; background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700; font-family: var(--font-body);
  display: none; align-items: center; justify-content: center;
  border: 2px solid var(--cream);
}
.cart-count.show { display: flex; }

/* ---- add-to-cart buttons ---- */
.add-btn {
  flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(239,75,44,.3);
  transition: transform .15s ease, background .15s ease;
}
.add-btn:hover { background: var(--primary-dark); transform: scale(1.08); }
.add-btn.just-added { animation: pop .45s ease; }
@keyframes pop { 0%{transform:scale(1)} 40%{transform:scale(1.35)} 100%{transform:scale(1)} }

.item .add-btn { margin-left: 4px; }
.size.add-size { cursor: pointer; border: 1.5px solid transparent; }
.size.add-size:hover { background: var(--primary); color: #fff; }
.size.add-size:hover b { color: #fff; }
.size.add-size.just-added { animation: pop .45s ease; }

/* ---- toast ---- */
.fp-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px);
  background: #1f1a18; color: #fff; font-weight: 600; font-size: 13px;
  padding: 10px 18px; border-radius: 50px; z-index: 1000;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
  white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
.fp-toast.show { opacity: 1; transform: translate(-50%, 0); }
.fp-toast svg { color: #6ce29a; }

/* ============================================================
   SHOP PAGE SHELL
   ============================================================ */
.shop {
  background: var(--cream-soft);
  min-height: 70vh;
  padding: 46px 0 80px;
}
.shop-head { text-align: center; margin-bottom: 36px; }
.shop-head h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 4vw, 44px); margin: 0 0 8px;
}
.shop-head h1 .c { color: var(--primary); }
.shop-head .steps {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 600;
}
.shop-head .steps i { font-style: normal; color: #d9c4ba; }
.shop-head .steps .on { color: var(--primary); }

.shop-grid {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px;
  align-items: start;
}

/* ---- cards / panels ---- */
.panel {
  background: #fff; border-radius: 20px; padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}
.panel h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 20px;
  margin: 0 0 18px; display: flex; align-items: center; gap: 10px;
}
.panel h2 .n {
  width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 14px; display: grid; place-items: center;
}

/* ---- cart line items ---- */
.cart-line {
  display: grid; grid-template-columns: 56px 1fr auto auto; gap: 16px;
  align-items: center; padding: 16px 0; border-bottom: 1px solid #f1e4dd;
}
.cart-line:last-child { border-bottom: none; }
.cart-line .pic {
  width: 56px; height: 56px; border-radius: 14px;
  background: radial-gradient(circle at 38% 32%, #fff5ef, #ffd9c7 60%, #f7b79c);
  display: grid; place-items: center; color: var(--primary-dark);
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
}
.cart-line .ci-name { font-weight: 600; }
.cart-line .ci-sub { font-size: 12.5px; color: var(--muted); }
.cart-line .ci-price { font-weight: 600; color: var(--ink-soft); font-size: 14px; }
.qty {
  display: inline-flex; align-items: center; gap: 0;
  border: 1.5px solid #eedccf; border-radius: 50px; overflow: hidden;
}
.qty button {
  width: 30px; height: 32px; border: none; background: #fff; cursor: pointer;
  color: var(--primary); font-size: 17px; font-weight: 700; line-height: 1;
}
.qty button:hover { background: var(--primary-soft); }
.qty span { min-width: 30px; text-align: center; font-weight: 600; font-size: 14px; }
.cart-line .ci-total { font-family: var(--font-display); font-weight: 700; color: var(--primary); font-size: 17px; white-space: nowrap; }
.ci-remove {
  background: none; border: none; cursor: pointer; color: #c9b3a9; padding: 4px;
}
.ci-remove:hover { color: var(--primary); }

/* ---- empty cart ---- */
.cart-empty { text-align: center; padding: 50px 20px; }
.cart-empty .ico {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 18px;
  background: var(--primary-soft); display: grid; place-items: center; color: var(--primary);
}
.cart-empty h3 { font-family: var(--font-display); font-size: 22px; margin: 0 0 6px; }
.cart-empty p { color: var(--muted); margin: 0 0 20px; }

/* ---- order summary ---- */
.summary { position: sticky; top: 90px; }
.summary .line {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; color: var(--ink-soft); margin-bottom: 12px;
}
.summary .line .free { color: #1f8a5b; font-weight: 600; }
.summary hr { border: none; border-top: 1px dashed #e6d3c9; margin: 16px 0; }
.summary .grand {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink);
}
.summary .grand .c { color: var(--primary); }
.summary .hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.summary-items { margin-bottom: 4px; max-height: 230px; overflow: auto; }
.summary-items .si {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 13px; margin-bottom: 10px; color: var(--ink-soft);
}
.summary-items .si .q { color: var(--primary); font-weight: 700; margin-right: 6px; }

.btn-block { width: 100%; justify-content: center; margin-top: 18px; }
.btn-lg { padding: 15px 26px; font-size: 16px; }
.link-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 14px; margin-top: 16px; }
.link-back:hover { color: var(--primary); }

/* ---- forms ---- */
.field { margin-bottom: 16px; }
.field.half { display: inline-block; width: calc(50% - 8px); }
.field.half + .field.half { margin-left: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid #eedccf; border-radius: 12px;
  padding: 12px 15px; font-family: var(--font-body); font-size: 14.5px; color: var(--ink);
  background: #fff; transition: border-color .15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary);
}
.field textarea { resize: vertical; min-height: 78px; }
.field .err { color: var(--primary); font-size: 12px; margin-top: 5px; display: none; }
.field.invalid input, .field.invalid textarea { border-color: var(--primary); }
.field.invalid .err { display: block; }

/* ---- payment methods ---- */
.pay-methods { display: grid; gap: 12px; }
.pay-method {
  display: flex; align-items: center; gap: 14px;
  border: 1.5px solid #eedccf; border-radius: 14px; padding: 15px 18px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.pay-method:hover { border-color: var(--primary); }
.pay-method.active { border-color: var(--primary); background: var(--primary-soft); }
.pay-method input { accent-color: var(--primary); width: 18px; height: 18px; }
.pay-method .pm-logo {
  width: 46px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 13px; flex: 0 0 46px;
}
.pm-logo.cod { background: #1f8a5b; }
.pm-logo.bkash { background: #d1216b; }
.pm-logo.nagad { background: #ee7126; }
.pm-logo.card { background: #2a6fdb; }
.pay-method .pm-name { font-weight: 600; }
.pay-method .pm-sub { font-size: 12.5px; color: var(--muted); }
.pay-extra { margin-top: 16px; padding-top: 18px; border-top: 1px dashed #e6d3c9; display: none; }
.pay-extra.show { display: block; }

/* ---- success ---- */
.success-wrap { max-width: 660px; margin: 0 auto; text-align: center; }
.success-wrap .check {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 22px;
  background: #1f8a5b; color: #fff; display: grid; place-items: center;
  box-shadow: 0 16px 36px rgba(31,138,91,.32);
  animation: pop .5s ease;
}
.success-wrap h1 { font-family: var(--font-display); font-weight: 700; font-size: 36px; margin: 0 0 8px; }
.success-wrap > p { color: var(--ink-soft); margin: 0 0 26px; }
.order-card { text-align: left; }
.order-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin-bottom: 20px; }
.order-meta .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.order-meta .v { font-weight: 600; }
.order-meta .v.num { font-family: var(--font-display); color: var(--primary); font-size: 18px; }
.success-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }

/* ============================================================
   RESPONSIVE — cart / checkout / payment
   ============================================================ */
@media (max-width: 860px) {
  .shop-grid { grid-template-columns: 1fr; }
  .summary   { position: static; top: auto; }
  .panel     { padding: 22px 20px; }
}

@media (max-width: 600px) {
  .shop { padding: 28px 0 60px; }
  .shop-head h1  { font-size: clamp(24px, 7vw, 36px); }
  .shop-head .steps { font-size: 12px; gap: 6px; }

  /* Cart line items — tighter on small screens */
  .cart-line {
    grid-template-columns: 48px 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px 12px;
    padding: 14px 0;
  }
  .cart-line .pic     { width: 48px; height: 48px; grid-row: 1 / 3; }
  .cart-line .ci-info { grid-column: 2 / 3; }
  .cart-line .qty     { grid-column: 2 / 3; grid-row: 2; }
  .cart-line .ci-total { grid-column: 3 / 4; grid-row: 1 / 3; align-self: center; }

  /* Form fields — all full width */
  .field.half, .field.half + .field.half {
    width: 100%; margin-left: 0; display: block;
  }

  /* Payment methods — full width */
  .pay-methods { gap: 10px; }
  .pay-method  { padding: 13px 14px; gap: 10px; }

  /* Order summary */
  .summary .grand { font-size: 18px; }
  .summary-items  { max-height: none; }

  /* Success page */
  .success-wrap h1  { font-size: 28px; }
  .order-meta { grid-template-columns: 1fr; gap: 12px; }
  .success-actions { flex-direction: column; align-items: stretch; }
  .success-actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .panel { padding: 18px 16px; }
  .panel h2 { font-size: 17px; }
  .btn-lg   { padding: 14px 20px; font-size: 15px; }
  .qty button { width: 28px; height: 30px; }
  .qty span   { min-width: 26px; font-size: 13px; }
}
