/* FnP-style inline layout for PDP delivery flow */

/* Remove modal overlay behaviors */
#shippingOptionsModal.ycake-inline-flow {
  position: relative;
  display: block;
  background: transparent;
  padding: 0;
  margin-top: 14px;
}

#shippingOptionsModal.ycake-inline-flow .modal-dialog,
#shippingOptionsModal.ycake-inline-flow .modal-content {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

#shippingOptionsModal.ycake-inline-flow .modal-dialog {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

#shippingOptionsModal.ycake-inline-flow .modal-content {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

#shippingOptionsModal.ycake-inline-flow .modal-body {
  padding: 0 !important;
  overflow: visible !important;
  display: block !important;
}

#shippingOptionsModal.ycake-inline-flow .wrap-modal-slider {
  padding: 0 !important;
  opacity: 1 !important;
  height: auto !important;
}

/* Prevent initial "red header" flash (hide modal chrome via CSS, not JS) */
#shippingOptionsModal.ycake-inline-flow .modal-header,
#shippingOptionsModal.ycake-inline-flow .modal-footer {
  display: none !important;
}

/* Undo modal-specific fixed-height slick rules for inline mode */
#shippingOptionsModal.ycake-inline-flow .shipping-class,
#shippingOptionsModal.ycake-inline-flow .shipping-class .slick-list,
#shippingOptionsModal.ycake-inline-flow .shipping-class .slick-track,
#shippingOptionsModal.ycake-inline-flow .shipping-class .slick-slide,
#shippingOptionsModal.ycake-inline-flow .shipping-class .slick-slide > div {
  height: auto !important;
}

/* Stack sections with separators (FnP-like) */
#shippingOptionsModal.ycake-inline-flow .shipping-class > div {
  padding: 14px 0;
  border-top: 1px solid #eee;
}

#shippingOptionsModal.ycake-inline-flow .shipping-class > div:first-child {
  border-top: 0;
}

/* Section headings */
.ycake-inline-heading {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: #222;
}

/* Icon color should match Yummycake brand */
.ycake-inline-heading .fa {
  margin-right: 8px;
  color: #ef5c73;
}

/* Delivery location row like screenshot */
.ycake-delivery-location-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.ycake-delivery-location-row input#delivery-address {
  flex: 1;
  width: auto;
}

.ycake-locate-btn {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid #1f2d3d;
  background: #1f2d3d;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.ycake-locate-btn .fa {
  margin-right: 10px;
}

.ycake-locate-btn:hover {
  opacity: 0.92;
}

/* Continue button not needed in FnP-like UX; keep for fallback but hide */
.ycake-continue-btn {
  display: none !important;
}

/* Undo legacy/select-like styling applied to #delivery-address in delivery_options.css */
body.ycake-inline-flow #delivery_date_selectlocation .full-field.full-field-wrap,
body.ycake-inline-flow #delivery_date_selectlocation .full-field-wrap {
  padding-left: 0 !important;
  padding-top: 0 !important;
}

body.ycake-inline-flow #delivery_date_selectlocation input#delivery-address {
  width: auto !important;              /* let flex handle width */
  background: none !important;         /* remove dropdown arrow image */
  -webkit-appearance: none !important; /* remove select-like appearance */
  appearance: none !important;
  padding: 9px 14px !important;
  border: 1px solid #cecece !important;
  border-right: 1px solid #cecece !important;
  border-radius: 10px !important;
  height: 44px !important;
  margin: 0 !important;
}

@media (max-width: 767px) {
  .ycake-delivery-location-row {
    flex-direction: column;
    align-items: stretch;
  }
  .ycake-locate-btn {
    width: 100%;
  }
}

/* Date chips */
#ycake-date-chips {
  display: flex;
  gap: 10px;
  margin: 10px 0 12px;
}

#ycake-date-section {
  margin-top: 14px;
}

.ycake-date-chip {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.ycake-date-chip .ycake-date-chip-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: #222;
}

.ycake-date-chip .ycake-date-chip-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #666;
}

