/* ==========================================================================
   Checkout refresh (cart.checkout + cart.custom_checkout)
   Loaded after custom.css via @stack('after_styles'); everything is scoped
   to .checkout-page so other pages are untouched.
   ========================================================================== */

.checkout-page {
  --co-border: #e2e8f0;
  --co-text: #0f172a;
  --co-muted: #64748b;
  --co-radius: 14px;
  --co-accent: var(--storecolor, #e53e3e);
}

.checkout-page.bg_skyblue,
.checkout-page .bg_skyblue {
  background: #f8fafc !important;
}

/* Cards: neutral border instead of the lavender glow */
.checkout-page .cart-content .orderType_selection_div,
.checkout-page .cart-content div#time_slot_range,
.checkout-page .col-lg-12.contact_info_sec.billing_address_section,
.checkout-page .contact_info_sec.field_delivery,
.checkout-page .shipping_address_section,
.checkout-page .order_comment_section,
.checkout-page .right_sidebar-cart,
.checkout-page div#totalPrices,
.checkout-page .payment_sec_maindiv,
.checkout-page #store_information .pickup_location-box {
  background: #ffffff !important;
  border: 1px solid var(--co-border) !important;
  border-radius: var(--co-radius) !important;
  box-shadow: none !important;
}

.checkout-page .cart-title h3,
.checkout-page h3#billing_info_head {
  color: var(--co-text) !important;
  font-weight: 700 !important;
}

/* Sign in link uses the store colour, not Bootstrap blue */
.checkout-page .billing_address_section a.text-primary,
.checkout-page .add_adrs_btn {
  color: var(--co-accent) !important;
}

/* Inputs */
.checkout-page .form-control:not(textarea),
.checkout-page select.form-control {
  border-radius: 10px;
  border-color: var(--co-border);
}

.checkout-page textarea.form-control {
  border-radius: 10px;
  border-color: var(--co-border);
}

.checkout-page .form-control:focus {
  border-color: var(--co-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--co-accent) 15%, transparent);
}

/* Delivery area now sits with the address fields */
.checkout-page .left-cart .areadelivery {
  background: #ffffff;
  border: 1px solid var(--co-border);
  border-radius: var(--co-radius);
  /* 8px + 1px border = same 9px inset as the billing fields and notes box */
  padding: 12px 8px !important;
  margin: 15px 0 0 !important;
}

.checkout-page .left-cart .areadelivery .cart-title {
  padding-bottom: 6px !important;
}

/* Coupon: a quiet row instead of a red dashed banner */
.checkout-page #coupon_section .cart-title {
  display: none;
}

.checkout-page #coupon_section .cart_coupen_default_div {
  border: 1px solid var(--co-border) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  padding: 10px 14px !important;
  margin: 4px 0 10px !important;
}

.checkout-page #coupon_section .cart_coupen_default_div ul {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px;
  margin: 0 !important;
  padding: 0 !important;
}

.checkout-page #coupon_section .cart_coupen_default_div .coupen_svg_li {
  display: none !important;
}

.checkout-page #coupon_section .cart_coupen_default_div .coupen_text1_li {
  flex: 1 1 auto;
  width: auto !important;
  max-width: none !important;
  white-space: nowrap;
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  color: #334155 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

.checkout-page #coupon_section .cart_coupen_default_div .coupen_text1_li::before {
  content: "\f02b";
  font-family: 'Line Awesome Free';
  font-weight: 900;
  font-size: 18px;
  color: var(--co-accent);
}

.checkout-page #coupon_section .cart_coupen_default_div .coupen_text2_li {
  flex: 0 0 auto;
  width: auto !important;
  margin: 0 !important;
}

.checkout-page #coupon_section .coupen_text2_li button#have_coupon_btn {
  border: none !important;
  background: transparent !important;
  color: var(--co-accent) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  padding: 4px 2px !important;
  box-shadow: none !important;
}

/* Order summary + totals in neutral tones */
.checkout-page .payment_title_text,
.checkout-page #totalPrices .ammount {
  color: #334155 !important;
}

