/* SuperHote Publish — isolated discovery grid */

.shpd-root {
  --shpd-columns: 3;
  --shpd-gap: 24px;
  --shpd-card-max-width: 380px;
  --shpd-radius: 12px;
  --shpd-accent: #f5a623;
  --shpd-background: #ffffff;
  --shpd-text: #222222;
  --shpd-text-muted: #717171;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 20px;
  box-sizing: border-box;
  container-name: shpd-grid;
  container-type: inline-size;
}

.shpd-root *,
.shpd-root *::before,
.shpd-root *::after,
.shpd-modal *,
.shpd-modal *::before,
.shpd-modal *::after {
  box-sizing: border-box;
}

.shpd-grid {
  display: grid;
  grid-template-columns: repeat(
    var(--shpd-columns),
    minmax(0, var(--shpd-card-max-width))
  );
  gap: var(--shpd-gap);
  align-items: stretch;
  justify-content: start;
}

.shpd-root-centered .shpd-grid {
  justify-content: center;
}

.shpd-grid[hidden],
.shpd-inline-viewer[hidden],
.shpd-modal[hidden] {
  display: none !important;
}

.shpd-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  color: var(--shpd-text);
  background: var(--shpd-background);
  border: 0;
  border-radius: var(--shpd-radius);
  box-shadow: 0 2px 12px rgb(0 0 0 / 8%);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.shpd-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgb(0 0 0 / 13%);
}

.shpd-card-media,
.shpd-card-placeholder {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #eeeeee;
}

.shpd-card-placeholder {
  display: grid;
  place-items: center;
  color: var(--shpd-text-muted);
  background:
    linear-gradient(135deg, rgb(255 255 255 / 70%), transparent),
    #eeeeee;
  font-size: 0.875rem;
}

.shpd-card-media-error::after {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  color: var(--shpd-text-muted);
  background: #eeeeee;
  content: "Photo indisponible";
  font-size: 0.875rem;
}

.shpd-card-media-error .shpd-slider-button,
.shpd-card-media-error .shpd-slider-dots {
  display: none;
}

.shpd-slider-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.shpd-slide {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover;
  opacity: 0;
  transition: opacity 250ms ease;
}

.shpd-slide-active {
  z-index: 1;
  opacity: 1;
}

.shpd-slider-button,
.shpd-slider-dot {
  appearance: none;
  font: inherit;
  cursor: pointer;
}

.shpd-slider-button {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0 !important;
  place-items: center;
  color: #222222 !important;
  background: rgb(255 255 255 / 92%) !important;
  border: 0 !important;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgb(0 0 0 / 20%);
  font-size: 24px;
  line-height: 1;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 160ms ease;
}

.shpd-card-media:hover .shpd-slider-button,
.shpd-slider-button:focus-visible {
  opacity: 1;
}

.shpd-slider-button:focus-visible,
.shpd-slider-dot:focus-visible,
.shpd-cta:focus-visible,
.shpd-viewer-close:focus-visible,
.shpd-viewer-external:focus-visible,
.shpd-modal-close:focus-visible,
.shpd-modal-external:focus-visible {
  outline: 3px solid var(--shpd-accent, #f5a623);
  outline-offset: 3px;
}

.shpd-slider-previous {
  left: 10px;
}

.shpd-slider-next {
  right: 10px;
}

.shpd-slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  z-index: 3;
  display: flex;
  gap: 7px;
  align-items: center;
  transform: translateX(-50%);
}

.shpd-slider-dot {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 50%;
  opacity: 1;
  transform: none;
}

.shpd-slider-dot::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: rgb(255 255 255 / 65%);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.shpd-slider-dot-active::before {
  background: #ffffff;
  transform: translate(-50%, -50%) scale(1.3);
}

.shpd-card-body {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 16px 16px 20px;
}

.shpd-card-footer {
  margin-top: auto;
}

.shpd-card-meta,
.shpd-card-address,
.shpd-card-details,
.shpd-card-price,
.shpd-card-title {
  overflow-wrap: anywhere;
}

.shpd-card-meta {
  margin: 0 0 4px;
  color: var(--shpd-text-muted);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
}

.shpd-card-title {
  margin: 0 0 8px;
  color: var(--shpd-text);
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.35;
}