.ycake-date-chip.active {
  border-color: #b81930;
  box-shadow: 0 0 0 2px rgba(184, 25, 48, 0.12);
  background: #fff7f8;
}

#ycake-later-picker-wrap {
  display: none;
  margin-top: 10px;
}

/* In inline mode, hide the legacy summary row UI (we use inline sections instead) */
#delivery_date_field .delivery-options-wrapper {
  display: none !important;
}

/* Ensure Buy Now stays visible in inline mode.
   Theme JS toggles .buynow-btn based on body classes; this overrides it. */
.single-product .buynow-btn {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* In inline flow, ONLY show the Buy Now wrapper inside our CTA container.
   This prevents occasional duplicate/stray .buynow-btn wrappers from the theme JS. */
body.ycake-inline-flow .buynow-btn {
  display: none !important;
}
body.ycake-inline-flow #ycake-inline-cta .buynow-btn {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* PDP header cleanup (inline flow only) */
body.ycake-inline-flow.single-product header.banner a.phone-w,
body.ycake-inline-flow.single-product header.banner a.whatsapp-w,
body.ycake-inline-flow.single-product header.banner span.callnumber,
body.ycake-inline-flow.single-product header.banner .top-menu li.hide-m {
  display: none !important;
}

/* PDP: hide enquiry phone/WhatsApp row near price (if present) */
body.ycake-inline-flow.single-product .whatsapp-icons-t,
body.ycake-inline-flow.single-product .whatsapp-icons-t a.phone-w,
body.ycake-inline-flow.single-product .whatsapp-icons-t a.whatsapp-w {
  display: none !important;
}

/* Hide mobile header search bar on PDP (inline flow only) */
@media (max-width: 991.98px) {
  body.ycake-inline-flow.single-product .search-container-mobile {
    display: none !important;
  }
}

/* FnP-like sticky CTA that stays within the right column (desktop),
   and fixed full-width on mobile. Implemented via #ycake-inline-cta wrapper. */
body.ycake-inline-flow .ycake-inline-cta {
  /* No background bar: keep just a floating button */
  background: transparent;
  border-top: 0;
  box-shadow: none;
  z-index: 999999;
}

/* Neutralize theme/mobile fixed-bar styles once we mount into our wrapper */
body.ycake-inline-flow .ycake-inline-cta .buynow-btn {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
}

body.ycake-inline-flow .ycake-inline-cta button.single_add_to_cart_button {
  border-radius: 10px !important;
  margin: 0 !important;
  /* Floating button feel */
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
  padding: 10px 18px !important;
  line-height: 22px !important;
  font-size: 15px !important;
}

/* Inline CTA status message */
body.ycake-inline-flow .ycake-inline-cta-status {
  font-size: 13px;
  color: #222;
  margin: 0 0 8px 0;
}

body.ycake-inline-flow button.single_add_to_cart_button.is-busy {
  opacity: 0.8;
  cursor: not-allowed;
}

/* Better inline validation UI */
body.ycake-inline-flow .ycake-inline-alert {
  border: 1px solid #f1b4bb;
  background: #fff5f6;
  color: #8b1023;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
}

body.ycake-inline-flow .ycake-inline-alert__title {
  font-weight: 700;
  margin-bottom: 4px;
}

body.ycake-inline-flow .ycake-inline-alert__msg {
  font-weight: 600;
}

body.ycake-inline-flow .ycake-field-error {
  outline: 2px solid rgba(184, 25, 48, 0.28);
  border-radius: 12px;
}

/* Screenshot-style per-section validation */
body.ycake-inline-flow #delivery_date_selectlocation.ycake-invalid,
body.ycake-inline-flow #ycake-date-section.ycake-invalid,
body.ycake-inline-flow #ycake-timeslot-section.ycake-invalid,
body.ycake-inline-flow .ycake-timeslot-options.ycake-invalid {
  border: 2px solid #d94a57;
  background: #fff7f8;
  border-radius: 12px;
  padding: 14px;
}

body.ycake-inline-flow #ycake-date-section.ycake-invalid {
  margin-top: 14px;
}

