/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ---------- Public store: a product's shipping line ----------
 * "Free shipping" or "+ $5 shipping", inside the price element of a store
 * card and of the product page, on its own line in the page's text color
 * (a theme may color the price itself). */

body[data-layout="public"] .merch-product__shipping,
body[data-layout="public"] .merch-product-page__shipping {
  display: block;
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.75;
}

/* ---------- Public product page: photo gallery ----------
 * The "Gallery" photo display: one square photo per slide in a scroll-snap
 * strip (a plain scrolling strip without JavaScript), with arrows and dots
 * that photo_gallery_controller.js reveals. Every public theme uses these;
 * colors come from the theme's own custom properties. Square corners. */

body[data-layout="public"] .merch-product-page__photos--gallery {
  position: relative;
  display: block;
  width: 100%;
  max-width: 36rem;
}

body[data-layout="public"] .merch-gallery__strip {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

body[data-layout="public"] .merch-gallery__strip::-webkit-scrollbar { display: none; }

body[data-layout="public"] .merch-gallery__strip:focus-visible {
  outline: 2px solid var(--color-accent, currentColor);
  outline-offset: 2px;
}

body[data-layout="public"] .merch-gallery__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

body[data-layout="public"] .merch-gallery__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0;
}

body[data-layout="public"] .merch-gallery__arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 0;
  background: var(--color-bg, #fff);
  color: var(--color-text, #111);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

body[data-layout="public"] .merch-gallery__arrow[hidden] { display: none; }
body[data-layout="public"] .merch-gallery__arrow:disabled { opacity: 0.4; cursor: default; }
body[data-layout="public"] .merch-gallery__arrow--prev { left: 0.5rem; }
body[data-layout="public"] .merch-gallery__arrow--next { right: 0.5rem; }

body[data-layout="public"] .merch-gallery__dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
}

body[data-layout="public"] .merch-gallery__dots[hidden] { display: none; }

body[data-layout="public"] .merch-gallery__dot {
  width: 0.75rem;
  height: 0.75rem;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

body[data-layout="public"] .merch-gallery__dot[aria-current="true"] {
  background: currentColor;
}

/* Shoply and Shopkeeper put the photos in the left column beside the details. */
body[data-layout="public"][data-theme="shoply"] .merch-product-page__photos--gallery,
body[data-layout="public"][data-theme="shopkeeper"] .merch-product-page__photos--gallery {
  max-width: none;
}

/* The paid-order receipt page (public/merch_receipts): print only the receipt. */
@media print {
  body[data-layout="public"] header,
  body[data-layout="public"] footer,
  body[data-layout="public"] nav,
  .merch-receipt__note {
    display: none;
  }
}