.checkout-page #totalPrices .total_price {
  color: var(--co-text) !important;
  font-weight: 800 !important;
}

.checkout-page .cart_edit_btn {
  color: var(--co-text) !important;
}

/* Place order: store colour, shows the order total, no pulsing */
body .checkout-page .btn.btn-primary-grad.paymentbutton {
  background: var(--co-accent) !important;
  background-color: var(--co-accent) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: var(--co-radius) !important;
  box-shadow: 0 8px 22px -6px rgba(15, 23, 42, 0.35) !important;
  animation: none !important;
  font-family: inherit !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body .checkout-page .btn.btn-primary-grad.paymentbutton::after {
  content: var(--co-order-total, "");
}

@media (max-width: 767px) {
  /* Fixed bottom bar: full width now that the Home button is gone */
  .checkout-page #totalSubmitCOD,
  .checkout-page div[id$="-payment-form"] {
    justify-content: center !important;
    padding: 0 16px;
    box-sizing: border-box;
  }

  body .checkout-page .btn.btn-primary-grad.paymentbutton {
    width: 100% !important;
    height: 56px !important;
    /* custom.css shifts it with right: 4% to make room for the old Home button */
    right: auto !important;
    left: auto !important;
  }
}

/* Notice card. Stores write this in a rich-text editor: some use a few plain
   paragraphs, others paste fully designed HTML (boxes, columns, inline styles).
   Only plain-text notices get aligned under the "Notice" title; designed ones
   are left exactly as authored, full width. */
.checkout-page .pickup_deliver_notice:not(:has(div, table, section, img, [style])) {
  padding-left: 50px !important;
  font-size: 13.5px;
  line-height: 1.5;
  color: #334155;
}

.checkout-page .pickup_deliver_notice:not(:has(div, table, section, img, [style])) p {
  margin: 0 0 4px;
}

.checkout-page .pickup_deliver_notice:not(:has(div, table, section, img, [style])) p:last-child {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .checkout-page .pickup_deliver_notice:not(:has(div, table, section, img, [style])) {
    padding-left: 45px !important;
  }
}

/* Minimum-order warning repeated at the top of checkout */
.checkout-page .co-min-order {
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 12px;
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--co-radius);
  color: #b91c1c;
  font-size: 13.5px;
  line-height: 1.45;
}

.checkout-page .co-min-order-icon {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1.1;
}

.checkout-page .co-min-order-body {
  flex: 1 1 auto;
  min-width: 0;
}

.checkout-page .co-min-order-text,
.checkout-page .co-min-order-text * {
  color: inherit !important;
  background: transparent !important;
}

.checkout-page .co-min-order-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  color: var(--co-accent) !important;
  font-weight: 700;
  text-decoration: none !important;
}

/* custom.css sets overflow-x: hidden on html and body; on body that makes it its own
   scroll box and position: sticky stops working. clip keeps the clipping without that. */
body {
  overflow-x: clip;
}

/* Desktop header (.web-menu, > 996px) already has View Cart / Back to Shop buttons */
@media (min-width: 997px) {
  .checkout-page .co-backbar {
    display: none !important;
  }
}

/* Back to shop / Edit cart row: pinned to the top while scrolling the whole checkout */
.checkout-page .co-backbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -15px 10px;
  padding: 8px 15px;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.checkout-page .co-backbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--co-border);
  border-radius: 9999px;
  background: #ffffff;
  color: var(--co-text) !important;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
}

.checkout-page .co-backbar-link i {
  font-size: 15px;
}

.checkout-page .co-backbar-edit {
  color: var(--co-accent) !important;
  border-color: color-mix(in srgb, var(--co-accent) 35%, #ffffff);
}


/* The delivery minimum message is only refreshed for Delivery; hide it after switching away */
.checkout-page:has(input[name="dineType"]:checked):not(:has(input[name="dineType"][value="delivery"]:checked)) #minimum_order_notice,
.checkout-page:has(input[name="dineType"]:checked):not(:has(input[name="dineType"][value="delivery"]:checked)) #co-min-order {
  display: none !important;
}