body.ycake-inline-flow .ycake-error-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fdebec;
  border: 1px solid #f1b4bb;
  color: #b81930;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0 0 0;
  font-weight: 700;
}

body.ycake-inline-flow .ycake-error-banner__icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #b81930;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
}

body.ycake-inline-flow .ycake-error-banner__icon::after {
  content: "!";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
}

body.ycake-inline-flow .ycake-error-banner__text {
  flex: 1 1 auto;
}

/* Hide quantity selector in inline flow (FnP-like) */
body.ycake-inline-flow .summary.entry-summary form.cart .quantity,
body.ycake-inline-flow .summary.entry-summary form.cart .qty,
body.ycake-inline-flow #ycake-inline-cta ~ .quantity {
  display: none !important;
}

@media (min-width: 992px) {
  /* Desktop: sticky within summary; stops when summary ends (FnP behavior) */
  body.ycake-inline-flow .summary.entry-summary {
    padding-bottom: 18px; /* keep last section breathing room above CTA */
  }

  body.ycake-inline-flow .ycake-inline-cta {
    position: sticky;
    bottom: 0; /* sit flush to bottom (no gap) */
    padding: 0;
    border-radius: 0;
  }

  body.ycake-inline-flow .ycake-inline-cta .buynow-btn button.single_add_to_cart_button {
    width: 100% !important; /* expand within right column */
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 991.98px) {
  /* Mobile/tablet: fixed full-width at the bottom */
  body.ycake-inline-flow {
    /* reserve space for fixed CTA + iOS safe area */
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  body.ycake-inline-flow .ycake-inline-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    /* FnP-like bottom bar */
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.10);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.14);
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  body.ycake-inline-flow .ycake-inline-cta .buynow-btn {
    justify-content: center !important;
    width: 100% !important;
  }

  body.ycake-inline-flow .ycake-inline-cta .buynow-btn button.single_add_to_cart_button {
    width: 100% !important;
    max-width: none;
    min-height: 52px;
    padding: 12px 18px !important;
    font-size: 16px !important;
    border-radius: 12px !important;
    /* On mobile, the bar provides the elevation; avoid double-shadow */
    box-shadow: none !important;
  }
}

/* Time slot FnP-like layout */
#ycake-timeslot-section {
  margin-top: 16px;
}

