/* ==========================================================================
   IngramShop Brand Link Hub — Stylesheet
   Palette: Vibrant Orange (#FF6B00), Golden Yellow (#FFB800), Crisp White (#FFFFFF)
   Font: Noto Sans Thai
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --brand-orange: #FF6B00;
  --brand-orange-dark: #E05500;
  --brand-orange-deep: #C2410C;
  --brand-yellow: #FFB800;
  --brand-yellow-light: #FFE699;
  --brand-cream: #FFFDF9;
  --brand-cream-tint: #FFF6E8;
  --surface-white: #FFFFFF;
  --text-primary: #1F1610;
  --text-secondary: #68564A;
  --text-muted: #9A877A;
  --border-warm: #F2E3D5;
  --border-highlight: #FFD0A6;
  --success-green: #10B981;
  --success-bg: #ECFDF5;
  --danger-red: #EF4444;
  --danger-bg: #FEF2F2;
  --warning-amber: #D97706;
  --warning-bg: #FFFBEB;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 9999px;

  --shadow-card: 0 4px 14px -2px rgba(31, 22, 16, 0.05), 0 2px 6px -1px rgba(255, 107, 0, 0.04);
  --shadow-card-hover: 0 10px 22px -4px rgba(255, 107, 0, 0.14), 0 4px 10px -2px rgba(31, 22, 16, 0.06);
  --shadow-primary: 0 10px 24px -4px rgba(255, 107, 0, 0.38), 0 4px 10px -2px rgba(255, 184, 0, 0.25);
  --shadow-primary-hover: 0 14px 28px -4px rgba(255, 107, 0, 0.48), 0 6px 14px -2px rgba(255, 184, 0, 0.32);

  --font-sans: 'Noto Sans Thai', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--brand-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--brand-cream);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* ==========================================================================
   Subtle Brand Decorative Background (ไม่รก ไม่แย่งความเด่นจากปุ่ม)
   ========================================================================== */

.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 184, 0, 0.22) 0%, rgba(255, 107, 0, 0.08) 38%, transparent 70%),
    radial-gradient(circle at 90% 85%, rgba(255, 184, 0, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 10% 75%, rgba(255, 107, 0, 0.07) 0%, transparent 45%),
    linear-gradient(180deg, #FFF9EE 0%, #FFFDF9 45%, #FFFBF4 100%);
}

.bg-hex {
  position: absolute;
  opacity: 0.055;
  color: var(--brand-orange);
}

.bg-hex--top-left {
  top: 6%;
  left: max(3%, calc(50% - 360px));
  width: 96px;
  height: 96px;
  transform: rotate(-12deg);
}

.bg-hex--top-right {
  top: 12%;
  right: max(3%, calc(50% - 370px));
  width: 72px;
  height: 72px;
  color: var(--brand-yellow);
  opacity: 0.12;
  transform: rotate(18deg);
}

.bg-hex--bottom {
  bottom: 10%;
  left: max(4%, calc(50% - 340px));
  width: 64px;
  height: 64px;
  transform: rotate(22deg);
}

/* ==========================================================================
   Public Storefront Layout (กว้างไม่เกิน 480px อยู่กึ่งกลางจอ)
   ========================================================================== */

.public-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 18px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .public-shell {
    padding: 40px 20px 36px;
  }
}

.public-main {
  width: 100%;
}

/* ==========================================================================
   Brand Profile Header
   ========================================================================== */

.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

.brand-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, rgba(255, 184, 0, 0.22), rgba(255, 107, 0, 0.14));
  border: 1px solid rgba(255, 107, 0, 0.22);
  color: var(--brand-orange-deep);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 14px;
}

.brand-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.22);
}

.brand-logo-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 26px;
  padding: 4px;
  background: linear-gradient(135deg, var(--brand-yellow) 0%, var(--brand-orange) 100%);
  box-shadow: 0 10px 24px -6px rgba(255, 107, 0, 0.35);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-inner {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  background-color: var(--surface-white);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-inner svg,
.brand-logo-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-verified-pin {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-white);
  padding: 2px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-orange);
}

