.shop-basket-bar {
  position: sticky;
  top: 71px;
  z-index: 45;
  padding: 8px 20px;
  background: var(--page-bg);
  border-bottom: 1px solid var(--card-border);
}

.shop-basket-bar .container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.shop-basket-bar .container:has(.shop-basket-bar-back),
.shop-basket-bar .container:has(.shop-account-status) {
  justify-content: space-between;
}

.shop-basket-bar-back,
.shop-basket-bar-back:visited {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 0;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.shop-basket-bar-back:hover,
.shop-basket-bar-back:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.theme-dark .shop-basket-bar-back,
body.theme-dark .shop-basket-bar-back:visited {
  color: var(--brand-dark);
}

.shop-account-status {
  min-width: 0;
  font-size: 0.9rem;
}

.shop-account-login {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.shop-account-login:hover,
.shop-account-login:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.shop-login-error {
  margin: 0 0 12px;
  color: #b00020;
  font-weight: 700;
  text-align: center;
}

.shop-login-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.shop-login-submit {
  width: 100%;
  margin-top: 12px;
}

.shop-login-forgot,
.shop-login-cancel {
  margin: 14px 0 0;
  text-align: center;
}

.shop-login-forgot button,
.shop-login-cancel button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
}

.shop-login-forgot button:hover,
.shop-login-cancel button:hover {
  text-decoration: underline;
}

.shop-forgot-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.shop-account-logout {
  margin-left: 4px;
  color: var(--brand);
  text-decoration: none;
}

.shop-account-logout:hover,
.shop-account-logout:focus-visible {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .shop-basket-bar .container {
    align-items: flex-start;
  }

  .shop-account-status {
    font-size: 0.82rem;
  }
}

.shop-basket-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

.shop-basket-indicator:hover,
.shop-basket-indicator:focus-visible {
  border-color: var(--brand);
}

.shop-basket-items {
  display: grid;
  gap: 16px;
}

.shop-basket-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 20px;
  align-items: stretch;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.shop-basket-item-media {
  display: flex;
  width: 100px;
  flex-direction: column;
  justify-content: space-between;
}

.shop-basket-item-image {
  display: block;
  width: 100px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: left top;
  border-radius: 8px;
}

.shop-basket-remove-form {
  display: flex;
  justify-content: center;
  margin: 16px 0 0;
}

.shop-basket-remove {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.shop-basket-remove:hover,
.shop-basket-remove:focus-visible {
  color: var(--brand-dark);
}

.shop-basket-item-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.shop-basket-item-content h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--brand);
}

.shop-basket-item-content p {
  margin: 0;
  color: var(--text-soft);
}

.shop-basket-options {
  margin: 6px 0 10px;
}

.shop-basket-option {
  display: flex;
  gap: 6px;
}

.shop-basket-option dt {
  font-weight: 700;
}

.shop-basket-option dd {
  margin: 0;
  color: var(--text-soft);
}

.shop-basket-item-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.shop-basket-item-actions form {
  margin: 0;
}

.shop-basket-item-actions button {
  min-width: 34px;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.shop-basket-item-actions button:hover {
  border-color: var(--brand);
}

.shop-basket-quantity {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
}

.shop-basket-line-total {
  align-self: end;
  white-space: nowrap;
}

.shop-basket-total {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
  font-size: 1.25rem;
}

.shop-basket-checkout-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.shop-basket-checkout-actions .shop-add-to-basket-button {
  text-decoration: none;
}

.shop-empty-basket-form {
  margin-top: 20px;
  text-align: right;
}

.shop-empty-basket-form button {
  padding: 8px 14px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card);
  color: var(--brand);
  font: inherit;
  cursor: pointer;
}

.shop-empty-basket-form button:hover {
  border-color: var(--brand);
}

@media (max-width: 600px) {
  .shop-basket-item {
    grid-template-columns: 80px 1fr;
  }

  .shop-basket-item-image {
    width: 80px;
  }

  .shop-basket-line-total {
    grid-column: 2;
  }
}

