/* Basildon Delivery storefront and public-site styles.
 * Loaded after assets/ui.css on pages using the storefront-page body class.
 */

/* Storefront Phase 6: foundational storefront imagery and special-menu presentation.
 * Split from mixed legacy rules without changing visual declarations.
 */

/* Storefront product and basket images. */
.shop-product-image,
.shop-item-main-image,
.shop-cart-line-image {
  overflow: hidden;
  border: 1px solid rgba(188, 204, 220, 0.72);
  background: #f8fbff;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.shop-product-image img,
.shop-item-main-image img,
.shop-cart-line-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-product-image.placeholder,
.shop-item-main-image.placeholder,
.shop-cart-line-image.placeholder {
  background: linear-gradient(135deg, #f8fbff 0%, #eef4fb 100%);
}

.shop-product-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
}

.shop-item-main-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  margin-bottom: 16px;
}

.shop-cart-line-image {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  font-size: 0.68rem;
}

.shop-cart-line-image.small {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

@media (max-width: 720px) {
  .shop-cart-line-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .shop-cart-line-image.small {
    width: 48px;
    height: 48px;
    aspect-ratio: 1 / 1;
  }
}

/* Storefront special menu/category promotion. */
.shop-special-menu-area {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
}

.shop-special-menu-section {
  padding: 18px;
  border-radius: 26px;
  background: linear-gradient(135deg, #fffdf5 0%, #fff7df 100%);
  border: 1px solid rgba(230, 176, 60, 0.38);
  box-shadow: 0 16px 34px rgba(91, 61, 9, 0.08);
}

.shop-special-menu-title {
  align-items: flex-start;
}

.shop-special-menu-title .page-kicker {
  margin-bottom: 3px;
}

.shop-special-menu-description {
  margin: -4px 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.shop-special-menu-cart-note {
  border-color: rgba(14, 116, 144, 0.22);
  background: linear-gradient(135deg, #ecfeff, #f8fbff);
}

.shop-special-menu-cart-note p {
  margin: 0;
}

/* Storefront Phase 5: order status, progress tracking, confirmation and active-order details.
 * Relocated from assets/ui.css without changing declarations or source order.
 */
.shop-status-hero,
.shop-confirmation-card {
  border: 1px solid rgba(188, 204, 220, 0.75);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
}

.shop-confirmation-card h1,
.shop-status-hero h1 {
  margin: 0;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.shop-status-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.shop-status-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: clamp(20px, 4vw, 30px);
  margin-bottom: 18px;
}

.shop-status-hero p { color: var(--muted); margin-bottom: 0; }

.shop-progress-steps {
  display: grid;
  gap: 9px;
}

.shop-progress-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #64748b;
}

.shop-progress-step strong {
  font-weight: 700;
}

.shop-progress-step .shop-progress-dot {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 3px solid #cbd5e1;
  background: #fff;
  flex-shrink: 0;
}

.shop-progress-step.is-complete {
  color: #166534;
}

.shop-progress-step.is-complete .shop-progress-dot {
  background: #22c55e;
  border-color: #16a34a;
  box-shadow: inset 0 0 0 4px #fff;
}

.shop-progress-step.is-complete .shop-progress-dot::after {
  content: "";
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.shop-progress-step.is-current {
  background: linear-gradient(90deg, #fff7e6 0%, #fffaf0 100%);
  border-color: #f0c66f;
  color: #78350f;
  box-shadow: 0 10px 24px rgba(173, 106, 0, 0.13);
}

.shop-progress-step.is-current strong {
  font-weight: 900;
}


.shop-progress-step.is-current .shop-progress-dot,
.shop-progress-step[aria-current="step"] .shop-progress-dot {
  background: radial-gradient(circle at 50% 50%, #fef3c7 0 22%, #f59e0b 24% 100%);
  border-color: #d97706;
  box-shadow: 0 0 0 5px #fef3c7, 0 0 0 0 rgba(245, 158, 11, 0.34);
  transform-origin: center;
  will-change: transform, box-shadow;
  animation: shop-current-dot-pulse 1.25s ease-in-out infinite;
}

.shop-progress-step.is-current .shop-progress-dot::before,
.shop-progress-step[aria-current="step"] .shop-progress-dot::before {
  content: "";
  position: absolute;
  inset: -11px;
  border-radius: 999px;
  border: 3px solid rgba(245, 158, 11, 0.46);
  opacity: 0;
  transform-origin: center;
  pointer-events: none;
  animation: shop-current-dot-radar 1.25s ease-out infinite;
}

.shop-progress-step.is-current .shop-progress-dot::after,
.shop-progress-step[aria-current="step"] .shop-progress-dot::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 0 10px rgba(255, 255, 255, 0.65);
  transform-origin: center;
  animation: shop-current-dot-core-pop 1.25s ease-in-out infinite;
}

@keyframes shop-current-dot-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 5px #fef3c7, 0 0 0 0 rgba(245, 158, 11, 0.34);
  }
  45% {
    transform: scale(1.16);
    box-shadow: 0 0 0 6px #fef3c7, 0 0 0 12px rgba(245, 158, 11, 0.16);
  }
}

@keyframes shop-current-dot-radar {
  0% {
    transform: scale(0.62);
    opacity: 0.72;
  }
  78%, 100% {
    transform: scale(1.42);
    opacity: 0;
  }
}

@keyframes shop-current-dot-core-pop {
  0%, 100% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.62);
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop-progress-step.is-current .shop-progress-dot,
  .shop-progress-step[aria-current="step"] .shop-progress-dot,
  .shop-progress-step.is-current .shop-progress-dot::before,
  .shop-progress-step[aria-current="step"] .shop-progress-dot::before,
  .shop-progress-step.is-current .shop-progress-dot::after,
  .shop-progress-step[aria-current="step"] .shop-progress-dot::after {
    animation: none;
  }

  .shop-progress-step.is-current .shop-progress-dot,
  .shop-progress-step[aria-current="step"] .shop-progress-dot {
    box-shadow: 0 0 0 6px #fef3c7, 0 0 0 10px rgba(245, 158, 11, 0.16);
  }
}

.shop-progress-step.is-upcoming {
  color: #64748b;
}

.shop-confirmation-card {
  max-width: 760px;
  margin: 40px auto;
  padding: clamp(26px, 5vw, 46px);
  text-align: center;
}

.shop-confirmation-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 2.4rem;
  font-weight: 900;
}

@media (max-width: 760px) {
  .shop-status-hero {
    flex-direction: column;
  }
}

.rider-route-position {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(24, 111, 175, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}
.rider-route-position-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rider-route-position strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.25;
}
.rider-route-position p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

/* Patch 32: storefront current order sidebar card */
.shop-current-order-panel {
  display: grid;
  gap: 12px;
}

.shop-current-order-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.shop-current-order-head h2 {
  margin: 0;
}

.shop-current-order-status-card {
  display: grid;
  gap: 8px;
}

.shop-current-order-step {
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  padding: 10px 12px;
}

.shop-current-order-step span:not(.shop-progress-dot) {
  display: block;
  color: #92400e;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shop-current-order-step strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
  line-height: 1.2;
}

.shop-current-order-note {
  margin: 0;
}

.shop-current-order-button {
  width: 100%;
}


/* Storefront Phase 4: checkout choices, delivery slots, rider tips and pending-payment recovery.
 * Relocated from assets/ui.css without changing declarations or internal source order.
 */
.customer-order-payment-note {
  display: inline-block;
  margin-top: 8px !important;
  padding: 8px 11px;
  border-radius: 14px;
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 800;
}

.customer-cancel-pending-payment-form {
  margin: 0;
}

.customer-pending-payment-cancel {
  align-items: flex-start;
}

.shop-checkout-items {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.shop-checkout-item-line {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.shop-checkout-item-line strong,
.shop-checkout-item-line span {
  display: block;
}

.shop-checkout-item-line span {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 850;
}

.order-confirmation-items {
  max-width: 920px;
  margin: 18px auto 0;
}

.shop-current-order-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-color: rgba(24, 111, 175, 0.28);
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.shop-current-order-banner h2 {
  margin: 2px 0 6px;
  font-size: clamp(1.1rem, 2.2vw, 1.55rem);
  letter-spacing: -0.03em;
}

.shop-current-order-banner p:not(.page-kicker) {
  color: var(--muted);
}

@media (max-width: 640px) {
  .shop-current-order-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .shop-current-order-banner .button {
    width: 100%;
  }
}

.shop-substitution-summary {
  margin: 10px 0 18px;
  line-height: 1.45;
}

.shop-substitution-summary a {
  font-weight: 850;
}

.shop-payment-methods {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.shop-payment-methods[hidden],
.shop-delivery-slots[hidden],
[data-delivery-slot-section][hidden] {
    display: none !important;
}


.shop-payment-methods h2 {
    margin: 0;
    font-size: 1.05rem;
}

.shop-payment-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
}

.shop-payment-option input {
    width: auto;
    flex: 0 0 auto;
    margin-top: 3px;
}

.shop-payment-option span {
    display: grid;
    gap: 3px;
}

.shop-payment-option small {
    color: var(--muted);
}

.shop-fulfilment-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

.shop-fulfilment-option-grid .shop-payment-option {
    height: 100%;
    margin: 0;
}

.shop-payment-option:has(input:checked) {
    border-color: rgba(26, 115, 232, 0.42);
    background: #f3f9ff;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.08);
}

.shop-payment-option.rush-option {
  border-color: rgba(217, 119, 6, 0.24);
  background: #fffaf2;
}

.shop-payment-option.rush-option:has(input:checked) {
  border-color: rgba(217, 119, 6, 0.42);
  background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.10);
}

.shop-slot-option small {
  display: block;
  margin-top: 3px;
}

.shop-slot-option input[type="radio"] {
  align-self: flex-start;
  margin-top: 4px;
}

/* Compact checkout delivery slot rows */
.shop-slot-day-list {
  display: grid;
  gap: 10px;
}

.shop-slot-day-row {
  display: grid;
  grid-template-columns: minmax(88px, 120px) 1fr;
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.shop-slot-day-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #eef6ff;
  color: var(--accent-dark);
  font-weight: 950;
  line-height: 1.1;
  text-align: center;
}

.shop-slot-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.shop-slot-chip {
  cursor: pointer;
}

.shop-slot-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.shop-slot-chip span {
  display: grid;
  gap: 2px;
  min-width: 116px;
  height: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 0 rgba(16, 42, 67, 0.04);
}

.shop-slot-chip strong {
  font-size: 0.94rem;
  line-height: 1.1;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.shop-slot-chip small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.15;
  white-space: nowrap;
}

.shop-slot-chip input[type="radio"]:checked + span {
  border-color: rgba(26, 115, 232, 0.48);
  background: #e8f3ff;
  color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.shop-slot-chip input[type="radio"]:focus-visible + span {
  outline: 3px solid rgba(26, 115, 232, 0.28);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .shop-fulfilment-option-grid {
    grid-template-columns: 1fr;
  }

  .shop-slot-day-row {
    grid-template-columns: 1fr;
  }

  .shop-slot-day-label {
    justify-content: flex-start;
    min-height: unset;
  }

  .shop-slot-chip-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-slot-chip span {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .shop-slot-chip-list {
    grid-template-columns: 1fr;
  }
}

/* Checkout rider tips */
.shop-tip-section {
  gap: 12px;
}

.shop-tip-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.shop-tip-chip {
  cursor: pointer;
}

.shop-tip-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.shop-tip-chip span {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-weight: 900;
  text-align: center;
  box-shadow: 0 1px 0 rgba(16, 42, 67, 0.04);
}

.shop-tip-chip small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.78rem;
}

.shop-tip-chip input[type="radio"]:checked + span {
  border-color: rgba(25, 135, 84, 0.42);
  background: #ecfdf3;
  color: #0f6b3d;
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.10);
}

.shop-tip-chip input[type="radio"]:focus-visible + span {
  outline: 3px solid rgba(25, 135, 84, 0.24);
  outline-offset: 2px;
}

.shop-custom-tip-row[hidden] {
  display: none !important;
}

.shop-custom-tip-row {
  max-width: 240px;
}

@media (max-width: 760px) {
  .shop-tip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .shop-tip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-tip-chip span {
    min-height: 46px;
    padding: 9px 8px;
  }
}

/* Storefront Phase 3: shop hero, catalogue navigation, product cards, option previews and branded-domain storefront details.
 * Relocated from assets/ui.css without changing declarations or source order.
 */
/* Patch 18: compact, AJAX-friendly public storefront browsing */
.shop-hero-pro.shop-hero-compact {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 16px;
  padding: clamp(16px, 2.4vw, 24px);
  margin-bottom: 14px;
  border-radius: 24px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

.shop-hero-pro.shop-hero-compact::after {
  width: 190px;
  height: 190px;
  right: -70px;
  top: -80px;
}

.shop-hero-pro.shop-hero-compact .shop-hero-title-row {
  align-items: center;
  gap: 13px;
}

.shop-hero-pro.shop-hero-compact .shop-hero-logo {
  width: 58px;
  height: 58px;
  border-radius: 17px;
}

.shop-hero-pro.shop-hero-compact .shop-hero-copy h1 {
  font-size: clamp(1.65rem, 3.8vw, 2.9rem);
  letter-spacing: -0.04em;
}

.shop-hero-pro.shop-hero-compact .shop-hero-strapline {
  margin: 10px 0 0;
  max-width: 58ch;
  font-size: 0.98rem;
  line-height: 1.45;
}

.shop-hero-pro.shop-hero-compact .shop-hero-actions {
  margin-top: 12px;
}

.shop-hero-pro.shop-hero-compact .shop-hero-card {
  align-self: stretch;
  gap: 11px;
  padding: 14px;
  border-radius: 18px;
  box-shadow: none;
}

.shop-hero-pro.shop-hero-compact .shop-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.shop-hero-pro.shop-hero-compact .shop-summary-grid div {
  padding: 10px 11px;
  border-radius: 13px;
}

.shop-hero-pro.shop-hero-compact .shop-summary-grid span {
  font-size: 0.76rem;
}

.shop-hero-pro.shop-hero-compact .shop-summary-grid strong {
  font-size: 0.94rem;
}

.shop-catalogue-layout[data-shop-catalogue] {
  transition: opacity .16s ease, filter .16s ease;
}

.shop-catalogue-layout[data-shop-catalogue].is-updating {
  opacity: .66;
  filter: saturate(.88);
  pointer-events: none;
}

.shop-panel.shop-categories-panel {
  padding: 14px;
}

.shop-category-list {
  gap: 7px;
}

.shop-category-link {
  padding: 9px 11px;
  border-radius: 12px;
  line-height: 1.2;
}

.shop-product-area[data-shop-product-area] {
  min-height: 260px;
}

.shop-product-section + .shop-product-section {
  margin-top: 16px;
}

.shop-product-section-title {
  margin-bottom: 10px;
}

.shop-product-grid {
  gap: 12px;
}

.shop-product-card {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px 13px;
  align-items: start;
  padding: 13px;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.055);
}

.shop-product-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.09);
}

