/* ==============================================================
   ÓPTICAS LINKS HUB - ESTILOS PRINCIPAIS (MOBILE-FIRST)
   ============================================================== */

:root {
  --primary: #0d1b2a;
  --secondary: #1b263b;
  --accent: #d4af37;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  --whatsapp-color: #25d366;
  --whatsapp-hover: #1ebd59;
  --route-color: #2563eb;
  --route-hover: #1d4ed8;
  --site-color: #475569;
  --site-hover: #334155;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.page-body {
  font-family: 'Montserrat', sans-serif;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0d1b2a 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 30px;
  -webkit-font-smoothing: antialiased;
}

/* ================== FLOATING BRAND SWITCHER (DEMO) ================== */
.brand-switcher-bar {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.8rem;
  z-index: 100;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  margin-bottom: 12px;
}

.switcher-label {
  color: #94a3b8;
  font-weight: 500;
}

.switcher-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.switcher-btn:hover,
.switcher-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.switcher-admin-link {
  margin-left: auto;
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.15);
  transition: background 0.2s ease;
}

.switcher-admin-link:hover {
  background: rgba(56, 189, 248, 0.3);
}

/* ================== FORMATO SMARTPHONE (MOCKUP REALISTA) ================== */
.smartphone-frame-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 12px;
  flex: 1;
}

.smartphone-device {
  width: 100%;
  max-width: 424px;
  height: min(880px, calc(100vh - 75px));
  background-color: var(--bg-color);
  border: 12px solid #1e293b;
  border-radius: 48px;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 0 0 2px rgba(255, 255, 255, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Dynamic Island / Top Phone Notch */
.smartphone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 116px;
  height: 24px;
  background: #000000;
  border-radius: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.notch-speaker {
  width: 40px;
  height: 4px;
  background: #27272a;
  border-radius: 4px;
}

.notch-camera {
  width: 10px;
  height: 10px;
  background: #18181b;
  border-radius: 50%;
  border: 1.5px solid #27272a;
  box-shadow: inset 0 0 3px #38bdf8;
}

/* Smartphone Screen Interior */
.smartphone-screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  padding-top: 24px;
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
}

.smartphone-screen::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Barra inferior Home do Smartphone */
.smartphone-home-bar {
  width: 130px;
  height: 4px;
  background: #94a3b8;
  border-radius: 4px;
  margin: 6px auto;
  opacity: 0.6;
}

/* ================== MAIN HUB CONTAINER ================== */
.hub-container {
  width: 100%;
  padding: 16px 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Responsividade Nativa para Celulares Reais */
@media (max-width: 500px) {
  body.page-body {
    background: var(--bg-color);
    padding: 0;
  }

  .brand-switcher-bar {
    border-radius: 0;
    max-width: 100%;
    margin-bottom: 0;
  }

  .smartphone-frame-container {
    padding: 0;
  }

  .smartphone-device {
    border: none;
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
    height: auto;
    min-height: 100vh;
  }

  .smartphone-notch,
  .smartphone-home-bar {
    display: none;
  }

  .smartphone-screen {
    padding-top: 0;
    overflow: visible;
    height: auto;
  }

  .hub-container {
    padding: 20px 14px 40px;
  }
}

/* ================== BRAND HEADER ================== */
.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 0 6px;
}

.profile-avatar-wrapper {
  position: relative;
  width: 98px;
  height: 98px;
  margin-bottom: 14px;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3.5px solid var(--accent);
  box-shadow: var(--shadow-md);
  background: #fff;
  transition: transform 0.3s ease;
}

.profile-avatar:hover {
  transform: scale(1.04);
}

.verified-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--route-color);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  box-shadow: var(--shadow-sm);
}

.brand-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.brand-bio {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 440px;
  margin-bottom: 18px;
}

/* Quick Action Pills */
.quick-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.instagram-pill {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
}

.instagram-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.whatsapp-pill {
  background: var(--whatsapp-color);
  color: #fff;
}

.whatsapp-pill:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.review-pill {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

.review-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-2px);
}

.text-gold {
  color: #f59e0b;
}

/* ================== STORES SECTION ================== */
.stores-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title-wrapper {
  margin-bottom: 4px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-top: 3px;
}

.stores-rows-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ================== STORE ROW CARD (LINHAS, NÃO COLUNAS) ================== */
.store-row-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.store-row-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.store-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-photo-box {
  width: 68px;
  height: 68px;
  min-width: 68px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.store-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.store-row-card:hover .store-photo {
  transform: scale(1.08);
}

.store-info-box {
  flex: 1;
  min-width: 0;
}

.store-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-address {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.store-address i {
  color: var(--route-color);
  margin-right: 3px;
}

.store-phone-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

/* Action Buttons Toolbar */
.store-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
}

.btn-store-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-align: center;
}

.btn-store-action:active {
  transform: scale(0.96);
}

.btn-whatsapp {
  background: rgba(37, 211, 102, 0.12);
  color: #128c7e;
  border: 1px solid rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
  background: var(--whatsapp-color);
  color: #fff;
  border-color: var(--whatsapp-color);
}

.btn-route {
  background: rgba(37, 99, 235, 0.1);
  color: var(--route-color);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.btn-route:hover {
  background: var(--route-color);
  color: #fff;
  border-color: var(--route-color);
}

.btn-site {
  background: rgba(71, 85, 105, 0.08);
  color: var(--site-color);
  border: 1px solid rgba(71, 85, 105, 0.25);
}

.btn-site:hover {
  background: var(--site-color);
  color: #fff;
  border-color: var(--site-color);
}

/* ================== FOOTER ================== */
.hub-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  margin-top: 8px;
}

.share-qr-btn {
  background: #ffffff;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.share-qr-btn:hover {
  background: var(--primary);
  color: #fff;
}

.guarantee-box {
  background: rgba(212, 175, 55, 0.08);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.guarantee-box i {
  font-size: 1.8rem;
  color: var(--accent);
}

.guarantee-box strong {
  display: block;
  font-size: 0.84rem;
  color: var(--primary);
  margin-bottom: 2px;
}

.guarantee-box p {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.copyright-text {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ================== MODAL DE QR CODE ================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 360px;
  width: 100%;
  padding: 24px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #94a3b8;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #0f172a;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 16px;
}

.qrcode-container {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  padding: 12px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.qrcode-container img {
  border-radius: 4px;
}

.qr-url-display {
  font-size: 0.72rem;
  color: #64748b;
  word-break: break-all;
  margin-bottom: 16px;
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.btn-primary-action, .btn-secondary-action {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-primary-action {
  background: var(--primary);
  color: #fff;
}

.btn-primary-action:hover {
  filter: brightness(1.15);
}

.btn-secondary-action {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-secondary-action:hover {
  background: #e2e8f0;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-muted);
}

.loading-spinner i {
  font-size: 2rem;
  color: var(--primary);
}