.brand-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

.brand-name {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.brand-description {
  margin-top: 6px;
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ==========================================================================
   Channel Link Buttons (ปุ่มขนาดใหญ่ เรียงแนวตั้ง พื้นที่สัมผัส >= 48px)
   ========================================================================== */

.links-stack {
  display: flex;
  flex-direction: column;
  gap: 13px;
  width: 100%;
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 68px; /* สูงกว่าเกณฑ์ขั้นต่ำ 48px เพื่อความสะดวกบนมือถือ */
  padding: 13px 16px;
  border-radius: var(--radius-lg);
  background-color: var(--surface-white);
  border: 1.5px solid var(--border-warm);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  overflow: hidden;
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-card-hover);
}

.link-card:active {
  transform: scale(0.988);
}

.link-card:focus-visible {
  outline: 3px solid var(--brand-yellow);
  outline-offset: 2px;
}

/* ปุ่มหลักที่เด่นที่สุด (Primary Featured CTA - เช่น เว็บไซต์สั่งซื้อ) */
.link-card--primary {
  background: linear-gradient(135deg, #FF6B00 0%, #FF8800 58%, #FFB000 100%);
  border-color: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  box-shadow: var(--shadow-primary);
  padding-top: 15px;
  padding-bottom: 15px;
}

.link-card--primary::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 130px;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.24), transparent 70%);
  pointer-events: none;
}

.link-card--primary:hover {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow-primary-hover);
}

/* ไอคอนด้านซ้ายของปุ่ม */
.link-icon-box {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--icon-bg, #FFF3E6);
  color: var(--icon-color, var(--brand-orange));
  transition: transform 0.16s ease;
}

.link-icon-box svg {
  width: 24px;
  height: 24px;
  display: block;
}

.link-card--primary .link-icon-box {
  background-color: #FFFFFF;
  color: var(--brand-orange);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

/* ข้อความภายในปุ่ม: รองรับชื่อปุ่มยาวโดยข้อความไม่ล้นหรือทับไอคอน */
.link-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  text-align: left;
}

.link-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.link-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  color: inherit;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.link-card--primary .link-title {
  font-size: 1.06rem;
  font-weight: 800;
  color: #FFFFFF;
}

.link-primary-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.link-unconfigured-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background-color: rgba(217, 119, 6, 0.14);
  color: #B45309;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.link-card--primary .link-unconfigured-pill {
  background-color: rgba(0, 0, 0, 0.22);
  color: #FFFBEB;
}

.link-description {
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.link-card--primary .link-description {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

/* สัญลักษณ์ลูกศรด้านขวา */
.link-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background-color: #FAF5F0;
  transition: transform 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.link-arrow svg {
  width: 18px;
  height: 18px;
}

.link-card:hover .link-arrow {
  transform: translateX(2px);
  background-color: #FFF0E0;
  color: var(--brand-orange);
}

.link-card--primary .link-arrow {
  background-color: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.link-card--primary:hover .link-arrow {
  background-color: #FFFFFF;
  color: var(--brand-orange);
}

/* Empty links fallback */
.links-empty {
  text-align: center;
  padding: 28px 20px;
  background: var(--surface-white);
  border: 1.5px dashed var(--border-warm);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ==========================================================================
   Public Footer (เวลาให้บริการ + © IngramShop พร้อมปีปัจจุบันอัตโนมัติ)
   ========================================================================== */

.public-footer {
  margin-top: 32px;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.service-hours-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  background-color: var(--surface-white);
  border: 1px solid var(--border-warm);
  box-shadow: 0 2px 6px rgba(31, 22, 16, 0.04);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.service-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
}

.copyright-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: calc(100% - 32px);
  max-width: 440px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-msg {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background-color: #1F1610;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  border-left: 4px solid var(--brand-yellow);
  animation: toastSlideUp 0.2s ease-out;
}

.toast-msg--success {
  background-color: #065F46;
  border-left-color: #34D399;
}

.toast-msg--error {
  background-color: #991B1B;
  border-left-color: #F87171;
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Admin Dashboard Styles (/admin)
   ========================================================================== */

.admin-body {
  background-color: #FAF6F0;
  min-height: 100vh;
}

/* Login View */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border-warm);
  box-shadow: 0 16px 36px -8px rgba(31, 22, 16, 0.08);
  padding: 28px 24px;
}

.login-header {
  text-align: center;
  margin-bottom: 22px;
}

.login-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 12px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 18px -4px rgba(255, 107, 0, 0.35);
}

.login-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Admin Topbar */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-warm);
  padding: 12px 16px;
}

