/**
 * magnify-public.css — Magnify Publish Pipeline V2
 * Public website styles only. Zero editor/builder UI styles.
 */

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg-color, #0d1117);
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent, #3b82f6);
  text-decoration: none;
}

/* ── Site wrapper ──────────────────────────────────────────────────────────── */
.magnify-public-site {
  display: block;
  width: 100%;
}

.magnify-pages-wrap {
  position: relative;
  width: 100%;
}

/* ── Page canvases ─────────────────────────────────────────────────────────── */
/* Hidden by default — runtime adds .page-active */
.page-canvas {
  display: none;
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
}

.page-canvas.page-active {
  display: block;
}

.page-canvas-inner {
  position: relative;
  min-height: 100vh;
}

/* ── Mobile nav ────────────────────────────────────────────────────────────── */
.public-mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

.public-mobile-nav-drawer {
  display: none;
  flex-direction: column;
  background: inherit;
  padding: 16px 20px;
  gap: 16px;
}

.public-mobile-nav-drawer.open {
  display: flex;
}

@media (max-width: 640px) {
  .public-quick-nav ul {
    display: none;
  }
  .public-mobile-nav-toggle {
    display: flex;
    align-items: center;
  }
}

/* ── Sections (legacy .public- classes kept for compatibility) ─────────────── */
.public-section {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.public-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.public-custom-section {
  min-height: 280px;
}

.public-shop-hero {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.public-shop-grid {
  min-height: 400px;
  padding: 60px 40px;
}

/* ── Keep old .public-quick-nav working ────────────────────────────────────── */
.public-quick-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  overflow: hidden;
}

/* ── Dynamic element boxes ─────────────────────────────────────────────────── */
/* V2 renderer uses pub- prefix for all dynamic elements */
.pub-text-box,
.public-text-box {
  position: absolute;
  min-width: 80px;
  word-wrap: break-word;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.4;
  pointer-events: none;
}

.pub-image-box,
.public-image-box {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
}

.pub-image-box img,
.public-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pub-shape-box,
.public-shape-box {
  position: absolute;
  pointer-events: none;
}

.pub-button-box,
.public-button-box {
  position: absolute;
}

.pub-button-box a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.pub-button-box a:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* Section element overlay — contains dynamic boxes within a section */
.pub-section-elements {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

/* Page-level floats (elements with no sectionId) */
.pub-page-floats {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

/* ── Canvas inner ──────────────────────────────────────────────────────────── */
.pub-canvas-inner {
  position: relative;
  min-height: 100vh;
}

/* ── Background layers ─────────────────────────────────────────────────────── */
.pub-bg-layer,
.bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.pub-hero-image-layer,
.hero-image-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

.pub-sec-bgimg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  pointer-events: none;
  z-index: 0;
}

/* ── Logo ──────────────────────────────────────────────────────────────────── */
.pub-logo-container,
.logo-container {
  position: absolute;
  z-index: 10;
}

.pub-logo-container img,
.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── Sections ──────────────────────────────────────────────────────────────── */
.pub-section {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.pub-custom-section {
  min-height: 280px;
}

.pub-shop-hero {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-shop-grid {
  min-height: 400px;
  padding: 60px 40px;
}

/* ── Blocks (column / square) inside sections ─────────────────────────────── */
.pub-block {
  position: absolute;
  top: 0;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* ── Banner blocks (between sections) ─────────────────────────────────────── */
.pub-banner {
  width: 100%;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.pub-banner-inner {
  overflow: hidden;
}

.pub-banner-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* Animated scrolling banner */
.pub-banner-animated {
  animation: pub-banner-scroll 18s linear infinite;
}

@keyframes pub-banner-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Pause animation on hover */
.pub-banner:hover .pub-banner-animated {
  animation-play-state: paused;
}

/* ── Quick nav ─────────────────────────────────────────────────────────────── */
.pub-quick-nav,
.public-quick-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  overflow: hidden;
}

.pub-quick-nav ul,
.public-quick-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
}

.pub-quick-nav a,
.public-quick-nav a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.pub-quick-nav a:hover,
.public-quick-nav a:hover {
  opacity: 0.75;
}

/* ── Product grid ──────────────────────────────────────────────────────────── */
.pub-product-grid,
.public-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 60px 40px;
  position: relative;
  z-index: 5;
}

.pub-product-card,
.public-product-card {
  background: #161b27;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pub-product-card:hover,
.public-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.pub-product-card img,
.public-product-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.pub-product-card-body,
.public-product-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pub-product-card-body h3,
.public-product-card-body h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
}

.pub-price {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent, #3b82f6);
}

.pub-desc {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .public-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    padding: 40px 20px;
  }

  .public-shop-grid {
    padding: 40px 20px;
  }
}

@media (max-width: 480px) {
  .public-product-grid {
    grid-template-columns: 1fr;
    padding: 24px 16px;
  }
}