@keyframes coRestBounceIn {
          0% {
            opacity: 0;
            transform: scale(0.3);
          }

          50% {
            opacity: 1;
            transform: scale(1.05);
          }

          70% {
            transform: scale(0.9);
          }

          100% {
            transform: scale(1);
          }
        }

        .co-rest-animate-bounce-in {
          animation: coRestBounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
        }

        .co-rest-success-card {
          animation: coRestFadeInUp 0.6s ease-out both;
        }

        @keyframes coRestFadeInUp {
          from {
            opacity: 0;
            transform: translateY(30px);
          }

          to {
            opacity: 1;
            transform: translateY(0);
          }
        }

        @media (max-width: 768px) {

          /* Scrolls with the page rather than trapping content in a fixed-height
           box: overflow-y:auto without a height cap creates no scroll container,
           so the card must stay in normal flow to remain reachable. */
          .checkout-restaurant-section .co-rest-success-container.mobile-full-page {
            display: block !important;
            overflow: visible !important;
            -webkit-overflow-scrolling: touch;
          }

          .checkout-restaurant-section .co-rest-success-container.mobile-full-page .co-rest-success-card {
            padding-top: 2rem !important;
            padding-bottom: 2rem !important;
          }
        }

        .checkout-restaurant-section .co-rest-card {
          background: var(--card-bg, #fff);
          border: 1px solid var(--border, #eaeaea);
          border-radius: 12px;
          padding: 1.5rem;
        }

        .checkout-restaurant-section .co-rest-address-card {
          border: 2px solid var(--border, #e5e5e5);
          border-radius: 10px;
          padding: 1rem;
          cursor: pointer;
          transition: all 0.2s;
        }

        .checkout-restaurant-section .co-rest-address-card.selected {
          border-color: var(--accent, #d4521a);
          background: rgba(212, 82, 26, 0.05);
        }

        .checkout-restaurant-section .co-rest-payment-option {
          border: 1px solid var(--border, #e5e5e5);
          border-radius: 10px;
          cursor: pointer;
        }

        .checkout-restaurant-section .co-rush-note {
          font-size: 0.72rem;
          font-weight: 400;
          line-height: 1.35;
          color: #b8860b;
          margin-top: 5px;
        }

        /* ── Coupon suggestion slider ── */
        #coupon-suggestions .co-coupon-slider-label {
          font-size: 0.8rem;
          font-weight: 700;
          color: #1a1a1a;
          margin-bottom: 8px;
        }

        #coupon-suggestions .co-coupon-slider {
          display: flex;
          gap: 12px;
          overflow-x: auto;
          overflow-y: hidden;
          /* generous top padding so the "Best" ribbon never clips */
          padding: 12px 4px 10px;
          margin: 0 -4px;
          scroll-snap-type: x proximity;
          -webkit-overflow-scrolling: touch;
          /* hide the horizontal scrollbar (Firefox / IE-Edge); scrolling still works */
          scrollbar-width: none;
          -ms-overflow-style: none;
        }

        /* hide the horizontal scrollbar (Chrome / Safari) */
        #coupon-suggestions .co-coupon-slider::-webkit-scrollbar {
          display: none;
          width: 0;
          height: 0;
        }

        #coupon-suggestions .co-coupon-card {
          position: relative;
          flex: 0 0 auto;
          width: 168px;
          padding: 13px 15px;
          border: 1px solid rgba(40, 167, 69, 0.3);
          border-radius: 12px;
          background: linear-gradient(135deg, rgba(40, 167, 69, 0.06), rgba(40, 167, 69, 0.02));
          cursor: pointer;
          scroll-snap-align: start;
          transition: transform 0.12s ease, box-shadow 0.12s ease;
        }

        #coupon-suggestions .co-coupon-card:hover {
          transform: translateY(-2px);
          box-shadow: 0 4px 14px rgba(40, 167, 69, 0.18);
        }

        #coupon-suggestions .co-coupon-card--best {
          border-color: #28a745;
          background: linear-gradient(135deg, rgba(40, 167, 69, 0.16), rgba(40, 167, 69, 0.05));
          box-shadow: 0 0 0 1.5px #28a745 inset;
        }

        #coupon-suggestions .co-coupon-card--locked {
          border-style: dashed;
          border-color: #ced4da;
          background: #f8f9fa;
          cursor: default;
          opacity: 0.85;
        }

        #coupon-suggestions .co-coupon-card--locked:hover {
          transform: none;
          box-shadow: none;
        }

        #coupon-suggestions .co-coupon-badge {
          position: absolute;
          top: 8px;
          right: 10px;
          display: inline-flex;
          align-items: center;
          gap: 3px;
          background: #28a745;
          color: #fff;
          font-size: 0.56rem;
          font-weight: 700;
          padding: 2px 7px;
          border-radius: 999px;
          letter-spacing: 0.04em;
          text-transform: uppercase;
          line-height: 1;
          white-space: nowrap;
          box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
          z-index: 2;
        }

        #coupon-suggestions .co-coupon-badge i {
          font-size: 0.52rem;
        }

        /* headline avoids running under the top-right badge */
        #coupon-suggestions .co-coupon-card--best .co-coupon-headline {
          padding-right: 50px;
        }

        #coupon-suggestions .co-coupon-headline {
          font-size: 0.98rem;
          font-weight: 800;
          color: #1a7431;
          line-height: 1.2;
        }

        #coupon-suggestions .co-coupon-card--locked .co-coupon-headline {
          color: #6c757d;
        }

        #coupon-suggestions .co-coupon-code {
          font-size: 0.78rem;
          font-weight: 700;
          color: #1a1a1a;
          margin-top: 4px;
          letter-spacing: 0.03em;
        }

        #coupon-suggestions .co-coupon-sub {
          font-size: 0.7rem;
          color: #6c757d;
          margin-top: 3px;
        }

        /* ── Coupon detail modal (self-contained, no Bootstrap JS dependency) ── */
        #co-coupon-modal {
          position: fixed;
          inset: 0;
          z-index: 2147483000;
          display: none;
          align-items: center;
          justify-content: center;
          padding: 16px;
          background: rgba(0, 0, 0, 0.55);
        }

        #co-coupon-modal.open {
          display: flex;
        }

        #co-coupon-modal .co-cm-card {
          position: relative;
          width: 100%;
          max-width: 380px;
          max-height: 90vh;
          overflow-y: auto;
          background: var(--card-bg, #fff);
          color: var(--text, #1a1a1a);
          border: 1px solid var(--border, #e5e5e5);
          border-radius: 14px;
          box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
          padding: 22px 20px 20px;
          animation: coCmIn 0.18s ease;
        }

        @keyframes coCmIn {
          from {
            opacity: 0;
            transform: translateY(10px) scale(0.98);
          }

          to {
            opacity: 1;
            transform: translateY(0) scale(1);
          }
        }

        #co-coupon-modal .co-cm-close {
          position: absolute;
          top: 12px;
          right: 12px;
          width: 30px;
          height: 30px;
          border-radius: 50%;
          border: 1px solid var(--border, #e5e5e5);
          background: transparent;
          color: var(--text, #1a1a1a);
          font-size: 1rem;
          line-height: 1;
          cursor: pointer;
          display: flex;
          align-items: center;
          justify-content: center;
        }

        #co-coupon-modal .co-cm-close:hover {
          background: rgba(0, 0, 0, 0.06);
        }

        #co-coupon-modal .co-cm-badge {
          display: inline-flex;
          align-items: center;
          gap: 4px;
          font-size: 0.6rem;
          font-weight: 700;
          text-transform: uppercase;
          letter-spacing: 0.04em;
          padding: 3px 9px;
          border-radius: 999px;
          background: #28a745;
          color: #fff;
          margin-bottom: 10px;
        }

        #co-coupon-modal .co-cm-headline {
          font-size: 1.35rem;
          font-weight: 800;
          color: #1a7431;
          line-height: 1.2;
          margin: 2px 0 2px;
        }

        #co-coupon-modal .co-cm-code {
          display: inline-block;
          font-size: 0.82rem;
          font-weight: 700;
          letter-spacing: 0.08em;
          color: var(--text, #1a1a1a);
          border: 1px dashed var(--border, #ced4da);
          border-radius: 6px;
          padding: 4px 10px;
          margin: 8px 0 14px;
        }

        #co-coupon-modal .co-cm-rows {
          border-top: 1px solid var(--border, #eee);
          padding-top: 12px;
          margin-bottom: 16px;
        }

        #co-coupon-modal .co-cm-row {
          display: flex;
          justify-content: space-between;
          gap: 12px;
          font-size: 0.82rem;
          padding: 5px 0;
        }

        #co-coupon-modal .co-cm-row .k {
          color: var(--text-muted, #6c757d);
        }

        #co-coupon-modal .co-cm-row .v {
          font-weight: 600;
          text-align: right;
          color: var(--text, #1a1a1a);
        }

        #co-coupon-modal .co-cm-note {
          font-size: 0.78rem;
          color: #b8860b;
          background: rgba(240, 173, 78, 0.12);
          border: 1px solid rgba(240, 173, 78, 0.3);
          border-radius: 8px;
          padding: 8px 10px;
          margin-bottom: 14px;
        }

        #co-coupon-modal .co-cm-apply {
          display: block;
          width: 100%;
          padding: 12px;
          border: none;
          border-radius: 10px;
          font-size: 0.9rem;
          font-weight: 700;
          letter-spacing: 0.02em;
          cursor: pointer;
          background: #28a745;
          color: #fff;
          transition: filter 0.15s ease;
        }

        #co-coupon-modal .co-cm-apply:hover {
          filter: brightness(1.06);
        }

        #co-coupon-modal .co-cm-apply:disabled {
          background: #ced4da;
          color: #6c757d;
          cursor: not-allowed;
        }