.shop-product-card .shop-product-image {
  grid-row: 1 / span 4;
  width: 112px;
  aspect-ratio: 1 / 1;
  border-radius: 15px;
}

.shop-product-card .shop-product-card-top,
.shop-product-card .shop-product-badges,
.shop-product-card .shop-product-actions,
.shop-product-card .shop-product-description {
  grid-column: 2;
}

.shop-product-card-top {
  gap: 9px;
  align-items: flex-start;
}

.shop-product-card h3 {
  font-size: 1.02rem;
  line-height: 1.18;
}

.shop-product-card-top p {
  margin-top: 3px;
  font-size: 0.82rem;
  line-height: 1.25;
}

.shop-product-card .price-tag {
  padding: 6px 9px;
  font-size: 0.85rem;
}

.shop-product-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
  font-size: 0.91rem;
  line-height: 1.38;
}

.shop-product-badges {
  gap: 6px;
}

.shop-product-badges .badge,
.shop-product-badges .chip {
  padding: 5px 8px;
  font-size: 0.76rem;
}

.shop-product-badges .shop-limit-chip {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.18);
  color: #1d4ed8;
}

.shop-product-actions {
  margin-top: 1px;
  align-items: center;
}

.shop-product-actions .button {
  min-height: 40px;
  padding: 9px 13px;
}

