/* ===================================================
   Shop Modal — Gate-1 Baseline
   Structural clone of brand-modal.css.
   Gate-2: adjust styles for Shop-specific layout differences.
   =================================================== */

/* Overlay */
.shop-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1100;
}

.shop-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* Dialog */
.shop-modal {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  z-index: 1101;
  padding: 16px;
}

.shop-modal.is-open {
  display: flex;
}

.shop-modal__inner {
  background: var(--color-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  position: relative;
}

/* Close button: sticky so it stays visible when modal content scrolls */
.shop-modal__close {
  display: none;
  position: sticky;
  top: 16px;
  align-self: flex-end;
  margin-top: 16px;
  margin-right: 16px;
  margin-bottom: -52px;
  z-index: 1110;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--color-text-emphasis);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.shop-modal.is-open .shop-modal__close {
  display: flex;
}

.shop-modal__close:hover {
  background: #fff;
  color: var(--color-text-emphasis);
}

/* Header */
.shop-modal__header {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 10;
  border-bottom: 1px solid var(--color-border);
  border-radius: 16px 16px 0 0;
}

.shop-modal__shop-core {
  padding: 16px 24px 8px;
}

.shop-modal .shop-modal__shop-categories {
  margin-top: 8px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}

.shop-modal__shop-body-wrapper {
  display: flow-root;
  padding: 0 24px 16px;
  min-width: 0;
}

.shop-modal__shop-logo {
  float: right;
  margin-left: 16px;
  margin-bottom: 16px;
  width: 130px;
  height: 130px;
  border-radius: 0;
  object-fit: cover;
  box-shadow:
    1px 1px 2px rgba(0, 0, 0, 0.12),
   -1px -1px 2px rgba(0, 0, 0, 0.12);
}

.shop-modal__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-emphasis);
  line-height: 1.3;
}

.shop-modal__short-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

.shop-modal__shop-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.shop-modal .shop-modal__shop-tags .shop-modal__tag {
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-subtle);
}

.shop-modal__cta {
  margin-top: 12px;
}

.shop-modal__cta .shop-card__btn {
  width: 100%;
  margin-top: 0;
}

.shop-modal__floating-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 11;
  padding: 0;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0s linear 0.28s;
}

.shop-modal__floating-cta.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0s linear 0s;
}

.shop-modal__floating-cta .shop-card__btn {
  width: 100%;
  margin-top: 0;
  border-radius: 0 0 16px 16px;
  min-height: 52px;
}

/* Hero (Gate-1 clone; Gate-2 removes hero block) */
.shop-modal__hero {
  position: relative;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: var(--color-skeleton);
  flex-shrink: 0;
}

.shop-modal__hero-skeleton {
  position: absolute;
  inset: 0;
  border-radius: 0;
  animation: sk-pulse 1.5s ease-in-out infinite;
}

.shop-modal__hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.55s ease-in-out;
  will-change: opacity;
}

.shop-modal__hero-img.is-active {
  opacity: 1;
}

/* Brands section */
.shop-modal__brands-section,
.shop-modal__feeds-section {
  display: flex;
  flex-direction: column;
}

.shop-modal__brands-section[hidden],
.shop-modal__feeds-section[hidden] {
  display: none !important;
}

.shop-modal__brands-heading,
.shop-modal__feeds-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
  padding: 16px 24px 0;
}

.shop-modal__brands-section.is-loading .shop-modal__brands-heading,
.shop-modal__feeds-section.is-loading .shop-modal__feeds-heading {
  color: transparent;
  position: relative;
}

.shop-modal__brands-section.is-loading .shop-modal__brands-heading::after,
.shop-modal__feeds-section.is-loading .shop-modal__feeds-heading::after {
  content: '';
  display: block;
  width: min(320px, 70%);
  height: 14px;
  border-radius: 6px;
  background: var(--color-skeleton);
  animation: sk-pulse 1.5s ease-in-out infinite;
}

/* Empty / error states */
.shop-modal__empty,
.shop-modal__error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--color-text-subtle);
  font-size: 15px;
}