.ycake-timeslot-layout {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.ycake-timeslot-methods {
  flex: 0 0 42%;
  max-width: 42%;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.ycake-timeslot-options {
  flex: 1 1 auto;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.ycake-timeslot-options-title {
  font-weight: 700;
  margin-bottom: 10px;
  color: #222;
}

/* Shipping method cards (FnP-like boxed look) */
.ycake-method-item {
  margin: 0 0 12px 0 !important;
  border: 2px solid #e8e8e8;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.ycake-method-item:last-child {
  margin-bottom: 0 !important;
}

.ycake-method-item .at-item {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.ycake-method-item .at-title:after,
.ycake-method-item .at-title.active:after {
  display: none !important;
}

.ycake-method-item .at-title label {
  position: relative;
  padding: 14px 14px 14px 52px;
}

.ycake-method-item.is-active {
  border-color: #ff6a2b;
  background: #fff7f0;
}

.ycake-method-item .at-tab {
  display: none !important;
}

/* Hide legacy radio widget and draw our own indicator */
.ycake-timeslot-methods .outer-r,
.ycake-timeslot-methods .ot-radio,
.ycake-timeslot-methods .radio-col,
.ycake-timeslot-methods .checkmark {
  display: none !important;
}

body.ycake-inline-flow .ycake-timeslot-methods .at-title label::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 24px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid #c9c9c9;
  background: #fff;
  box-sizing: border-box;
}

body.ycake-inline-flow .ycake-method-item.is-active .at-title label::before {
  border-color: #ff6a2b;
}

body.ycake-inline-flow .ycake-method-item.is-active .at-title label::after {
  content: "";
  position: absolute;
  left: 21px; /* 16 + (20-10)/2 */
  top: 24px;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ff6a2b;
  box-sizing: border-box;
}

/* Title/price alignment */
.ycake-timeslot-methods .at-title label > span {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.ycake-timeslot-methods .at-title label > span > span {
  font-weight: 800;
  color: #1f2d3d;
}
body.ycake-inline-flow .ycake-timeslot-methods .at-title label .price-tag {
  margin-left: auto;
  font-style: normal;
  font-weight: 800;
  color: #ff6a2b !important;
  background: #fff1e8 !important;
  border: 1px solid #ffd0bb !important;
  border-radius: 10px;
  padding: 6px 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  box-shadow: none !important;
}
.ycake-timeslot-methods .at-title label p {
  margin: 6px 0 0 0;
  color: #6b7280;
  font-weight: 600;
  line-height: 1.25;
}

/* Placeholder in right pane before method selection */
.ycake-timeslot-empty {
  border: 2px dashed #e5e5e5;
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  color: #6b7280;
  font-weight: 700;
}

/* Right pane time slots as vertical list */
.ycake-timeslot-options-body .inline-time-slots {
  margin: 0;
}

.ycake-timeslot-options-body .inline-time-slots-inner {
  background: transparent;
  border-top: 0;
  padding: 0;
}

.ycake-timeslot-options-body .inline-lt-box {
  display: block;
  max-height: none;
}

.ycake-timeslot-options-body .listing-checks.inline-listing-checks {
  position: relative;
  width: 100% !important;
  border: 1px solid #eee;
  border-radius: 10px;
  margin-bottom: 10px;
}

/* Hide legacy radio markup (we draw our own indicator) */
.ycake-timeslot-options-body .listing-checks.inline-listing-checks .ot-radio,
.ycake-timeslot-options-body .listing-checks.inline-listing-checks .radio-col,
.ycake-timeslot-options-body .listing-checks.inline-listing-checks .checkmark {
  display: none !important;
}

body.ycake-inline-flow .ycake-timeslot-options-body .listing-checks.inline-listing-checks label {
  position: relative;
  padding: 12px 12px 12px 46px !important; /* room for indicator */
  border: 0;
  background: #fff !important;
  border-radius: 10px;
}

body.ycake-inline-flow .ycake-timeslot-options-body .listing-checks.inline-listing-checks label::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  border-radius: 999px;
  border: 2px solid #c9c9c9;
  background: #fff;
  box-sizing: border-box;
}

body.ycake-inline-flow .ycake-timeslot-options-body .listing-checks.inline-listing-checks label:hover {
  background: #f8f8f8;
  color: #222;
}

body.ycake-inline-flow .ycake-timeslot-options-body .listing-checks.inline-listing-checks.is-selected label {
  background: #fff7f0 !important;
  color: #111 !important;
}

body.ycake-inline-flow .ycake-timeslot-options-body .listing-checks.inline-listing-checks.is-selected {
  border-color: #ff6a2b !important;
}

body.ycake-inline-flow .ycake-timeslot-options-body .listing-checks.inline-listing-checks.is-selected label::before {
  border-color: #ff6a2b;
}

body.ycake-inline-flow .ycake-timeslot-options-body .listing-checks.inline-listing-checks.is-selected label::after {
  content: "";
  position: absolute;
  left: 21px; /* 16 + (20-10)/2 */
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #ff6a2b;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  .ycake-timeslot-layout {
    flex-direction: column;
  }
  .ycake-timeslot-methods,
  .ycake-timeslot-options {
    max-width: 100%;
    flex: 1 1 auto;
  }
}

/* Shipping options layout: make it feel like FnP's left method + right slots */
#delivery_date1 {
  display: block;
}

#delivery_date1 .date-listing-wrap {
  margin-bottom: 12px;
}

/* Addons section spacing */
#delivery_addon_products {
  display: block;
}