.shop-product-actions .shop-text-link {
  font-size: 0.88rem;
}

/* Patch 18I: product card basket quantity and remove button */
.shop-product-basket-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  grid-column: 2;
  margin-top: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 12px;
  background: rgba(20, 184, 166, 0.08);
}

.shop-product-basket-state[hidden] {
  display: none !important;
}

.shop-product-basket-count {
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
}

.shop-product-basket-state .button.mini {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 10px;
  font-size: 0.76rem;
  line-height: 1.1;
}

.shop-product-card.has-basket-items {
  border-color: rgba(20, 184, 166, 0.28);
}

@media (max-width: 980px) {
  .shop-hero-pro.shop-hero-compact {
    grid-template-columns: 1fr;
  }

  .shop-panel.shop-categories-panel {
    padding: 12px;
  }

  .shop-category-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .shop-category-link {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .shop-hero-pro.shop-hero-compact {
    padding: 14px;
    border-radius: 20px;
  }

  .shop-hero-pro.shop-hero-compact .shop-hero-title-row {
    flex-direction: row;
    align-items: center;
  }

  .shop-hero-pro.shop-hero-compact .shop-hero-logo {
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  .shop-hero-pro.shop-hero-compact .shop-hero-copy h1 {
    font-size: clamp(1.45rem, 8vw, 2.25rem);
  }

  .shop-hero-pro.shop-hero-compact .shop-hero-strapline {
    font-size: 0.93rem;
  }

  .shop-hero-pro.shop-hero-compact .shop-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-product-grid {
    gap: 10px;
  }

  .shop-product-card {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 11px;
    border-radius: 16px;
  }

  .shop-product-card .shop-product-image {
    width: 84px;
    border-radius: 13px;
  }

  .shop-product-card-top {
    flex-direction: row;
    align-items: flex-start;
  }

  .shop-product-card h3 {
    font-size: 0.98rem;
  }

  .shop-product-description {
    -webkit-line-clamp: 1;
    font-size: 0.86rem;
  }

  .shop-product-actions {
    flex-direction: row;
  }

  .shop-product-actions .button {
    min-height: 38px;
    padding: 8px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop-catalogue-layout[data-shop-catalogue],
  .shop-product-card {
    transition: none;
  }
}

/* Patch 18A: two-column compact product cards on phone-width storefronts */
@media (max-width: 640px) {
  .shop-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .shop-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    padding: 8px;
    border-radius: 16px;
  }

  .shop-product-card .shop-product-image {
    grid-row: auto;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
  }

  .shop-product-card .shop-product-image.placeholder span {
    font-size: 0.82rem;
  }

  .shop-product-card .shop-product-card-top,
  .shop-product-card .shop-product-badges,
  .shop-product-card .shop-product-actions,
  .shop-product-card .shop-product-description {
    grid-column: auto;
  }

  .shop-product-card-top {
    display: block;
    min-width: 0;
  }

  .shop-product-card-top > div {
    min-width: 0;
  }

  .shop-product-card h3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 0.9rem;
    line-height: 1.16;
  }

  .shop-product-card-top p {
    overflow: hidden;
    margin-top: 3px;
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .shop-product-card .price-tag {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    padding: 5px 7px;
    font-size: 0.75rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  }

  .shop-product-description {
    -webkit-line-clamp: 2;
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .shop-product-description.muted {
    display: none;
  }

  .shop-product-badges {
    gap: 4px;
  }

  .shop-product-badges .badge,
  .shop-product-badges .chip {
    max-width: 100%;
    padding: 4px 6px;
    font-size: 0.68rem;
    line-height: 1.15;
  }

  .shop-product-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-top: auto;
  }

  .shop-product-actions .shop-text-link {
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .shop-product-actions .inline-form {
    width: 100%;
  }

  .shop-product-actions .button {
    width: 100%;
    min-height: 36px;
    padding: 7px 8px;
    border-radius: 12px;
    font-size: 0.86rem;
  }

  .shop-product-basket-state {
    width: 100%;
    padding: 6px 7px;
    gap: 6px;
  }

  .shop-product-basket-count {
    font-size: 0.72rem;
  }

  .shop-product-basket-state .button.mini {
    min-height: 28px;
    padding: 5px 7px;
    font-size: 0.7rem;
  }
}

@media (max-width: 340px) {
  .shop-product-grid {
    grid-template-columns: 1fr;
  }
}

/* Patch 18B: move storefront hero information into the sidebar */
.shop-info-panel {
  overflow: hidden;
}

.shop-sidebar-summary {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(188, 204, 220, 0.72);
}

.shop-sidebar-summary-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.shop-sidebar-logo {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.shop-sidebar-summary-head h3 {
  margin: 2px 0 5px;
  font-size: 1.02rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.shop-sidebar-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.shop-sidebar-status-row .badge,
.shop-sidebar-status-row .chip {
  padding: 4px 7px;
  font-size: 0.72rem;
  line-height: 1.1;
}

.shop-sidebar-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.shop-sidebar-summary-grid div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(188, 204, 220, 0.68);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.86);
}

.shop-sidebar-summary-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shop-sidebar-summary-grid strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-sidebar-actions {
  display: grid;
  gap: 7px;
}

.shop-sidebar-actions .button {
  width: 100%;
  min-height: 38px;
  justify-content: center;
  padding: 8px 11px;
  border-radius: 13px;
  font-size: 0.9rem;
}

.shop-sidebar-order-note {
  padding: 9px 10px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 13px;
  background: rgba(224, 242, 241, 0.58);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.35;
}

.shop-sidebar-order-note p {
  margin: 0;
}

.shop-sidebar-order-note p + p {
  margin-top: 5px;
}

.shop-sidebar-phone {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .shop-sidebar-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shop-info-panel ul,
  .shop-ordering-info-text {
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .shop-sidebar-summary {
    gap: 9px;
    margin-top: 12px;
    padding-top: 12px;
  }

  .shop-sidebar-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-sidebar-order-note,
  .shop-sidebar-phone {
    font-size: 0.78rem;
  }
}

.shop-sidebar-logo.has-image {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(188, 204, 220, 0.9);
  color: transparent;
}

.shop-sidebar-logo.has-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-sizing: border-box;
  padding: 4px;
}

/* Patch 18C: three-column product cards on roomy desktop storefronts */
@media (min-width: 1180px) {
  .shop-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .shop-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
    padding: 11px;
    border-radius: 18px;
  }

  .shop-product-card .shop-product-image {
    grid-row: auto;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
  }

  .shop-product-card .shop-product-card-top,
  .shop-product-card .shop-product-badges,
  .shop-product-card .shop-product-actions,
  .shop-product-card .shop-product-description {
    grid-column: auto;
  }

  .shop-product-card-top {
    display: block;
    min-width: 0;
  }

  .shop-product-card-top > div {
    min-width: 0;
  }

  .shop-product-card h3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 0.98rem;
    line-height: 1.16;
  }

  .shop-product-card-top p {
    overflow: hidden;
    margin-top: 4px;
    font-size: 0.78rem;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .shop-product-card .price-tag {
    position: absolute;
    z-index: 2;
    top: 16px;
    right: 16px;
    padding: 5px 8px;
    font-size: 0.8rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  }

  .shop-product-description {
    -webkit-line-clamp: 2;
    font-size: 0.84rem;
    line-height: 1.28;
  }

  .shop-product-description.muted {
    display: none;
  }

  .shop-product-badges {
    gap: 5px;
  }

  .shop-product-badges .badge,
  .shop-product-badges .chip {
    max-width: 100%;
    padding: 4px 7px;
    font-size: 0.72rem;
    line-height: 1.15;
  }

  .shop-product-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    margin-top: auto;
  }

  .shop-product-actions .shop-text-link {
    font-size: 0.82rem;
    line-height: 1.2;
  }

  .shop-product-actions .inline-form {
    width: 100%;
  }

  .shop-product-actions .button {
    width: 100%;
    min-height: 38px;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 13px;
    font-size: 0.9rem;
  }
}

/* Patch 18E: compact expandable option previews on storefront cards */
.shop-product-option-preview-list {
  display: grid;
  gap: 6px;
}

.shop-product-card .shop-product-option-preview-list {
  grid-column: 2;
}

.shop-product-option-preview {
  border: 1px solid rgba(188, 204, 220, 0.78);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.86);
  overflow: hidden;
}

