/*
 * Store additions. The storefront itself is styled by the design's classes in style.css
 * (store-*, sip-*, gallery-*, hp-store-*); this file only covers what the database-driven pages add.
 */

/* Category chips are links (so they still work without JavaScript) styled as the design's buttons. */
a.store-tab,
a.store-tab:hover {
  text-decoration: none;
}

/* The search box is a real form: typing filters instantly, Enter falls back to the server search. */
form.store-section-search {
  margin: 0;
}

/* "12 products" beside a panel's subtitle, so a search that found nothing here still reads as an answer. */
.store-result-count {
  display: inline-block;
  margin-left: .375rem;
  padding: .1rem .5rem;
  border-radius: 50rem;
  background: rgba(31, 122, 99, .1);
  color: #1f7a63;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}

body.dark .store-result-count {
  background: rgba(52, 211, 153, .12);
  color: #34d399;
}

/* "Save $8.00" under a struck-through price on the cards. */
.store-price-save {
  font-size: .68rem;
  font-weight: 700;
  color: #b91c1c;
  line-height: 1.2;
}

.store-add-btn:disabled,
.store-add-meat-btn:disabled,
.sip-atc-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Meat card without a photo. */
.store-meat-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fee2e2;
  color: #dc2626;
  font-size: 2.5rem;
}

/* Free-delivery progress bar (drawer, basket and checkout). */
.store-delivery-progress {
  height: 6px;
  border-radius: 50rem;
}

.store-delivery-progress .progress-bar {
  border-radius: 50rem;
  transition: width .4s ease;
}

/* Cart drawer */
.store-toast-wrap {
  z-index: 1100;
}

.store-cart-item-name {
  color: inherit;
}

.store-cart-item.is-busy,
.cart-row.is-busy {
  opacity: .55;
  pointer-events: none;
}

/* Basket page */
.store-cart-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 12px;
  object-fit: cover;
  font-size: 1.5rem;
}

.cart-line-total {
  min-width: 80px;
  text-align: right;
}

.store-summary-card {
  top: 96px;
}

/* Product page */
.sip-icon-meat {
  background: #fee2e2;
  color: #dc2626;
}

.sip-cat-pill-meat {
  background: rgba(220, 38, 38, .1);
  color: #b91c1c;
}

.sip-price-meat {
  color: #dc2626 !important;
}

.sip-desc p:last-child {
  margin-bottom: 0;
}

.sip-specs-text {
  white-space: pre-line;
}

.sip-thumb:focus-visible {
  outline: 2px solid #1f7a63;
  outline-offset: 2px;
}

.sip-main-img {
  cursor: zoom-in;
}

.sip-related-meat-img {
  background: #fee2e2;
  color: #dc2626;
  font-size: 3rem;
}

.hp-store-card-img img {
  border-radius: inherit;
}

/* Gallery viewer: swipe left / right on touch screens. */
.gallery-main {
  touch-action: pan-y;
  user-select: none;
}

.gallery-main-img {
  transition: opacity .12s;
}

/*
 * The listing's gallery is opened by a card picture and may hold a single photo, so the arrows and the
 * thumbnail strip are hidden. Both are laid out with display:flex, which would otherwise beat [hidden].
 */
.gallery-nav[hidden],
.gallery-thumbs[hidden] {
  display: none;
}

/* Thumbnails are buttons so they can be reached by keyboard; the picture inside keeps the design's look. */
.gallery-thumb-btn {
  padding: 0;
  border: none;
  background: none;
  line-height: 0;
  border-radius: 8px;
}

.gallery-thumb-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.gallery-foot {
  padding: .625rem 1rem;
  background: #161616;
  text-align: center;
}

.gallery-foot a {
  color: #9ca3af;
}

.gallery-foot a:hover {
  color: #fff;
}

/* Product options and fractional quantities (WP-5). */
.store-line-option {
  font-size: .75rem;
  color: #6b7280;
}

.store-qty-unit {
  font-size: .8rem;
  font-weight: 600;
  color: #6b7280;
  margin-left: -.5rem;
}

.sip-option-select {
  min-width: 14rem;
  max-width: 100%;
}

.store-add-btn-link {
  text-decoration: none;
}

/* Room for "1.5 lb" between the drawer's stepper buttons. */
.sip-cart-qty-num {
  min-width: 2.75rem;
  text-align: center;
  white-space: nowrap;
}

body.dark .store-line-option,
body.dark .store-qty-unit {
  color: #9ca3af;
}