#delivery_addon_products .addon-products-wrapper {
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
}

/* Addon tabs (no scroll buttons) */
#delivery_addon_products .addon-category-tabs {
  display: flex;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
  background: #fff;
}

#delivery_addon_products .addon-category-tabs .tabs-wrapper {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
#delivery_addon_products .addon-category-tabs .tabs-wrapper::-webkit-scrollbar {
  display: none;
}

#delivery_addon_products .addon-category-tabs .cat-tab {
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 999px;
  font-size: 13px;
  color: #222;
  text-decoration: none;
  background: #fff;
  white-space: nowrap;
}
#delivery_addon_products .addon-category-tabs .cat-tab.active {
  border-color: #b81930;
  background: #fff7f8;
  color: #b81930;
  font-weight: 700;
}

/* Tab content */
#delivery_addon_products .addon-categories-container {
  padding: 12px;
  background: #fff;
}

#delivery_addon_products .addon-category-section {
  display: none;
}
#delivery_addon_products .addon-category-section.is-active {
  display: block;
}

/* Grid layout (no left/right row scrolling) */
#delivery_addon_products .products-grid-wrap {
  position: relative;
}

#delivery_addon_products .products-grid {
  display: grid;
  /* 2-row horizontal scroll like FnP */
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: 180px;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

/* Left/Right arrows */
#delivery_addon_products .grid-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  z-index: 5;
  font-size: 28px;
  line-height: 1;
  color: #333;
  cursor: pointer;
}

#delivery_addon_products .grid-scroll-btn.prev { left: -6px; }
#delivery_addon_products .grid-scroll-btn.next { right: -6px; }

#delivery_addon_products .grid-scroll-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

#delivery_addon_products .grid-scroll-btn.is-hidden {
  display: none;
}

/* Hide scrollbar but keep scroll */
#delivery_addon_products .products-grid::-webkit-scrollbar {
  height: 0;
}

@media (max-width: 767px) {
  #delivery_addon_products .products-grid {
    grid-auto-columns: 150px;
  }
  #delivery_addon_products .grid-scroll-btn {
    width: 40px;
    height: 40px;
    font-size: 26px;
  }
}

#delivery_addon_products .addon-product-card {
  scroll-snap-align: start;
}

/* FnP-like quantity controls for add-ons (inline flow) */
body.ycake-inline-flow #delivery_addon_products .addon-product-card .add-btn {
  width: 100%;
  border: 1px solid #b81930;
  color: #b81930;
  background: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

body.ycake-inline-flow #delivery_addon_products .addon-product-card.selected .add-btn {
  display: none;
}

body.ycake-inline-flow #delivery_addon_products .addon-product-card .addon-qty-controls {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(123, 127, 53, 0.55);
  border-radius: 10px;
  padding: 6px 8px;
  background: #fff;
}

body.ycake-inline-flow #delivery_addon_products .addon-product-card .addon-qty-controls button {
  border: 0;
  background: transparent;
  width: 34px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7b7f35;
  font-weight: 800;
  cursor: pointer;
}

body.ycake-inline-flow #delivery_addon_products .addon-product-card .addon-qty-controls button:hover {
  background: rgba(123, 127, 53, 0.10);
}

body.ycake-inline-flow #delivery_addon_products .addon-product-card .addon-qty-controls .qty-trash {
  color: #7b7f35;
}

body.ycake-inline-flow #delivery_addon_products .addon-product-card .addon-qty-controls .qty-trash i {
  font-size: 16px;
}

body.ycake-inline-flow #delivery_addon_products .addon-product-card .addon-qty-controls .qty-plus {
  font-size: 20px;
  line-height: 1;
}

body.ycake-inline-flow #delivery_addon_products .addon-product-card .addon-qty-controls .qty-value {
  min-width: 22px;
  text-align: center;
  font-weight: 800;
  color: #333;
}

/* Continue button full width */
#delivery_addon_products .addon-footer .continue-btn {
  width: 100%;
}