.shop-product-option-preview summary {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 28px 7px 9px;
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--text);
}

.shop-product-option-preview summary::-webkit-details-marker {
  display: none;
}

.shop-product-option-preview summary::after {
  content: '›';
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 900;
  transform: translateY(-50%);
  transition: transform .14s ease;
}

.shop-product-option-preview[open] summary::after {
  transform: translateY(-50%) rotate(90deg);
}

.shop-product-option-preview summary small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-transform: none;
}

.shop-product-option-preview summary small.has-selection {
  color: #075985;
}

.shop-product-option-preview-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 9px 8px;
}

.shop-product-option-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(224, 242, 254, 0.82);
  color: #075985;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.15;
}

.shop-product-option-preview-chip em {
  color: #0f172a;
  font-style: normal;
}

.shop-product-option-preview-chip.is-muted {
  background: rgba(226, 232, 240, 0.85);
  color: var(--muted);
}

@media (max-width: 640px), (min-width: 1180px) {
  .shop-product-card .shop-product-option-preview-list {
    grid-column: auto;
  }

  .shop-product-option-preview-list {
    gap: 5px;
  }

  .shop-product-option-preview summary {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 6px 24px 6px 8px;
    font-size: 0.76rem;
  }

  .shop-product-option-preview summary small {
    font-size: 0.62rem;
  }

  .shop-product-option-preview-options {
    gap: 4px;
    padding: 0 8px 7px;
  }

  .shop-product-option-preview-chip {
    padding: 3px 6px;
    font-size: 0.66rem;
  }
}