.admin-topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  overflow: hidden;
  flex-shrink: 0;
}

.admin-brand-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.admin-brand-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Unsaved Status Bar */
.status-banner {
  max-width: 1240px;
  margin: 14px auto 0;
  padding: 0 16px;
}

.status-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
}

.status-alert--unsaved {
  background-color: var(--warning-bg);
  border: 1.5px solid #F59E0B;
  color: #92400E;
}

.status-alert--success {
  background-color: var(--success-bg);
  border: 1.5px solid #10B981;
  color: #065F46;
}

.status-alert--error {
  background-color: var(--danger-bg);
  border: 1.5px solid #EF4444;
  color: #991B1B;
}

/* Mobile Tab Switcher (แก้ไขข้อมูล vs ตัวอย่างหน้าเว็บ) */
.mobile-mode-tabs {
  display: flex;
  max-width: 1240px;
  margin: 14px auto 0;
  padding: 0 16px;
}

.mobile-mode-tabs-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  background: #EFE6DC;
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.mode-tab-btn {
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
}

.mode-tab-btn.is-active {
  background: var(--surface-white);
  color: var(--brand-orange-deep);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

@media (min-width: 960px) {
  .mobile-mode-tabs {
    display: none;
  }
}

/* Main Admin Split Grid */
.admin-workspace {
  max-width: 1240px;
  margin: 16px auto 80px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

@media (min-width: 960px) {
  .admin-workspace {
    grid-template-columns: minmax(0, 1.25fr) 420px;
  }
}

.admin-pane-hidden-mobile {
  display: none;
}

@media (min-width: 960px) {
  .admin-pane-hidden-mobile {
    display: block !important;
  }
}

/* Admin Section Cards */
.admin-section {
  background: var(--surface-white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border-warm);
  box-shadow: var(--shadow-card);
  padding: 20px 18px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .admin-section {
    padding: 24px;
  }
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-warm);
}

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

.section-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Form Controls */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.form-hint {
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #E2D5C8;
  background-color: #FFFFFF;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}

.form-input.is-invalid {
  border-color: var(--danger-red);
  background-color: #FFF5F5;
}

.field-error-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--danger-red);
}

.field-warning-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--warning-amber);
}

/* Logo Editor Row */
.logo-editor-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px;
  border-radius: var(--radius-md);
  background-color: #FFFBF5;
  border: 1px solid var(--border-warm);
}

.logo-preview-thumb {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--brand-orange);
  background: var(--surface-white);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-preview-thumb svg,