/* Body: brand card grid */
.shop-modal__body {
  padding: 20px 24px 88px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.shop-modal__body--carousel {
  display: block;
  padding: 20px 24px 20px;
}

.shop-modal-brand-carousel {
  position: relative;
  overflow: hidden;
  margin: 0 -4px;
}

.shop-modal-brand-carousel__track {
  display: flex;
  align-items: stretch;
  transition: transform 0.38s ease;
  will-change: transform;
}

.shop-modal-brand-carousel__track.is-no-transition {
  transition: none;
}

.shop-modal-brand-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text-emphasis);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  padding: 0;
}

.shop-modal-brand-carousel__nav--prev {
  left: 8px;
}

.shop-modal-brand-carousel__nav--next {
  right: 8px;
}

.shop-modal-brand-carousel__slide {
  flex: 0 0 50%;
  min-width: 0;
  padding: 0 4px;
  box-sizing: border-box;
  display: flex;
}

.shop-modal-brand-carousel__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.shop-modal-brand-carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  background: #d4d9df;
  padding: 0;
  cursor: pointer;
}

.shop-modal-brand-carousel__dot.is-active {
  background: #7ab9dd;
}

@media (max-width: 689px) {
  .shop-modal-brand-carousel__nav {
    display: none;
  }

  .shop-modal-brand-carousel__slide {
    flex-basis: 100%;
    padding: 0 4px;
  }
}

/* Related brands cards (Shop Detail Modal) */
.shop-modal-brand-card {
  background: var(--color-bg);
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 8px 12px;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: flex-start;
}

.shop-modal-brand-card__inner {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
  display: flow-root;
  min-width: 0;
  width: 100%;
}

.shop-modal-brand-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-emphasis);
  line-height: 1.3;
  margin: 0 0 10px;
}

.shop-modal-brand-card__logo {
  float: right;
  margin-left: 16px;
  margin-bottom: 16px;
  width: 130px;
  height: 130px;
  border-radius: 0;
  object-fit: cover;
  box-shadow:
    1px 1px 2px rgba(0, 0, 0, 0.12),
   -1px -1px 2px rgba(0, 0, 0, 0.12);
}

.shop-modal-brand-card__desc {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

.shop-modal-feed-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 10px 0;
}

.shop-modal-feed-card__tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 10px;
  border-radius: 4px;
  background-color: #ff4d4f;
  color: #fff;
  border: 1px solid #ff4d4f;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.shop-modal-feed-card__logo {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  margin: 0 0 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.42s ease, visibility 0.42s ease;
}

.shop-modal-feed-card__logo.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.shop-modal-feed-card__carousel {
  position: relative;
}

.shop-modal-feed-card__track {
  display: grid;
}

.shop-modal-feed-card__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 6px 0 6px;
}

.shop-modal-feed-card__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  background: #d4d9df;
  padding: 0;
  cursor: pointer;
}

.shop-modal-feed-card__dot.is-active {
  background: #7ab9dd;
}

.shop-modal-feed-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text-emphasis);
  margin: 0 0 10px;
}

.shop-modal-feed-card__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.shop-modal-feed-card__period {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-subtle);
  display: flex;
  gap: 6px;
  align-items: center;
}

.shop-modal-feed-card__meta-icon {
  flex: 0 0 auto;
  line-height: 1;
}

.shop-modal-feed-card__btn {
  width: 100%;
  margin-top: 12px;
}

/* Body scroll lock */
body.shop-modal-open {
  overflow: hidden;
}

@media (max-width: 689px) {
  .shop-modal__hero {
    aspect-ratio: 3 / 2;
  }

  .shop-modal__body {
    grid-template-columns: 1fr;
    padding: 16px 24px 88px;
  }

  .shop-modal__header {
    display: contents;
  }

  .shop-modal__shop-core {
    position: sticky;
    top: 0;
    background: var(--color-bg);
    z-index: 10;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
  }

  .shop-modal__shop-body-wrapper {
    padding: 24px 24px 16px;
  }

  .shop-modal__floating-cta .shop-card__btn {
    min-height: 48px;
  }
}

/* ===================================================
   Shop Listing Card
   =================================================== */

.shop-listing-card {
  background: var(--color-bg);
  border: 1.5px solid var(--color-surface);
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
}


/* No Results styles moved to facetwp/style.css (i85 Gate-1, 30-code-gate1) */