.shop-intro {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}

.shop-category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .shop-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 901px) {
  .shop-category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.shop-category-card {
  display: block;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.shop-category-card:hover,
.shop-category-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  outline: none;
}

.shop-category-image {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
}

.shop-category-content {
  display: block;
  padding: 28px;
}

.shop-category-card h3 {
  margin: 0 0 10px;
  color: var(--brand);
}

.shop-category-card p {
  margin: 0;
  color: var(--text-soft);
}

.shop-empty-message,
.shop-error-message {
  padding: 20px;
  text-align: center;
  border-radius: 12px;
}

.shop-empty-message {
  background: var(--card);
  border: 1px solid var(--card-border);
}

.shop-error-message {
  background: #fff3f3;
  border: 1px solid #d8a0a0;
  color: #650000;
}

.shop-product-grid {
  display: grid;
  gap: 24px;
}

.shop-product-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: start;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.shop-product-card:hover,
.shop-product-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  outline: none;
}

.shop-product-image-wrap {
  position: relative;
  width: 160px;
}

.shop-product-image {
  display: block;
  width: 160px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: left top;
  border-radius: 10px;
}

.shop-product-detail-image-wrap {
  position: relative;
  width: 100%;
}

.shop-product-badge {
  position: absolute;
  top: 14px;
  right: 0;
  padding: 6px 12px;
  background: #ff6b6b;
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.shop-product-content h3 {
  margin: 0 0 10px;
  color: var(--brand);
}

.shop-product-content p {
  margin: 8px 0;
  color: var(--text-soft);
}

.shop-product-form {
  margin: 0;
}

.shop-product-direct-add {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.shop-product-direct-add .shop-product-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-product-title {
  color: var(--brand);
  font-size: 1.17em;
  font-weight: 700;
}

.shop-product-description {
  color: var(--text-soft);
}

.shop-product-add-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  line-height: 1;
}

.shop-configured-product-form {
  margin: 0;
}

.shop-add-to-basket-button {
  width: fit-content;
  min-width: 180px;
  padding: 11px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.shop-add-to-basket-button:hover {
  background: var(--brand-dark);
}

.shop-quick-products {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  margin-top: 4px;
}

.shop-quick-products-label {
  font-size: 0.9rem;
  color: var(--text-soft);
}

.shop-quick-products-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.shop-quick-products-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-quick-products-links a:hover,
.shop-quick-products-links a:focus-visible {
  border-color: var(--brand);
  background: var(--page-bg);
}

.shop-added-toast {
  position: fixed;
  top: 180px;
  left: 50%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 80%;
  min-height: 110px;
  padding: 28px 70px 28px 32px;
  border: 2px solid var(--brand);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  transform: translateX(-50%);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.shop-added-toast a {
  color: var(--brand);
  font-weight: 700;
  white-space: nowrap;
}

.shop-added-toast-close {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.shop-added-toast-close:hover,
.shop-added-toast-close:focus-visible {
  color: var(--brand);
}

.shop-product-detail {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
  align-items: start;
}

.shop-product-detail-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
}

.shop-product-detail-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shop-product-price {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
}

.shop-option-group {
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

.shop-option-heading {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.shop-option-required {
  color: var(--brand);
}

.shop-option-instructions {
  margin: 0 0 12px;
  color: var(--text-soft);
}

.shop-option-placeholder {
  margin: 0;
  color: var(--text-soft);
  font-style: italic;
}

.shop-option-choices {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.shop-option-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.shop-option-choice input {
  margin: 0;
}

.shop-option-value-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #ff6b6b;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.shop-option-text,
.shop-option-select {
  width: min(100%, 420px);
  padding: 10px 12px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
}

.shop-product-mobile-back-link {
  display: none;
}

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

  .shop-product-detail-image {
    max-width: 320px;
    margin: 0 auto;
  }

  .shop-product-mobile-back-link {
    display: block;
  }

  .shop-quick-products-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .shop-product-image {
    margin: 0 auto;
  }
}

.shop-checkout-customer {
  max-width: 760px;
  margin: 0 auto 36px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.shop-checkout-customer h2 {
  margin: 0 0 10px;
  color: var(--brand);
}

.shop-checkout-account-note {
  margin: 0 0 20px;
  color: var(--text-soft);
}

.shop-checkout-form {
  display: grid;
  gap: 16px;
}

.shop-checkout-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.shop-checkout-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.shop-checkout-form input,
.shop-checkout-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--page-bg);
  color: var(--text);
  font: inherit;
}

.shop-checkout-form textarea {
  resize: vertical;
}

@media (max-width: 600px) {
  .shop-checkout-field-row {
    grid-template-columns: 1fr;
  }
}

.shop-checkout-summary-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.shop-checkout-summary-item .shop-basket-item-content {
  min-width: 0;
}

.shop-checkout-order-note {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  font-weight: 600;
}

.shop-checkout-order-note textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--page-bg);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.shop-checkout-errors,
.shop-checkout-ready {
  max-width: 760px;
  margin: 0 auto 24px;
  padding: 16px 18px;
  border-radius: 10px;
}

.shop-checkout-errors {
  border: 1px solid #c77;
  background: #fff3f3;
  color: #650000;
}

.shop-checkout-errors ul {
  margin: 8px 0 0 20px;
}

.shop-checkout-ready {
  border: 1px solid var(--card-border);
  background: var(--card);
}

.shop-checkout-ready p {
  margin: 4px 0 0;
}

.shop-checkout-submit {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
  margin-bottom: 24px;
}

.shop-checkout-discount {
  margin-top: 20px;
}

.shop-checkout-discount > label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

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

.shop-checkout-discount-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--page-bg);
  color: var(--text);
  font: inherit;
}

.shop-checkout-discount-error {
  margin: 8px 0 0;
  color: #b00020;
}

.shop-checkout-discount-success {
  margin: 8px 0 0;
  color: var(--brand);
}

.shop-checkout-totals {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

.shop-checkout-total-row {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 8px;
}

.shop-checkout-total-row:first-child {
  margin-top: 0;
}

.shop-checkout-total-final {
  margin-top: 14px;
  font-size: 1.25rem;
}

.shop-checkout-discount-row .btn-ghost {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.shop-checkout-discount-row .btn-ghost:hover,
.shop-checkout-discount-row .btn-ghost:focus-visible {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.shop-square-payment {
  margin-top: 24px;
}

.shop-square-payment h2 {
  margin: 0 0 16px;
  color: var(--brand);
  font-size: 1.15rem;
}

#square-card-container {
  min-height: 90px;
}

/* Shop accent colours need extra contrast in dark mode */
body.theme-dark .shop-intro a,
body.theme-dark .shop-intro a:visited,
body.theme-dark .shop-checkout-customer h2,
body.theme-dark .shop-account-logout,
body.theme-dark .shop-account-logout:visited,
body.theme-dark .shop-square-payment h2,
body.theme-dark .shop-category-card h3,
body.theme-dark .shop-product-content h3,
body.theme-dark .shop-product-title,
body.theme-dark .shop-quick-products-links a,
body.theme-dark .shop-quick-products-links a:visited,
body.theme-dark .shop-added-toast a,
body.theme-dark .shop-added-toast a:visited,
body.theme-dark .shop-product-price,
body.theme-dark .shop-basket-item-content h2,
body.theme-dark .shop-basket-remove,
body.theme-dark .shop-basket-remove:visited,
body.theme-dark .shop-empty-basket-form button {
  color: var(--brand-dark);
}
body.theme-dark .shop-product-add-label {
  background: var(--brand-dark);
  color: #fff;
}

.shop-checkout-complete {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-align: center;
}

.shop-checkout-complete h2 {
  margin: 0 0 14px;
  color: var(--brand);
}

.shop-checkout-complete p {
  margin: 8px 0;
}

body.theme-dark .shop-checkout-complete h2 {
  color: var(--brand-dark);
}