/* Patch 18F: selectable option previews on storefront product cards */
.shop-product-config-form {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.shop-product-card .shop-product-config-form {
  grid-column: 2;
}

.shop-product-option-preview-options.is-selectable {
  display: grid;
  gap: 5px;
  padding: 0 8px 8px;
}

.shop-product-option-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(188, 204, 220, 0.82);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.2;
}

.shop-product-option-choice:hover {
  border-color: rgba(14, 116, 144, 0.28);
  background: rgba(240, 249, 255, 0.92);
}

.shop-product-option-choice input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.shop-product-option-choice span {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-product-option-choice em {
  color: #0f172a;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.shop-product-option-choice:has(input:checked) {
  border-color: rgba(14, 116, 144, 0.38);
  background: rgba(224, 242, 254, 0.92);
  box-shadow: inset 0 0 0 1px rgba(14, 116, 144, 0.12);
}

.shop-product-option-preview.is-incomplete {
  border-color: rgba(245, 158, 11, 0.65);
}

.shop-product-option-preview.is-over-limit {
  border-color: rgba(220, 38, 38, 0.65);
}

.shop-product-option-empty {
  margin: 0;
  padding: 0 9px 8px;
  font-size: 0.76rem;
}

.shop-product-config-form .shop-product-actions {
  margin-top: 0;
}

.shop-product-config-form [data-option-add-button]:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

@media (max-width: 640px), (min-width: 1180px) {
  .shop-product-card .shop-product-config-form {
    grid-column: auto;
  }

  .shop-product-config-form {
    gap: 6px;
  }

  .shop-product-option-choice {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    padding: 5px 6px;
    font-size: 0.7rem;
  }

  .shop-product-option-choice em {
    grid-column: 2;
    margin-top: -3px;
    color: var(--muted);
    font-size: 0.66rem;
  }
}

/* Patch 18J: put decrement control next to Add, not inside basket count */
.shop-product-action-controls {
  display: inline-flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.shop-product-action-controls .inline-form {
  display: flex;
}

.shop-product-action-controls .button.primary,
.shop-product-action-controls .inline-form .button.primary {
  flex: 1 1 auto;
}

.shop-product-minus-button {
  flex: 0 0 auto;
  min-width: 0;
  width: auto;
  padding-inline: 18px;
  font-weight: 950;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(23, 114, 179, 0.18);
}

.shop-product-minus-button:hover,
.shop-product-minus-button:focus-visible {
  background: #125985;
  border-color: #125985;
  color: #fff;
}

.shop-product-minus-button[hidden],
.shop-product-basket-remove-form {
  display: none !important;
}

.shop-product-basket-state {
  justify-content: flex-start;
}

@media (max-width: 980px) {
  .shop-product-action-controls {
    width: 100%;
  }

  .shop-product-action-controls .inline-form {
    flex: 1 1 auto;
    width: auto;
  }

  .shop-product-action-controls .button.primary,
  .shop-product-action-controls .inline-form .button.primary {
    width: 100%;
  }

  .shop-product-action-controls .shop-product-minus-button {
    width: auto;
    min-width: 0;
    padding-inline: 18px;
  }
}

/* Patch 18M: keep basket count above controls and make -1 visibly primary */
.shop-product-card .shop-product-basket-state {
  grid-column: 2;
  align-self: start;
  width: fit-content;
  max-width: 100%;
  margin-top: 0;
  margin-bottom: 2px;
}

.shop-product-config-form > .shop-product-basket-state {
  grid-column: auto;
}

.shop-product-action-controls .button.shop-product-minus-button,
.shop-product-action-controls button.shop-product-minus-button {
  flex: 0 0 auto;
  min-width: 54px;
  min-height: 40px;
  padding: 9px 13px;
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  font-weight: 950;
  opacity: 1;
}

.shop-product-action-controls .button.shop-product-minus-button:hover,
.shop-product-action-controls button.shop-product-minus-button:hover,
.shop-product-action-controls .button.shop-product-minus-button:focus-visible,
.shop-product-action-controls button.shop-product-minus-button:focus-visible {
  background: #125985 !important;
  border-color: #125985 !important;
  color: #fff !important;
}

@media (max-width: 640px), (min-width: 1180px) {
  .shop-product-card .shop-product-basket-state {
    grid-column: auto;
    width: fit-content;
    margin-top: 0;
  }
}

/* Patch 26D: make shop branding primary on active custom domains */
.custom-domain-shop-nav {
  gap: 16px;
}

.custom-domain-primary-shop-brand {
  flex: 1 1 320px;
  max-width: 520px;
}

.custom-domain-primary-shop-brand strong {
  max-width: 360px;
  font-size: 1.32rem;
  letter-spacing: -0.02em;
}

.custom-domain-primary-shop-brand small {
  color: #407233;
  font-size: 0.82rem;
}

.shop-brand-shop-logo {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 18px;
  background: #e9f6e4;
  color: #2f7d32;
  box-shadow: inset 0 0 0 1px rgba(47, 125, 50, 0.12);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.shop-brand-shop-logo.has-image {
  background: #fff;
}

.shop-brand-shop-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.shop-nav-platform-context {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 9px 5px 5px;
  border: 1px solid rgba(188, 204, 220, 0.68);
  border-radius: 999px;
  background: rgba(248, 251, 255, 0.76);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.shop-nav-platform-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  object-fit: contain;
}

.shop-nav-platform-context small,
.shop-nav-platform-context strong {
  display: block;
  line-height: 1.05;
}

.shop-nav-platform-context small {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.shop-nav-platform-context strong {
  margin-top: 1px;
  color: var(--text);
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .custom-domain-shop-nav {
    gap: 10px;
  }

  .custom-domain-primary-shop-brand {
    flex: 0 1 auto;
    max-width: none;
    width: 100%;
  }

  .custom-domain-primary-shop-brand strong {
    max-width: min(420px, 72vw);
    font-size: 1.16rem;
  }

  .shop-brand-shop-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .shop-nav-platform-context {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
}

/* Patch 26F: shop-branded support page on custom/shop-context URLs */
.shop-branded-support-page .support-hero {
  background:
    radial-gradient(circle at 88% 0%, rgba(93, 173, 79, 0.18), transparent 16rem),
    rgba(255, 255, 255, 0.96);
}

.shop-branded-support-page .support-hero h1 {
  max-width: 16ch;
}

.shop-branded-support-page .support-form-card input[readonly] {
  background: rgba(241, 245, 249, 0.9);
  color: #334155;
  cursor: default;
}

/* Patch 26H: keep storefront product basket state and add/remove controls inside cards */
.shop-product-card[data-shop-product-card] .shop-product-basket-state {
  grid-column: 1 / -1;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0 0 2px;
  justify-content: center;
}

.shop-product-card[data-shop-product-card] .shop-product-basket-count {
  display: block;
  width: 100%;
  text-align: center;
  white-space: nowrap;
}

.shop-product-card[data-shop-product-card] .shop-product-config-form > .shop-product-basket-state {
  grid-column: 1 / -1;
}

.shop-product-card[data-shop-product-card] .shop-product-actions {
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  gap: 7px;
}

.shop-product-card[data-shop-product-card] .shop-product-actions .shop-text-link {
  align-self: flex-start;
}

.shop-product-card[data-shop-product-card] .shop-product-action-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 8px;
}

.shop-product-card[data-shop-product-card] .shop-product-action-controls .inline-form {
  display: flex;
  width: 100%;
  min-width: 0;
}

.shop-product-card[data-shop-product-card] .shop-product-action-controls .button.primary,
.shop-product-card[data-shop-product-card] .shop-product-action-controls .inline-form .button.primary {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.shop-product-card[data-shop-product-card] .shop-product-action-controls .shop-product-minus-button {
  width: auto;
  min-width: 54px;
  max-width: 70px;
  padding-inline: 12px;
}

/* Patch 26I: keep configurable product options full-width and above basket controls */
.shop-product-card[data-shop-product-card] .shop-product-config-form {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-self: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.shop-product-card[data-shop-product-card] .shop-product-config-form > .shop-product-option-preview-list {
  grid-column: 1 / -1;
  order: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-self: stretch;
}

.shop-product-card[data-shop-product-card] .shop-product-config-form > .shop-product-basket-state {
  order: 2;
}

.shop-product-card[data-shop-product-card] .shop-product-config-form > .shop-product-actions {
  order: 3;
}

.shop-product-card[data-shop-product-card] .shop-product-option-preview {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.shop-product-card[data-shop-product-card] .shop-product-option-preview summary {
  text-align: left;
}

.shop-product-card[data-shop-product-card] .shop-product-option-preview-options.is-selectable {
  width: 100%;
  box-sizing: border-box;
}

/* Patch 27A: reserve product basket badge space to prevent card control jump */
.shop-product-card[data-shop-product-card] .shop-product-basket-state[hidden] {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}

.shop-product-card[data-shop-product-card] .shop-product-basket-state[hidden] .shop-product-basket-count {
  visibility: hidden;
}

/* Storefront Phase 2: basket, cart summary and customer ordering information.
 * Relocated from assets/ui.css without changing declarations or source order.
 */
/* Patch 27: cart UX and validation polish */
.shop-cart-line-polished {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(220px, auto);
  align-items: center;
}

.shop-cart-options {
  display: grid;
  gap: 6px;
  margin: 8px 0 6px;
}

.shop-cart-options div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: baseline;
}

.shop-cart-options dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.shop-cart-options dd {
  margin: 0;
  color: var(--text);
  font-weight: 850;
}

.shop-cart-line-controls {
  display: grid;
  gap: 10px;
  justify-items: end;
  align-content: center;
}

.shop-cart-line-controls .shop-cart-line-total {
  display: grid;
  gap: 2px;
  text-align: right;
}

.shop-cart-line-controls .shop-cart-line-total span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shop-cart-line-controls .shop-cart-line-total strong {
  color: var(--text);
  font-size: 1.15rem;
}

.shop-qty-stepper {
  display: inline-grid;
  grid-template-columns: 44px 72px 44px;
  gap: 8px;
  align-items: end;
}

.shop-qty-stepper .shop-qty-control {
  width: auto;
  gap: 4px;
}

.shop-qty-stepper .shop-qty-control span {
  text-align: center;
  font-size: 0.76rem;
}

.shop-qty-stepper input {
  min-height: 42px;
}

.shop-qty-button {
  min-width: 44px;
  min-height: 42px;
  padding: 8px 10px;
  line-height: 1;
  font-size: 1.2rem;
}

.shop-remove-line-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--danger);
  padding: 0;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
}

.shop-remove-line-button:hover {
  text-decoration: underline;
}

.shop-cart-form-actions {
  justify-content: space-between;
  margin-top: 4px;
}

.shop-cart-check {
  display: grid;
  gap: 8px;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 18px;
  border: 1px solid rgba(188, 204, 220, 0.85);
  background: linear-gradient(135deg, #f8fbff, #ffffff);
}

.shop-cart-check.is-ready {
  border-color: rgba(22, 163, 74, 0.28);
  background: linear-gradient(135deg, #ecfdf3, #ffffff);
}

.shop-cart-check.has-warnings {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, #fff7ed, #ffffff);
}

.shop-cart-check h3,
.shop-cart-check p,
.shop-cart-check ul {
  margin: 0;
}

.shop-cart-check ul {
  padding-left: 1.1rem;
  color: var(--text);
  line-height: 1.5;
}

.shop-cart-check-notes {
  color: var(--muted) !important;
}

.shop-summary-aside .shop-total-list + .button.full-width {
  margin-top: 24px;
}

.shop-summary-aside .button.full-width + .button.full-width {
  margin-top: 12px;
}

.shop-summary-continue {
  margin-top: 10px;
}

.shop-mobile-checkout-bar {
  display: none;
}

@media (max-width: 760px) {
  .shop-cart-line-polished {
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: start;
  }

  .shop-cart-line-polished .shop-cart-line-controls {
    grid-column: 1 / -1;
    justify-items: stretch;
    width: 100%;
  }

  .shop-cart-line-controls .shop-cart-line-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .shop-qty-stepper {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    width: 100%;
  }

  .shop-cart-form-actions {
    align-items: stretch;
  }

  .shop-cart-form-actions .button {
    width: 100%;
  }

  .shop-mobile-checkout-bar {
    position: sticky;
    bottom: 10px;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 18px 0 0;
    padding: 12px;
    border: 1px solid rgba(188, 204, 220, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(12px);
  }

  .shop-mobile-checkout-bar span,
  .shop-mobile-checkout-bar strong {
    display: block;
  }

  .shop-mobile-checkout-bar span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .shop-mobile-checkout-bar strong {
    color: var(--text);
    font-size: 1.08rem;
  }

  .shop-mobile-checkout-bar .button {
    margin-top: 0;
    white-space: nowrap;
  }
}

@media (max-width: 430px) {
  .shop-cart-line-polished {
    grid-template-columns: 1fr;
  }

  .shop-cart-line-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

/* Patch 35R: cart empty-state and summary polish */
.shop-empty-basket {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 20px;
}

.shop-empty-basket-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.12), rgba(22, 163, 74, 0.12));
  border: 1px solid rgba(14, 116, 144, 0.16);
  font-size: 2rem;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.shop-empty-basket h2,
.shop-empty-basket p {
  margin: 0;
}

.shop-empty-basket p {
  max-width: 560px;
}

.shop-empty-basket .button.shop-empty-basket-action {
  margin-top: 8px;
}

.shop-empty-summary {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  padding: 28px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.92), rgba(255, 255, 255, 0.96));
  border: 1px dashed rgba(71, 85, 105, 0.26);
}

.shop-empty-summary-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: #eaf5fb;
  color: var(--primary);
  font-weight: 950;
  font-size: 1.35rem;
}

.shop-empty-summary h3,
.shop-empty-summary p {
  margin: 0;
}

.shop-empty-summary p {
  color: var(--muted);
  line-height: 1.45;
}

.shop-total-list-polished {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.72);
}

.shop-total-list-polished div {
  padding-inline: 12px;
}

.shop-total-list-polished span small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.shop-total-list-polished .shop-total-grand {
  margin-top: 0;
  padding: 18px 12px;
  background: linear-gradient(135deg, rgba(13, 110, 168, 0.10), rgba(22, 163, 74, 0.10));
  border-top: 1px solid rgba(13, 110, 168, 0.16);
  font-size: 1.18rem;
}

.shop-total-list-polished .shop-total-grand span,
.shop-total-list-polished .shop-total-grand strong {
  color: var(--ink);
}

.shop-summary-aside .shop-total-list-polished + .button.full-width,
.shop-summary-aside .shop-total-list-polished + .shop-summary-checkout {
  margin-top: 22px;
}

.shop-checkout-confidence {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.shop-checkout-confidence + .button.full-width {
  margin-top: 12px;
}

@media (max-width: 720px) {
  .shop-empty-basket {
    padding: 36px 14px;
  }

  .shop-empty-summary {
    padding: 22px 14px;
  }
}


/* Patch 35S: give the cart summary actions breathing room. */
.shop-summary-actions {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding-bottom: 8px;
}

.shop-summary-actions .button.full-width,
.shop-summary-actions .shop-summary-checkout,
.shop-summary-actions .shop-summary-continue {
  margin-top: 0;
}

.shop-summary-actions .shop-summary-checkout {
  justify-self: start;
  width: auto;
  min-width: 132px;
}

.shop-summary-actions .shop-summary-continue {
  justify-self: start;
  width: auto;
  min-width: 190px;
}

.shop-summary-actions .shop-checkout-confidence {
  max-width: 30rem;
  margin: 0;
}

@media (max-width: 720px) {
  .shop-summary-actions .shop-summary-checkout,
  .shop-summary-actions .shop-summary-continue {
    justify-self: stretch;
    width: 100%;
  }
}

/* AJAX cart updates - May 2026 */
[data-cart-page] {
  transition: opacity .16s ease, filter .16s ease, transform .16s ease;
}

[data-cart-page].is-updating {
  opacity: .68;
  filter: saturate(.9);
  pointer-events: none;
  transform: translateY(1px);
}

/* Weekly opening hours in customer ordering info panels */
.shop-opening-hours-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(188, 204, 220, 0.72);
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.9);
}

.shop-ordering-info-text + .shop-opening-hours-card {
  margin-top: 12px;
}

.shop-opening-hours-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shop-opening-hours-head .page-kicker {
  margin: 0;
}

.shop-opening-hours-head .badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  font-size: 0.72rem;
  line-height: 1.1;
}

