/**
 * Editor4 Runtime Component CSS
 *
 * Styles for components that need CSS outside the GrapesJS editor context.
 * Loaded by _preview.php and shop_shell.php so header/footer components
 * render correctly on all pages.
 *
 * Components covered:
 * - Social Bar (so-social-links / so-sb-*)
 * - Share Bar (so-social-share-bar / so-shb-*)
 * - (Facebook Like Button removed 21 Sep 2026, #358 — Meta retired the standalone Like plugin)
 * - Navbar (so-navbar / so-nav-*)
 * - Icon (so-icon)
 * - Shape Divider (so-shape-divider)
 * - Image Carousel placeholder
 */

/* ============================================
   SOCIAL BAR
   ============================================ */
.so-social-links { width: 100%; position: relative; }
.so-sb-inner { display: flex; flex-wrap: wrap; gap: var(--so-sb-spacing, 12px); padding: 12px; align-items: center; }
.so-sb-horizontal { flex-direction: row; }
.so-sb-vertical { flex-direction: column; }
.so-sb-align-left { justify-content: flex-start; }
.so-sb-align-center { justify-content: center; }
.so-sb-align-right { justify-content: flex-end; }
.so-sb-icon { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease; flex-shrink: 0; cursor: pointer; }
.so-sb-icon svg { display: block; }
.so-sb-icon.so-sb-has-custom-icon { overflow: hidden; background: none !important; position: relative; }
.so-sb-icon.so-sb-has-custom-icon img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.so-sb-size-s .so-sb-icon { width: 40px; height: 40px; }
.so-sb-size-s .so-sb-icon svg { width: 22px; height: 22px; }
.so-sb-size-m .so-sb-icon { width: 48px; height: 48px; }
.so-sb-size-m .so-sb-icon svg { width: 26px; height: 26px; }
.so-sb-size-l .so-sb-icon { width: 56px; height: 56px; }
.so-sb-size-l .so-sb-icon svg { width: 30px; height: 30px; }
.so-sb-size-xl .so-sb-icon { width: 64px; height: 64px; }
.so-sb-size-xl .so-sb-icon svg { width: 36px; height: 36px; }
.so-sb-shape-none { background: transparent; }
.so-sb-shape-circle { border-radius: 50%; background: #f0f0f0; }
.so-sb-shape-rounded { border-radius: 6px; background: #f0f0f0; }
.so-sb-shape-square { border-radius: 0; background: #f0f0f0; }
.so-sb-icon.so-sb-filled { background: none; }
.so-sb-icon.so-sb-outline { background: transparent; border: 1px solid var(--so-sb-ring, rgba(0,0,0,0.3)); box-sizing: border-box; } /* outline ring, 7 Oct 2026 — keep in step with so-components.css */
.so-sb-icon.so-sb-outline:hover { border-color: var(--so-sb-ring-solid, currentColor); }
.so-sb-icon.so-sb-hover-lift:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.so-sb-icon.so-sb-hover-grow:hover { transform: scale(1.15); }
.so-sb-icon.so-sb-hover-fade:hover { opacity: 0.7; }
.so-sb-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 20px; min-height: 80px; color: #999; }
@media (max-width: 480px) { .so-sb-inner { flex-wrap: wrap; justify-content: center; } }

/* ============================================
   SHARE BAR
   ============================================ */
.so-social-share-bar { width: 100%; position: relative; }
.so-shb-inner { display: flex; flex-wrap: wrap; gap: var(--so-shb-spacing, 12px); padding: 12px; align-items: center; }
.so-shb-horizontal { flex-direction: row; }
.so-shb-vertical { flex-direction: column; }
.so-shb-align-left { justify-content: flex-start; }
.so-shb-align-center { justify-content: center; }
.so-shb-align-right { justify-content: flex-end; }
.so-shb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; text-decoration: none; transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease; flex-shrink: 0; cursor: pointer; position: relative; font-family: inherit; }
.so-shb-btn svg { display: block; flex-shrink: 0; }
.so-shb-label { font-size: 13px; font-weight: 500; white-space: nowrap; color: inherit; }
.so-shb-size-s .so-shb-btn { min-width: 40px; height: 40px; }
.so-shb-size-s .so-shb-btn svg { width: 22px; height: 22px; }
.so-shb-size-m .so-shb-btn { min-width: 48px; height: 48px; }
.so-shb-size-m .so-shb-btn svg { width: 26px; height: 26px; }
.so-shb-size-l .so-shb-btn { min-width: 56px; height: 56px; }
.so-shb-size-l .so-shb-btn svg { width: 30px; height: 30px; }
.so-shb-size-xl .so-shb-btn { min-width: 64px; height: 64px; }
.so-shb-size-xl .so-shb-btn svg { width: 36px; height: 36px; }
.so-shb-btn.so-shb-has-label { padding: 0 16px; }
.so-shb-shape-none { background: transparent; }
.so-shb-shape-circle { border-radius: 50%; background: #f0f0f0; }
.so-shb-shape-rounded { border-radius: 6px; background: #f0f0f0; }
.so-shb-shape-square { border-radius: 0; background: #f0f0f0; }
.so-shb-shape-pill { border-radius: 50vh; background: #f0f0f0; padding: 0 16px; }
.so-shb-btn.so-shb-filled { background: none; color: #ffffff; }
.so-shb-btn.so-shb-hover-lift:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.so-shb-btn.so-shb-hover-grow:hover { transform: scale(1.15); }
.so-shb-btn.so-shb-hover-fade:hover { opacity: 0.7; }
.so-shb-copied-tooltip { position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 11px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.so-shb-copied-tooltip.show { opacity: 1; }
.so-shb-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 20px; min-height: 80px; color: #999; }
@media (max-width: 480px) { .so-shb-inner { flex-wrap: wrap; justify-content: center; } }

/* ============================================
   FACEBOOK LIKE BUTTON (placeholder)
   ============================================ */

/* ============================================
   NAVBAR
   ============================================ */
.so-navbar { width: 100%; }
.so-navbar-menu { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; align-items: center; }
.so-nav-item { display: inline-block; }
.so-nav-link { text-decoration: none; padding: 6px 12px; color: inherit; }
.so-navbar-toggle { display: none; }
@media (max-width: 768px) {
  .so-navbar-toggle { display: block; background: none; border: none; cursor: pointer; padding: 8px; }
  .so-navbar-toggle-icon { display: flex; flex-direction: column; gap: 4px; }
  .so-navbar-toggle-icon span { display: block; width: 24px; height: 2px; background: var(--so-nav-link-color, #333); } /* follows link colour (7 Oct 2026, header-nav-social) — keep in step with so-components.css */
  .so-navbar-menu { display: none; flex-direction: column; width: 100%; }
  .so-navbar.open .so-navbar-menu { display: flex; }
}

/* ============================================
   ICON
   ============================================ */
.so-icon { display: inline-flex; align-items: center; justify-content: center; }
.so-icon svg { display: block; }

/* ============================================
   BADGE (so-badge — Phase 2, 25 Jun 2026)
   Token classes + inline --so-badge-* vars. Mirrors so-components.css
   so preview/published render the badge with zero JS.
   ============================================ */
.so-badge { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; line-height: 1; background: var(--so-badge-bg, #eef2ff); color: var(--so-badge-color, #1e40af); padding: var(--so-badge-padding, 12px); font-size: var(--so-badge-font-size, 18px); font-weight: 600; }
.so-badge svg { display: block; width: 100%; height: 100%; }
.so-badge-text { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.so-badge-shape-circle { border-radius: 50%; }
.so-badge-shape-rounded { border-radius: 12px; }
.so-badge-shape-pill { border-radius: 999px; }
.so-badge-shape-square { border-radius: 0; }
.so-badge-shape-blob { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
.so-badge-bordered { border: var(--so-badge-border-width, 1px) solid var(--so-badge-border-color, #d1d5db); }
.so-badge-shadow-soft { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.so-badge-shadow-medium { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14); }

/* ============================================
   SHAPE DIVIDER
   ============================================ */
.so-shape-divider { position: absolute; left: 0; right: 0; width: 100%; overflow: hidden; line-height: 0; }
.so-shape-divider--top { top: 0; }
.so-shape-divider--bottom { bottom: 0; }
.so-shape-divider svg { display: block; width: 100%; position: relative; }

/* ============================================
   IMAGE CAROUSEL (placeholder)
   ============================================ */
.so-carousel-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; color: #999; }
.so-carousel-empty-hint { font-size: 12px; margin-top: 8px; }

/* ============================================
   PAGE LINKS
   ============================================ */
.so-page-links { width: 100%; }
.so-page-links-horizontal { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.so-page-links-sep { color: #ccc; }
.so-page-link { text-decoration: none; }

/* ============================================
   GENERAL: Images inside columns
   ============================================ */
img { max-width: 100%; height: auto; }

/* ============================================
   PAGE LINKS: Login state toggle
   Default: show logged-out links, hide logged-in
   When .user-logged-in class added: flip visibility
   ============================================ */
/* Default: hide logged-in links (must beat .so-page-links-horizontal .so-page-link !important) */
.so-page-links-horizontal .so-page-link[data-show-when="logged-in"],
.so-page-links-vertical .so-page-link[data-show-when="logged-in"],
[data-show-when="logged-in"] {
  display: none !important;
}

/* When logged in: flip */
.user-logged-in .so-page-link[data-show-when="logged-in"] {
  display: inline !important;
}
.user-logged-in .so-page-link[data-show-when="logged-out"] {
  display: none !important;
}

/* Hide separators next to hidden links */
[data-show-when="logged-in"] + .so-page-links-sep {
  display: none !important;
}
.user-logged-in [data-show-when="logged-out"] + .so-page-links-sep {
  display: none !important;
}
