:root {
  --navy: #1E2E4A;
  --navy-dark: #0F172A;
  --navy-light: #2D436D;
  --magenta: #FC0F6E;
  --magenta-hover: #E11D48;
  --green: #2C6E49;
  --gold: #C59B27;
  --bg-page: #FFF5F7;
  --bg-card: #FFFFFF;
  --border: rgba(30, 46, 74, 0.08);
  --text-main: #1E2E4A;
  --text-sub: #5C677D;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(92, 86, 82, 0.04);
  --shadow-md: 0 4px 16px rgba(92, 86, 82, 0.05), 0 1px 3px rgba(92, 86, 82, 0.02);
  --shadow-lg: 0 12px 32px rgba(92, 86, 82, 0.07);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, .brand-title {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* ── Top Header ──────────────────────────────────────────────────────── */
.merchant-header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header-brand .brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--magenta), #C2185B);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 18px;
}

.brand-title {
  font-size: 17px;
  color: var(--navy);
  line-height: 1.2;
}

.brand-tag {
  font-size: 11px;
  color: var(--magenta);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.nav-link:hover {
  background: #F1F5F9;
  color: var(--navy);
}

.nav-link.active {
  background: var(--navy);
  color: #FFFFFF;
}

/* ── Language Switcher Button ─────────────────────────────────────── */
.btn-lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #F1F5F9;
  border: 1px solid var(--border);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-lang-switcher:hover {
  background: #E2E8F0;
  border-color: var(--magenta);
  color: var(--magenta);
  transform: translateY(-1px);
}

.btn-lang-switcher .lang-icon {
  font-size: 14px;
}

.header-user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F1F5F9;
  padding: 5px 12px;
  border-radius: 30px;
  border: 1px solid var(--border);
}

.chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--magenta);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-text {
  display: flex;
  flex-direction: column;
}

.chip-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-tier {
  font-size: 9px;
  font-weight: 800;
  color: #B45309;
}

.btn-icon-logout {
  color: #DC2626;
  text-decoration: none;
  font-size: 15px;
  padding: 6px;
}

/* ── Container ───────────────────────────────────────────────────────── */
.merchant-container {
  max-width: 1200px;
  width: 100%;
  margin: 28px auto 60px auto;
  padding: 0 24px;
  flex: 1;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--magenta), #C2185B);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--magenta-hover);
  transform: translateY(-1px);
}

.btn-primary-sm {
  background: var(--magenta);
  color: #fff;
  text-decoration: none;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary-sm {
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--navy);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary {
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--navy);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.w-100 { width: 100%; }

/* ── Hero & Search on Landing ────────────────────────────────────────── */
.hero-card {
  background: linear-gradient(135deg, #1E2E4A 0%, #0F172A 100%);
  border-radius: var(--radius-lg);
  padding: 48px;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 32px;
}

.hero-badge {
  display: inline-block;
  background: rgba(252, 15, 110, 0.2);
  color: #FF70A6;
  border: 1px solid rgba(252, 15, 110, 0.4);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: 38px;
  line-height: 1.2;
  margin-bottom: 16px;
  max-width: 760px;
}

.hero-subtitle {
  font-size: 16px;
  color: #CBD5E1;
  max-width: 680px;
  margin-bottom: 32px;
  line-height: 1.6;
}

.claim-search-box {
  display: flex;
  gap: 12px;
  max-width: 640px;
  background: #FFFFFF;
  padding: 6px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  margin-bottom: 24px;
}

.claim-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  color: var(--text-main);
}

.btn-claim-search {
  background: var(--magenta);
  color: #fff;
  border: none;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

/* ── Content Card & Form Elements ────────────────────────────────────── */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.card-title-bar h3 {
  font-size: 18px;
  color: var(--navy);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.form-input,
.form-control,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  height: 48px;
  padding: 12px 16px;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background: #FFFFFF;
  outline: none;
  transition: all 0.2s ease-in-out;
  display: block;
}

textarea {
  height: auto;
  min-height: 100px;
}

.form-input:focus,
.form-control:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  border-color: var(--magenta);
  background: #FFFFFF;
  box-shadow: 0 0 0 3.5px rgba(252, 15, 110, 0.12);
}

.field-hint {
  font-size: 11.5px;
  color: var(--text-sub);
  margin-top: 6px;
  display: block;
  line-height: 1.4;
}

/* ── Metrics Grid ────────────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.metric-icon {
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 8px;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--navy);
}

.metric-label {
  font-size: 13px;
  color: var(--text-sub);
}

/* ── Dropzone ────────────────────────────────────────────────────────── */
.upload-dropzone {
  border: 2px dashed #CBD5E1;
  border-radius: var(--radius-md);
  padding: 36px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #F8FAFC;
}

.upload-dropzone:hover {
  border-color: var(--magenta);
  background: #FFF1F6;
}

.upload-icon {
  font-size: 32px;
  color: var(--magenta);
  margin-bottom: 12px;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.merchant-footer {
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-sub);
}

.footer-links a {
  color: var(--magenta);
  text-decoration: none;
  font-weight: 600;
}

/* ── Directory Grid & Business Card Elements ───────────────────────── */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  margin-bottom: 32px;
}

.biz-card {
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.biz-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.09);
  border-color: #CBD5E1;
}

.biz-card-img-wrap {
  height: 160px;
  max-height: 160px;
  background: #F1F5F9;
  position: relative;
  overflow: hidden;
  display: block;
}