.shop-opening-hours-list {
  display: grid;
  gap: 4px;
  margin: 0;
}

.shop-opening-hours-list div {
  display: grid;
  grid-template-columns: minmax(82px, 0.9fr) minmax(0, 1.2fr);
  gap: 8px;
  align-items: baseline;
  padding: 5px 0;
  border-top: 1px solid rgba(188, 204, 220, 0.55);
}

.shop-opening-hours-list div:first-child {
  border-top: 0;
}

.shop-opening-hours-list div.is-today {
  color: var(--text);
  font-weight: 900;
}

.shop-opening-hours-list dt,
.shop-opening-hours-list dd {
  margin: 0;
  min-width: 0;
}

.shop-opening-hours-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.shop-opening-hours-list dd {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: right;
}

.shop-cart-ordering-info-panel {
  align-self: start;
}

@media (max-width: 640px) {
  .shop-opening-hours-card {
    padding: 10px;
    border-radius: 14px;
  }

  .shop-opening-hours-list div {
    grid-template-columns: minmax(72px, 0.82fr) minmax(0, 1.18fr);
    gap: 6px;
  }

  .shop-opening-hours-list dt,
  .shop-opening-hours-list dd {
    font-size: 0.78rem;
  }
}

/* 2026-07-09: keep cart thumbnails consistent with product cards. */
.shop-cart-line-image {
  width: var(--bd-product-thumb-image-size);
  height: var(--bd-product-thumb-image-size);
  aspect-ratio: var(--bd-product-card-image-aspect);
}