.shpd-card-address {
  margin: 0 0 4px;
  color: var(--shpd-text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.shpd-card-details {
  margin: 0 0 12px;
  color: var(--shpd-text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.shpd-card-price {
  margin: 0;
  color: var(--shpd-text);
  font-size: 0.95rem;
  line-height: 1.4;
}

.shpd-card-price strong {
  color: var(--shpd-text);
  font-size: 1.1rem;
  font-weight: 700;
}

.shpd-root a.shpd-cta,
.shpd-root .shpd-cta-disabled {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 13px 22px;
  color: #ffffff !important;
  background: var(--shpd-accent) !important;
  border: 0;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none !important;
  transition:
    filter 160ms ease,
    transform 160ms ease;
}

.shpd-root a.shpd-cta:hover {
  color: #ffffff !important;
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.shpd-root .shpd-cta-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.shpd-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.shpd-status,
.shpd-configuration-error {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  padding: 40px 20px;
  color: var(--shpd-text-muted, #717171);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

.shpd-configuration-error {
  color: #8a1f11;
  background: #fff4f2;
  border: 1px solid #f1c8c2;
  border-radius: 8px;
}

.shpd-inline-viewer {
  width: 100%;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgb(0 0 0 / 10%);
  border-radius: var(--shpd-radius);
  box-shadow: 0 8px 30px rgb(0 0 0 / 10%);
}

.shpd-viewer-toolbar,
.shpd-modal-toolbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #ffffff;
  border-bottom: 1px solid rgb(0 0 0 / 10%);
}

.shpd-viewer-title,
.shpd-modal-title {
  min-width: 0;
  margin: 0;
  color: #222222;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.shpd-viewer-close,
.shpd-viewer-external,
.shpd-modal-close,
.shpd-modal-external {
  flex: 0 0 auto;
  margin: 0;
  padding: 9px 13px !important;
  color: #222222 !important;
  background: #ffffff !important;
  border: 1px solid rgb(0 0 0 / 18%) !important;
  border-radius: 8px;
  box-shadow: none !important;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none !important;
  cursor: pointer;
}

.shpd-viewer-close:hover,
.shpd-viewer-external:hover,
.shpd-modal-close:hover,
.shpd-modal-external:hover {
  color: #222222 !important;
  background: #f7f7f7 !important;
}

.shpd-viewer-actions,
.shpd-modal-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
}

.shpd-viewer-loading,
.shpd-modal-loading {
  margin: 0;
  padding: 12px 18px;
  color: #555555;
  background: #fafafa;
  border-bottom: 1px solid rgb(0 0 0 / 8%);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
}

.shpd-viewer-loading[hidden],
.shpd-modal-loading[hidden] {
  display: none !important;
}

.shpd-inline-frame {
  display: block;
  width: 100%;
  border: 0;
  background: #ffffff;
}

body.shpd-modal-open {
  overflow: hidden !important;
}

.shpd-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  padding: 3vh 3vw;
  place-items: center;
  background: rgb(0 0 0 / 68%);
}

.shpd-modal-dialog {
  display: flex;
  width: min(1200px, 94vw);
  height: min(94vh, 1000px);
  max-height: 94vh;
  overflow: hidden;
  flex-direction: column;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgb(0 0 0 / 35%);
}

.shpd-modal-frame {
  display: block;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  border: 0;
  background: #ffffff;
}

@media (max-width: 1024px) {
  .shpd-root[data-columns="3"] .shpd-grid {
    grid-template-columns: repeat(2, minmax(0, var(--shpd-card-max-width)));
  }
}

@container shpd-grid (max-width: 900px) {
  .shpd-root[data-columns="3"] .shpd-grid {
    grid-template-columns: repeat(2, minmax(0, var(--shpd-card-max-width)));
  }
}

@container shpd-grid (max-width: 620px) {
  .shpd-root[data-columns] .shpd-grid {
    grid-template-columns: minmax(0, var(--shpd-card-max-width));
  }
}

@media (max-width: 650px) {
  .shpd-root {
    padding: 20px 12px;
  }

  .shpd-root[data-columns] .shpd-grid {
    grid-template-columns: minmax(0, var(--shpd-card-max-width));
  }

  .shpd-card-body {
    padding: 14px 14px 18px;
  }

  .shpd-slider-button {
    opacity: 1;
  }

  .shpd-viewer-toolbar,
  .shpd-modal-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .shpd-modal {
    padding: 0;
  }

  .shpd-modal-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .shpd-viewer-actions,
  .shpd-modal-actions {
    width: 100%;
  }

  .shpd-viewer-external,
  .shpd-viewer-close,
  .shpd-modal-external,
  .shpd-modal-close {
    flex: 1 1 50%;
    text-align: center;
  }

  .shpd-modal-toolbar {
    padding-top: max(14px, env(safe-area-inset-top));
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
  }

  .shpd-modal-frame {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (prefers-reduced-motion: reduce) {
  .shpd-card,
  .shpd-slide,
  .shpd-slider-button,
  .shpd-slider-dot,
  .shpd-cta {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