.biz-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.biz-card:hover .biz-card-img {
  transform: scale(1.03);
}

.biz-card-fallback-badge {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E2E4A 0%, #2D436D 100%);
  color: #fff;
  gap: 8px;
}

.biz-card-badge-top {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255,255,255,0.95);
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.biz-card-promoted-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.biz-card-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.biz-title {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  line-height: 1.3;
}

.biz-title a {
  color: var(--navy);
  text-decoration: none;
  transition: color 0.2s;
}

.biz-title a:hover {
  color: var(--magenta);
}

.biz-address {
  font-size: 12.5px;
  color: var(--text-sub);
  margin-bottom: 14px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.biz-actions-row {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #F1F5F9;
  align-items: center;
}

.btn-biz-call {
  flex: 1;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-biz-wa {
  flex: 1;
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-biz-claim {
  background: linear-gradient(135deg, var(--magenta), #C2185B);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(252, 15, 110, 0.25);
  white-space: nowrap;
}

/* ── Mobile Navigation Drawer ───────────────────────────────────────── */
.mobile-nav-toggle {
  display: none;
  background: #F1F5F9;
  border: 1px solid var(--border);
  color: var(--navy);
  font-size: 18px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-right: 8px;
}

.mobile-nav-toggle:hover {
  background: var(--magenta-light, #FFF0F6);
  color: var(--magenta);
}

.mobile-nav-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.mobile-nav-drawer.active {
  display: block;
}

.mobile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeInBackdrop 0.25s ease forwards;
}

.mobile-drawer-content {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.2);
  animation: slideInDrawer 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 10;
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInDrawer {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.mobile-drawer-header {
  padding: 18px 16px;
  background: linear-gradient(135deg, var(--navy), #121D30);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-drawer-header .user-chip {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.mobile-drawer-header .chip-name {
  color: #fff;
}

.mobile-drawer-header .chip-tier {
  color: var(--gold);
}

.mobile-drawer-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.mobile-drawer-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #475569;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.15s ease;
}

.drawer-nav-item i {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.drawer-nav-item:hover {
  background: #F8FAFC;
  color: var(--navy);
}

.drawer-nav-item.active {
  background: #FFF0F6;
  color: var(--magenta);
  font-weight: 700;
}

.mobile-drawer-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #F8FAFC;
}

.btn-logout-drawer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-logout-drawer:hover {
  background: #F87171;
  color: #fff;
}

/* ── Comprehensive 100% Mobile Friendly Responsive System ────────── */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

@media (max-width: 992px) {
  .header-nav { display: none; }
  .header-user-menu { display: none; }
  .mobile-nav-toggle { display: flex; }
}

@media (max-width: 768px) {
  .d-none-mobile { display: none !important; }
  
  .header-inner {
    padding: 10px 14px;
    gap: 8px;
  }
  
  .brand-badge {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }
  
  .brand-title {
    font-size: 14px;
    letter-spacing: -0.01em;
  }
  
  .brand-tag {
    font-size: 8.5px;
  }

  .header-actions {
    gap: 6px;
  }

  .btn-primary-sm, .btn-secondary-sm {
    padding: 6px 10px;
    font-size: 11.5px;
    border-radius: 8px;
  }

  .btn-lang-switcher {
    padding: 5px 8px;
    font-size: 11px;
  }

  .merchant-container {
    padding: 0 12px;
    margin: 14px auto 36px auto;
  }

  .directory-hero, .hero-card {
    padding: 22px 16px !important;
    border-radius: 18px !important;
    margin-bottom: 18px !important;
  }

  .directory-hero h1, .hero-title {
    font-size: clamp(19px, 5.2vw, 26px) !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .directory-hero p, .hero-desc {
    font-size: 12.5px !important;
    line-height: 1.45 !important;
  }

  .dir-search-wrap {
    flex-direction: column !important;
    padding: 6px !important;
    gap: 8px !important;
    border-radius: 14px !important;
  }

  .dir-search-wrap input {
    width: 100% !important;
    font-size: 13.5px !important;
    padding: 8px 10px !important;
  }

  .dir-search-wrap button {
    width: 100% !important;
    padding: 10px !important;
    justify-content: center !important;
    border-radius: 10px !important;
  }

  .hero-stats-row {
    gap: 12px !important;
    margin-top: 16px !important;
  }

  .hero-stat-item {
    font-size: 11.5px !important;
  }

  .cat-pill-row {
    gap: 6px !important;
    padding-bottom: 6px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cat-pill {
    font-size: 11.5px !important;
    padding: 6px 12px !important;
    white-space: nowrap;
  }

  .directory-grid, .grid-3, .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .dash-stats-grid, .stats-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .stat-card {
    padding: 14px !important;
    border-radius: 12px !important;
  }

  .stat-value {
    font-size: 22px !important;
  }

  .plans-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .photos-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .claim-search-box {
    flex-direction: column !important;
  }

  .claim-search-box input, .claim-search-box button {
    width: 100% !important;
  }

  .footer-inner {
    flex-direction: column !important;
    gap: 10px !important;
    text-align: center !important;
    padding: 20px 14px !important;
  }
}

@media (max-width: 420px) {
  .brand-title {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .dash-stats-grid, .stats-row {
    grid-template-columns: 1fr !important;
  }

  .photos-grid {
    grid-template-columns: 1fr !important;
  }
}