.shop-cart-line-image.small {
  width: var(--bd-product-thumb-image-size-small);
  height: var(--bd-product-thumb-image-size-small);
  aspect-ratio: var(--bd-product-card-image-aspect);
}

@media (max-width: 720px) {
  .shop-cart-line-image {
    width: var(--bd-product-thumb-image-size);
    height: var(--bd-product-thumb-image-size);
    aspect-ratio: var(--bd-product-card-image-aspect);
  }

  .shop-cart-line-image.small {
    width: var(--bd-product-thumb-image-size-small);
    height: var(--bd-product-thumb-image-size-small);
  }
}

@media (max-width: 430px) {
  .shop-cart-line-image {
    width: var(--bd-product-thumb-image-size);
    height: var(--bd-product-thumb-image-size);
    aspect-ratio: var(--bd-product-card-image-aspect);
  }
}

.policy-analytics-preference-form {
  display: grid;
  gap: 9px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(188, 204, 220, 0.72);
  border-radius: 16px;
  background: rgba(244, 249, 253, 0.78);
}

.policy-analytics-preference-form p,
.policy-analytics-preference-form small {
  margin: 0;
}

.policy-analytics-preference-form .button {
  justify-self: start;
}

.policy-analytics-preference-form small {
  color: #64748b;
  line-height: 1.45;
}