/* Delivery area dropdown flagged when Place order is tapped without one */
.checkout-page .areadelivery.co-needs-attention select.form-control,
.checkout-page .areadelivery.co-needs-attention .select2-selection {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

/* Only one minimum-order message: the banner at the top replaces the copy in the totals */
.checkout-page:has(#co-min-order) #minimum_order_notice {
  display: none !important;
}

/* "Back to shop / Edit cart" at the top replaces the Edit / Add More row under the totals */
.checkout-page div.continue-shopping-button {
  display: none !important;
}

/* Order lines: one list card with dividers instead of a box per line */
.checkout-page .checkout-items-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid var(--co-border);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.checkout-page .checkout-items-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid var(--co-border);
  padding: 10px 12px !important;
}

.checkout-page .checkout-items-table thead th h3 {
  margin: 0;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--co-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.checkout-page .checkout-items-table tbody td {
  border: none !important;
  border-radius: 0 !important;
  padding: 10px 12px !important;
  vertical-align: top;
  color: var(--co-text) !important;
}

.checkout-page .checkout-items-table tbody tr + tr td {
  border-top: 1px solid #f1f5f9 !important;
}

.checkout-page .checkout-items-table tbody td:last-child {
  font-size: 14px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}

.checkout-page .co-item-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500 !important;
}

.checkout-page .co-item-qty {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 1px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--co-accent) 10%, #ffffff);
  color: var(--co-accent);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.6;
}

.checkout-page .co-item-name {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--co-text);
}

/* Delivery-area hint under the dropdown */
.checkout-page .co-area-hint {
  margin-top: 8px;
  padding-left: 22px;
  position: relative;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--co-muted);
}

.checkout-page .co-area-hint::before {
  content: "\f05a";
  font-family: 'Line Awesome Free';
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 0;
  font-size: 16px;
  color: var(--co-muted);
}

.checkout-page .co-area-hint a {
  color: var(--co-accent) !important;
  font-weight: 600;
}

/* While no area is picked that message lives under the dropdown, not in the totals */
.checkout-page:has(#delivery_area option[value=""]:checked) #freedeliverynotice {
  display: none !important;
}

/* Delivery message in the totals (free-delivery progress etc.): a quiet info note */
.checkout-page #freedeliverynotice {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0 0 !important;
  padding: 10px 12px !important;
  border: 1px solid var(--co-border) !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
  box-shadow: none !important;
}

.checkout-page #freedeliverynotice .notice-icon {
  flex: 0 0 auto;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.checkout-page #freedeliverynotice .notice-icon img {
  display: none !important;
}

.checkout-page #freedeliverynotice .notice-icon::before {
  content: "\f0d1";
  font-family: 'Line Awesome Free';
  font-weight: 900;
  font-size: 20px;
  color: var(--co-accent);
}

.checkout-page #freedeliverynotice .notice-content,
.checkout-page #freedeliverynotice .notice-content * {
  font-size: 13px !important;
  line-height: 1.5;
  color: #334155 !important;
}

.checkout-page #freedeliverynotice .notice-content a {
  color: var(--co-accent) !important;
  font-weight: 600;
}

/* Coupon entry: one rounded field with an Apply button inside */
.checkout-page .co-coupon-box {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--co-border);
  border-radius: 12px;
  background: #ffffff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.checkout-page .co-coupon-box:focus-within {
  border-color: var(--co-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--co-accent) 15%, transparent);
}

.checkout-page .co-coupon-icon {
  font-size: 18px;
  color: var(--co-muted);
}

.checkout-page .co-coupon-input,
.checkout-page .co-coupon-input:focus {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  padding: 0 4px !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--co-text);
}

.checkout-page .co-coupon-input::placeholder {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: #94a3b8;
}

