/* ==========================================================================
   ATR Starter FSE — WooCommerce Quick View (opt-in, inc/woo-quick-view.php)
   Mobile-first. Logical properties only, so no RTL build is needed.
   Children style against the atr-starter-fse-quick-view BEM classes.
   ========================================================================== */

/* Trigger in product listings */
.atr-starter-fse-quick-view__trigger {
  display: inline-block;
  margin-block-start: 0.5rem;
  font-size: var(--wp--preset--font-size--small);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

/* Dialog */
.atr-starter-fse-quick-view {
  border: 0;
  border-radius: 12px;
  padding: 0;
  width: min(960px, 92vw);
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  background: var(--wp--preset--color--ti-bg);
  color: var(--wp--preset--color--ti-fg);
}

.atr-starter-fse-quick-view::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.atr-starter-fse-quick-view__close {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 8px;
  z-index: 1;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--wp--preset--color--ti-bg);
  color: var(--wp--preset--color--ti-fg);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}

.atr-starter-fse-quick-view__close:hover,
.atr-starter-fse-quick-view__close:focus-visible {
  opacity: 1;
}

.atr-starter-fse-quick-view__body {
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
}

.atr-starter-fse-quick-view__loading,
.atr-starter-fse-quick-view__error {
  margin: 0;
  padding: 3rem 1rem;
  text-align: center;
}

/* Product layout: one column, two from tablet up */
.atr-starter-fse-quick-view__product {
  display: grid;
  gap: 24px;
}

@media (min-width: 782px) {
  .atr-starter-fse-quick-view__product {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* Gallery. WooCommerce's layout CSS floats `div.product div.images` at 48% and
   stretches every img inside it to 100%; these selectors outrank it. */
.atr-starter-fse-quick-view .atr-starter-fse-quick-view__product.product .atr-starter-fse-quick-view__gallery.images,
.atr-starter-fse-quick-view .atr-starter-fse-quick-view__product.product .atr-starter-fse-quick-view__summary {
  float: none;
  width: 100%;
  margin: 0;
  position: relative;
}

.atr-starter-fse-quick-view__image {
  margin: 0;
}

.atr-starter-fse-quick-view__image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.atr-starter-fse-quick-view__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.atr-starter-fse-quick-view__thumb {
  display: block;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

.atr-starter-fse-quick-view .atr-starter-fse-quick-view__product .atr-starter-fse-quick-view__thumbs .atr-starter-fse-quick-view__thumb img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
}

.atr-starter-fse-quick-view__thumb.is-active,
.atr-starter-fse-quick-view__thumb:focus-visible {
  border-color: var(--wp--preset--color--ti-accent);
}

/* Summary */
.atr-starter-fse-quick-view__summary {
  padding-inline-end: 32px; /* keep clear of the close button */
}

.atr-starter-fse-quick-view__title {
  margin: 0 0 0.5rem;
  font-size: var(--wp--preset--font-size--large);
  line-height: 1.2;
}

.atr-starter-fse-quick-view__title a {
  color: inherit;
  text-decoration: none;
}

.atr-starter-fse-quick-view__title a:hover,
.atr-starter-fse-quick-view__title a:focus-visible {
  text-decoration: underline;
}

.atr-starter-fse-quick-view__section {
  margin-block-end: 1rem;
}

.atr-starter-fse-quick-view__section--add_to_cart form.cart {
  margin: 0;
}

.atr-starter-fse-quick-view__section--add_to_cart .is-adding .single_add_to_cart_button {
  opacity: 0.6;
}

.atr-starter-fse-quick-view__notices .woocommerce-message,
.atr-starter-fse-quick-view__notices .woocommerce-error {
  margin-block-end: 1rem;
}

.atr-starter-fse-quick-view__details {
  display: inline-block;
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .atr-starter-fse-quick-view[open] {
    animation: atr-starter-fse-quick-view-in 0.18s ease-out;
  }

  @keyframes atr-starter-fse-quick-view-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }
}