/* 2026-07-10: keep phone-width storefronts to one compact product card per row. */
@media (max-width: 640px) {
  .shop-product-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .shop-product-card {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 8px 10px;
    align-items: start;
    padding: 11px;
    border-radius: 16px;
  }

  .shop-product-card .shop-product-image {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 84px;
    aspect-ratio: 1 / 1;
    border-radius: 13px;
  }

  .shop-product-card .shop-product-card-top {
    grid-column: 2;
    grid-row: 1;
  }

  .shop-product-card .shop-product-description {
    grid-column: 2;
    grid-row: 2;
    -webkit-line-clamp: 2;
  }

  .shop-product-card .shop-product-badges {
    grid-column: 2;
    grid-row: 3;
  }

  .shop-product-card .shop-product-config-form,
  .shop-product-card .shop-product-basket-state,
  .shop-product-card .shop-product-actions {
    grid-column: 1 / -1;
  }

  .shop-product-card .shop-product-actions {
    align-items: stretch;
  }
}

/* 2026-07-10: prevent the mobile category navigation setting the page width. */
@media (max-width: 640px) {
  .shop-catalogue-layout,
  .shop-catalogue-layout > *,
  .shop-sidebar,
  .shop-panel.shop-categories-panel,
  .shop-product-area[data-shop-product-area] {
    min-width: 0;
    max-width: 100%;
  }

  .shop-panel.shop-categories-panel {
    overflow: hidden;
  }

  .shop-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .shop-category-link {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    scroll-snap-align: none;
  }
}

@media (max-width: 380px) {
  .shop-category-link {
    flex-basis: 100%;
  }
}

/* 2026-07-23: keep the private storefront preview action beside its explanatory copy. */
.client-storefront-preview-banner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  border: 2px dashed rgba(40, 123, 193, 0.36);
  background: rgba(232, 246, 255, 0.92);
}

.client-storefront-preview-banner .compact-button {
  flex: 0 0 auto;
  margin: 0;
}

.client-storefront-preview-copy {
  min-width: 0;
}

.client-storefront-preview-banner p {
  margin: 4px 0 0;
}

@media (max-width: 640px) {
  .client-storefront-preview-banner {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Shopper postcode availability feedback. */
.shop-postcode-status {
  display: block;
  min-height: 1.35em;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.45;
}

.shop-postcode-status.is-checking {
  color: #475569;
}

.shop-postcode-status.is-available {
  color: #166534;
}

.shop-postcode-status.is-unavailable,
.shop-postcode-status.is-error {
  padding: 8px 10px;
  border: 1px solid rgba(185, 28, 28, 0.28);
  border-radius: 10px;
  background: #fff1f2;
  color: #991b1b;
}

.shop-checkout-form input[aria-invalid="true"] {
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}