.checkout-page .co-coupon-apply {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: 9px;
  background: var(--co-accent);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

/* Applied: green field with the code, "Applied" tag and a Remove link */
.checkout-page .co-coupon-box:has(#coupon_code[readonly]) {
  border-color: #86efac;
  background: #f0fdf4;
}

.checkout-page .co-coupon-box:has(#coupon_code[readonly]) .co-coupon-icon,
.checkout-page .co-coupon-box:has(#coupon_code[readonly]) .co-coupon-input {
  color: #15803d;
}

/* custom.css absolutely positions every span in .cart-coupon-sec (right: 33% / 45px) */
.checkout-page .co-coupon-box span {
  position: static !important;
}

.checkout-page .co-coupon-applied {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  color: #15803d;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.checkout-page .co-coupon-applied i {
  font-size: 16px;
}

.checkout-page .co-coupon-remove {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 10px;
  border: none;
  background: transparent;
  color: var(--co-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.checkout-page .co-coupon-remove:hover {
  color: #dc2626;
}

/* The toast already says whether the code worked */
.checkout-page .co-coupon-status {
  display: none;
}

.checkout-page .cart-coupon-sec {
  margin-bottom: 12px;
}

/* Once a coupon is applied, the "Have a coupon? Apply" row is not needed */
.checkout-page #coupon_section:has(#coupon_code[readonly]) .cart_coupen_default_div {
  display: none !important;
}


/* Totals: receipt style. Same size for every charge row, no dashed line per row,
   one solid line above a bold Total (only when there are rows above it). */
.checkout-page #totalPrices .card-body {
  min-height: 0 !important;
}

.checkout-page #totalPrices .border_bottom_dashed,
.checkout-page #totalPrices #tax_column,
.checkout-page #totalPrices #tax_column * {
  border-bottom: none !important;
  border-top: none !important;
}

.checkout-page #totalPrices .payment_title_text,
.checkout-page #totalPrices .ammount,
.checkout-page #totalPrices #tax_column,
.checkout-page #totalPrices #tax_column * {
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #475569 !important;
  line-height: 1.6;
}

.checkout-page #totalPrices .total_price_main_sec .payment_title_text,
.checkout-page #totalPrices .total_price_main_sec .total_price {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: var(--co-text) !important;
}

.checkout-page #totalPrices:has(.sub-total_Price) .total_price_main_sec {
  margin-top: 6px;
  padding-top: 8px !important;
  border-top: 1px solid var(--co-border);
}

/* Pickup / delivery store card */
.checkout-page .co-store {
  padding: 2px 4px 4px 4px;
}

.checkout-page .co-store p {
  margin: 0;
}

.checkout-page .co-store-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--co-text);
  line-height: 1.35;
}

.checkout-page .co-store-address {
  margin-top: 2px !important;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--co-muted);
}

.checkout-page .co-store-hours {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px !important;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.checkout-page .co-store-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.checkout-page .co-store-open {
  color: #15803d;
}

.checkout-page .co-store-open .co-store-dot {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.checkout-page .co-store-closed {
  color: var(--co-muted);
}

.checkout-page .co-store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.checkout-page .co-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--co-border);
  border-radius: 9999px;
  background: #ffffff;
  color: var(--co-text) !important;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
}

.checkout-page .co-store-btn i {
  font-size: 17px;
  color: var(--co-accent);
}

.checkout-page .co-store-btn:hover {
  border-color: var(--co-accent);
}

/* Chosen pickup / delivery time: one row with a Change link */
.checkout-page .co-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--co-border);
}

.checkout-page .co-slot-icon {
  flex: 0 0 auto;
  font-size: 22px;
  color: var(--co-accent);
}

.checkout-page .co-slot-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.checkout-page .co-slot-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--co-muted);
}

.checkout-page .co-slot-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--co-text);
}

.checkout-page .co-slot-empty {
  font-weight: 500;
  color: var(--co-muted);
}

.checkout-page .co-slot-change {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--co-accent) 40%, #ffffff);
  border-radius: 9999px;
  background: #ffffff;
  color: var(--co-accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