.logo-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-editor-controls {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logo-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(135deg, var(--brand-orange) 0%, #FF8C00 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.28);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-orange-dark) 0%, var(--brand-orange) 100%);
}

.btn--secondary {
  background-color: var(--surface-white);
  border-color: #DECBB8;
  color: var(--text-primary);
}

.btn--secondary:hover:not(:disabled) {
  background-color: #FFF6EB;
  border-color: var(--brand-orange);
}

.btn--danger-ghost {
  background-color: transparent;
  border-color: #FECACA;
  color: #DC2626;
}

.btn--danger-ghost:hover:not(:disabled) {
  background-color: #FEF2F2;
}

.btn--sm {
  min-height: 36px;
  padding: 5px 11px;
  font-size: 0.8rem;
}

/* ==========================================================================
   Admin Link Items List (Drag & Drop + Up/Down + Primary + Enable Toggle)
   ========================================================================== */

.admin-links-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-link-item {
  background: var(--surface-white);
  border: 1.5px solid #E6D7C8;
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  position: relative;
}

.admin-link-item.is-primary-item {
  border-color: var(--brand-orange);
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.1);
  background: linear-gradient(180deg, #FFF9F2 0%, #FFFFFF 35%);
}

.admin-link-item.is-disabled-item {
  opacity: 0.68;
  background-color: #F9F6F2;
  border-style: dashed;
}

.admin-link-item.is-dragging {
  opacity: 0.55;
  border: 2px dashed var(--brand-orange);
  box-shadow: 0 12px 24px rgba(255, 107, 0, 0.18);
}

.admin-link-item.is-drag-over {
  border-top: 3px solid var(--brand-orange);
}

.admin-link-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F2E8DEC0;
}

.admin-link-order-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background-color: #F6EFE8;
  color: var(--text-secondary);
  cursor: grab;
  touch-action: none;
  user-select: none;
  border: 1px solid #E5D6C7;
}

.drag-handle:active {
  cursor: grabbing;
  background-color: #FFE8D1;
  color: var(--brand-orange);
}

.order-step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid #E5D6C7;
  background-color: var(--surface-white);
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.order-step-btn:hover:not(:disabled) {
  background-color: #FFF3E4;
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

.order-step-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.order-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0 4px;
}

.admin-link-toggles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Primary Star Button */
.primary-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #E5D6C7;
  background-color: var(--surface-white);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.primary-select-btn.is-active {
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-yellow) 100%);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 3px 8px rgba(255, 107, 0, 0.25);
}

/* Enable/Disable Toggle Switch */
.toggle-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  user-select: none;
  min-height: 34px;
  padding: 2px 6px;
}

.toggle-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  background-color: #D6C8BC;
  border-radius: var(--radius-pill);
  transition: background-color 0.18s ease;
}

.toggle-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background-color: #FFFFFF;
  border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch-input:checked + .toggle-switch-track {
  background-color: var(--success-green);
}

.toggle-switch-input:checked + .toggle-switch-track .toggle-switch-thumb {
  transform: translateX(18px);
}

/* Icon Selector Row inside Link Editor */
.icon-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background-color: #FBF7F2;
  border: 1px solid #EDE0D4;
  margin-top: 4px;
}

.icon-current-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-preview-chip {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-preview-chip svg {
  width: 21px;
  height: 21px;
}

.icon-mode-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.icon-mode-sub {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* Icon Picker Gallery Grid */
.icon-picker-drawer {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  border: 1.5px solid #E5D5C5;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.icon-choice-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  min-height: 42px;
  border-radius: 10px;
  border: 1.5px solid #E8DDD2;
  background-color: #FFFFFF;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.14s ease;
  text-align: left;
}

.icon-choice-btn:hover {
  border-color: var(--brand-orange);
  background-color: #FFF9F2;
}

.icon-choice-btn.is-selected {
  border-color: var(--brand-orange);
  background-color: #FFF2E2;
  color: var(--brand-orange-deep);
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.15);
}

.icon-choice-svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-choice-svg svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Sticky Live Preview Column in Admin
   ========================================================================== */

.preview-sticky-col {
  position: sticky;
  top: 82px;
}

.preview-frame-card {
  background: var(--surface-white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border-warm);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

.preview-frame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-warm);
}

.preview-badge-draft {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  background-color: #FFF3E0;
  color: var(--brand-orange-deep);
}

.preview-device-viewport {
  border-radius: 26px;
  border: 6px solid #2A1F18;
  background-color: var(--brand-cream);
  overflow-y: auto;
  max-height: 76vh;
  position: relative;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.04);
}

.preview-device-viewport .public-shell {
  min-height: 540px;
  padding: 24px 14px 24px;
}
