/* ======================================
   Base reset
   ====================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #f5f5f5;
    color: #111827;
    font-size: 14px;
    line-height: 1.4;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout container */

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 12px;
}

.page-wrapper {
    min-height: calc(100vh - 130px);
    padding: 16px 0 32px;
}

/* Small helpers */

.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }

.text-muted {
    color: #6b7280;
}

/* Generic white card container */

.container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px 18px;
    margin-bottom: 16px;
}

/* ======================================
   Typography
   ====================================== */

h1, h2, h3 {
    margin: 0 0 8px;
    font-weight: 600;
}

h1 {
    font-size: 22px;
}

h2 {
    font-size: 18px;
}

h3 {
    font-size: 16px;
}

/* ======================================
   Buttons
   ====================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 4px;
    font-size: 14px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    line-height: 1.2;
}

.btn i {
    margin-right: 6px;
}

.btn-secondary {
    background: #ffffff;
    color: #2563eb;
    border-color: #d1d5db;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: #2563eb;
}

.btn-header {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ======================================
   Alerts
   ====================================== */

.alert {
    padding: 8px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
}

.alert-success {
    border: 1px solid #10b981;
    background: #ecfdf5;
    color: #047857;
}

.alert-error {
    border: 1px solid #ef4444;
    background: #fef2f2;
    color: #b91c1c;
}

/* ======================================
   Breadcrumb / nav links
   ====================================== */

.nav-links {
    font-size: 13px;
    margin-bottom: 10px;
}

.nav-links a {
    margin-right: 8px;
}

/* ======================================
   HEADER (sticky + responsive, no shadow)
   ====================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    gap: 16px;
}

/* Brand */

.brand-block {
    flex-shrink: 0;
}

.brand-main {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #111827;
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #2563eb;
    background: #e5f0ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 16px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.01em;
}

.brand-subtitle {
    font-size: 11px;
    color: #6b7280;
}

/* Navigation */

.main-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #374151;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.main-nav a:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Header CTA */

.header-cta {
    flex-shrink: 0;
}

/* ======================================
   FORMS (generic classes)
   ====================================== */

.form-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    margin-top: 16px;
}

.form-section:first-of-type {
    border-top: none;
    padding-top: 4px;
    margin-top: 8px;
}

.form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.form-section-header h2 {
    font-size: 16px;
    margin: 0;
}

.field {
    margin-bottom: 12px;
}

.field label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 13px;
}

/* Inputs */

.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="tel"],
.field textarea,
.field select {
    width: 100%;
    padding: 7px 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    background-color: #ffffff;
}

.field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Icon wrapper */

.field-icon-wrap {
    position: relative;
}

.field-icon-wrap i {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #9ca3af;
}

.field-icon-wrap input[type="text"],
.field-icon-wrap input[type="email"],
.field-icon-wrap input[type="url"],
.field-icon-wrap input[type="tel"],
.field-icon-wrap textarea,
.field-icon-wrap select {
    padding-left: 26px;
}

/* Grid helpers (still used by some pages) */

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px 16px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
}

/* ======================================
   Company listings page
   ====================================== */

.company-card {
    display: flex;
    border-top: 1px solid #e5e7eb;
    padding: 10px 0;
}

.company-card:first-of-type {
    border-top: none;
}

.company-logo {
    width: 70px;
    min-width: 70px;
    height: 70px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 11px;
    color: #9ca3af;
    margin-right: 12px;
}

.company-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.company-info h3 {
    margin-bottom: 4px;
}

.company-meta {
    font-size: 12px;
    color: #6b7280;
}

.list-badges {
    margin-top: 4px;
    font-size: 12px;
}

.list-badges span {
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 2px 7px;
    margin-right: 6px;
}

.links {
    margin-top: 6px;
    font-size: 13px;
}

.links a i {
    margin-right: 4px;
}

.empty {
    color: #6b7280;
    font-size: 13px;
}

/* ======================================
   Business detail page
   ====================================== */

.business-layout {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.business-sidebar {
    width: 170px;
    min-width: 170px;
}

.business-main {
    flex: 1;
}

.logo-box {
    width: 120px;
    height: 120px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 10px;
}

.logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.business-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.business-title {
    margin-bottom: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    border: 1px solid #e5e7eb;
    font-size: 12px;
    margin-right: 6px;
    margin-top: 4px;
}

.badge i {
    margin-right: 4px;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 14px;
    margin-top: 4px;
}

.meta-row {
    font-size: 13px;
    color: #4b5563;
}

.meta-row i {
    width: 14px;
    margin-right: 4px;
}

.profile-section {
    margin-top: 14px;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
}

.profile-section h2 {
    font-size: 16px;
    margin-bottom: 6px;
}

.profile-section h2 i {
    margin-right: 6px;
}

.profile-address-line {
    font-size: 14px;
}

/* ======================================
   Home page sections
   ====================================== */

.home-section {
    margin-top: 16px;
}

.home-section h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

.home-muted {
    font-size: 13px;
    color: #6b7280;
}

/* How it works */

.home-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 16px;
    margin-top: 10px;
}

.home-step {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
}

.home-step-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.home-step-number {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-right: 8px;
}

/* Popular categories */

.home-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.home-category-pill {
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    color: #374151;
}

.home-category-pill i {
    margin-right: 4px;
}

/* Latest listings */

.home-latest {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px 14px;
    margin-top: 8px;
}

.home-latest-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
}

.home-latest-card h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.home-latest-meta {
    font-size: 12px;
    color: #6b7280;
}

.home-latest-links {
    margin-top: 6px;
}

/* ======================================
   Footer
   ====================================== */

.footer-categories {
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 10px 0 6px;
}

.footer-categories-inner {
    padding-top: 2px;
}

.footer-categories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.footer-categories-title {
    font-weight: 600;
}

.footer-categories-title i {
    margin-right: 6px;
}

.footer-link-all {
    font-size: 12px;
    color: #2563eb;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-list a {
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 12px;
    color: #374151;
}

.category-list a:hover {
    background: #f3f4f6;
}

/* Main footer */

.site-footer {
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    padding-top: 8px;
    font-size: 13px;
    color: #4b5563;
}

.footer-main {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 24px;
    padding: 6px 0 10px;
}

.footer-col {
    flex: 1;
    min-width: 210px;
}

.footer-brand {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.footer-brand-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid #2563eb;
    background: #e5f0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 13px;
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
}

.footer-brand-title {
    font-weight: 700;
}

.footer-brand-subtitle {
    font-size: 11px;
    color: #6b7280;
}

.footer-col h3 {
    font-size: 14px;
    margin: 0 0 6px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 4px;
}

.footer-links a i {
    margin-right: 6px;
}

/* Footer bottom strip */

.footer-bottom {
    border-top: 1px solid #e5e7eb;
    padding: 6px 0 8px;
    font-size: 12px;
    color: #6b7280;
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.footer-bottom-actions a {
    margin-left: 10px;
}

/* ======================================
   RESPONSIVE
   ====================================== */

@media (max-width: 768px) {
    /* Header stacking */
    .site-header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 8px 0 10px;
    }

    .brand-main {
        margin-bottom: 2px;
    }

    .main-nav {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
        width: 100%;
    }

    .main-nav a {
        font-size: 13px;
        padding: 4px 8px;
    }

    .header-cta {
        width: 100%;
    }

    .btn-header {
        width: 100%;
        justify-content: center;
    }

    /* Containers a bit tighter */
    .container {
        padding: 14px 12px;
        border-radius: 0;
    }

    /* Business layout becomes single column */
    .business-layout {
        flex-direction: column;
    }

    .business-sidebar {
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .logo-box {
        margin-bottom: 0;
    }

    .meta-grid {
        grid-template-columns: 1fr;
    }

    /* Footer stack */
    .footer-main {
        flex-direction: column;
    }

    .footer-bottom-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}
