:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #eef3f9;
    --border: #dce4ef;
    --text: #122033;
    --muted: #68778d;
    --primary: #0f5bd8;
    --primary-dark: #0c46a7;
    --accent: #ffb84d;
    --success: #0a8a61;
    --shadow: 0 20px 45px rgba(12, 37, 69, 0.08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 91, 216, 0.09), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255, 184, 77, 0.12), transparent 24%),
        var(--bg);
}

a {
    color: inherit;
}

.site-header .navbar,
.site-footer,
.content-card,
.listing-card,
.hero-shell,
.category-card,
.plan-card,
.auth-card,
.empty-state,
.admin-sidebar,
.admin-main,
.market-filter-card {
    border-color: var(--border) !important;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
}

.brand-badge {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #36a3ff);
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 10px 20px rgba(15, 91, 216, 0.25);
}

.header-search {
    width: min(360px, 100%);
}

.header-layout {
    align-items: center;
}

.desktop-left-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: auto;
}

.header-actions {
    margin-left: auto;
    flex-wrap: wrap;
}

.site-header .navbar-collapse {
    gap: 1rem;
}

.header-search .form-control,
.market-filter-card .form-control,
.market-filter-card .form-select,
.listing-form .form-control,
.listing-form .form-select,
.auth-card .form-control,
.auth-card .form-select,
.content-card .form-control,
.content-card .form-select {
    border-radius: 16px;
    border-color: var(--border);
    background: #fff;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.header-search .form-control {
    border-radius: 999px;
    background: var(--surface-soft);
}

.btn {
    border-radius: 16px;
    font-weight: 700;
    padding: 0.75rem 1.1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #1b7ef3);
    border-color: transparent;
    box-shadow: 0 14px 25px rgba(15, 91, 216, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-purple {
    color: #fff;
    background: #6f42c1;
    border-color: #6f42c1;
}

.btn-add {
    gap: 0.5rem;
}

.phone-field-shell {
    display: grid;
    grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
    gap: 0.75rem;
}

.phone-country-select,
.phone-local-input {
    min-width: 0;
}

.hero-shell,
.premium-banner {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 245, 253, 0.96));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.hero-panel,
.hero-side {
    padding: clamp(1.5rem, 3vw, 3rem);
}

.hero-panel {
    height: 100%;
}

.hero-side {
    background:
        linear-gradient(180deg, rgba(15, 91, 216, 0.08), rgba(15, 91, 216, 0)),
        var(--surface-soft);
    height: 100%;
}

.hero-side-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    height: 100%;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(15, 91, 216, 0.12);
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.hero-stats .stat-card,
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.35rem;
    box-shadow: 0 10px 25px rgba(12, 37, 69, 0.04);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.market-filter-card,
.content-card,
.category-card,
.auth-card,
.plan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 800;
}

.category-card {
    display: block;
    height: 100%;
    color: var(--text);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover,
.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 45px rgba(12, 37, 69, 0.12);
}

.category-card-icon {
    width: 4rem;
    height: 4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(15, 91, 216, 0.16), rgba(54, 163, 255, 0.1));
    color: var(--primary);
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.2rem;
    font-weight: 800;
}

.category-pill,
.category-chip {
    display: inline-flex;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.82rem;
}

.category-mini-list {
    display: grid;
    gap: 0.85rem;
}

.category-mini-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: var(--surface-soft);
    text-decoration: none;
}

.listing-card {
    overflow: hidden;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.listing-card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--surface-soft);
}

.listing-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-pill,
.verified-pill,
.plan-badge {
    position: absolute;
    top: 1rem;
}

.listing-pill {
    left: 1rem;
}

.verified-pill {
    right: 1rem;
}

.listing-card-title {
    position: relative;
    z-index: 1;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.45;
    margin-bottom: 0.8rem;
    min-height: 3rem;
}

.listing-price,
.listing-price-detail {
    color: var(--primary-dark);
    font-weight: 800;
}

.listing-price {
    font-size: 1.3rem;
}

.listing-price-detail {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.page-head h1,
.page-head h2 {
    font-weight: 800;
}

.breadcrumb-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.breadcrumb-nav a {
    color: var(--primary-dark);
    text-decoration: none;
}

.listing-gallery-main {
    border-radius: 22px;
    overflow: hidden;
    background: var(--surface-soft);
}

.listing-gallery-main img {
    width: 100%;
    height: min(480px, 62vw);
    object-fit: cover;
}

.listing-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.gallery-thumb {
    border: 0;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    background: transparent;
}

.gallery-thumb img {
    width: 100%;
    height: 88px;
    object-fit: cover;
}

.listing-description {
    color: var(--text);
    line-height: 1.8;
}

.detail-meta-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: var(--surface-soft);
}

.detail-meta-card span {
    color: var(--muted);
}

.seller-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.seller-avatar,
.profile-avatar-lg {
    background: linear-gradient(135deg, var(--primary), #1b7ef3);
    color: #fff;
}

.seller-avatar {
    width: 4rem;
    height: 4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 800;
}

.profile-avatar-lg {
    width: 110px;
    height: 110px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    font-weight: 800;
    overflow: hidden;
}

.profile-avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-list,
.conversation-list,
.message-thread {
    display: grid;
    gap: 1rem;
}

.comment-item,
.conversation-card,
.message-bubble {
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    padding: 1rem 1.1rem;
}

.conversation-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.conversation-card.active {
    border-color: rgba(15, 91, 216, 0.4);
    background: rgba(15, 91, 216, 0.08);
}

.message-thread {
    max-height: 520px;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.message-bubble {
    max-width: 80%;
}

.message-bubble.is-mine {
    margin-left: auto;
    background: rgba(15, 91, 216, 0.1);
    border-color: rgba(15, 91, 216, 0.2);
}

.plan-card {
    height: 100%;
    position: relative;
}

.plan-card.is-current {
    border-color: rgba(15, 91, 216, 0.35);
    background: linear-gradient(180deg, rgba(15, 91, 216, 0.06), rgba(255, 255, 255, 1));
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin: 1.25rem 0;
}

.plan-price span {
    font-size: 2.25rem;
    font-weight: 800;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: grid;
    gap: 0.8rem;
    color: var(--muted);
}

.plan-features li::before {
    content: '•';
    color: var(--primary);
    margin-right: 0.5rem;
}

.premium-banner {
    padding: 2rem;
    border-radius: var(--radius-xl);
}

.plan-summary-card,
.owner-plan-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 12px 26px rgba(12, 37, 69, 0.05);
}

.listing-form .content-card {
    box-shadow: none;
}

.existing-images-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.existing-image-card {
    display: grid;
    gap: 0.65rem;
}

.existing-image-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 18px;
}

.auth-shell,
.admin-login-shell {
    min-height: calc(100vh - 260px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: min(100%, 520px);
}

.auth-card-wide {
    width: min(100%, 760px);
}

.empty-state-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(15, 91, 216, 0.09);
    color: var(--primary);
    font-size: 1.8rem;
}

.site-footer {
    background: #fff;
    border-top: 1px solid var(--border);
}

.footer-title {
    font-weight: 800;
    margin-bottom: 1rem;
}

.footer-links,
.social-links {
    display: grid;
    gap: 0.7rem;
}

.footer-links a,
.social-links a {
    color: var(--muted);
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid var(--border);
}

.mobile-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    width: calc(100% - 1.5rem);
    max-width: 560px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(82px, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.2rem;
    padding: 0.55rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(220, 228, 239, 0.85);
    box-shadow: 0 22px 45px rgba(12, 37, 69, 0.16);
    backdrop-filter: blur(16px);
    z-index: 1050;
}

.mobile-bottom-nav a {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.18rem;
    text-decoration: none;
    color: var(--muted);
    padding: 0.45rem 0.15rem;
    border-radius: 16px;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 0;
    white-space: nowrap;
    line-height: 1.05;
}

.mobile-bottom-nav a.active,
.mobile-bottom-nav a.mobile-add-link {
    color: var(--primary);
    background: rgba(15, 91, 216, 0.08);
}

.mobile-bottom-nav a i {
    font-size: 1.2rem;
    line-height: 1;
}

.mobile-bottom-nav a span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mobile-add-link {
    position: relative;
    padding-top: 0.3rem !important;
}

.mobile-add-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(15, 91, 216, 0.16), rgba(54, 163, 255, 0.1));
}

.pb-mobile-nav {
    padding-bottom: 6rem;
}

.admin-body {
    background: #edf2f8;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.admin-sidebar {
    background: #0f1a2a;
    color: #e6eefb;
    padding: 2rem 1.25rem;
}

.admin-brand {
    color: #fff;
    margin-bottom: 2rem;
}

.admin-nav {
    display: grid;
    gap: 0.4rem;
}

.admin-nav a {
    color: rgba(230, 238, 251, 0.82);
    text-decoration: none;
    padding: 0.95rem 1rem;
    border-radius: 16px;
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.admin-main {
    padding: 1.5rem;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-table th {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.plan-inline-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: var(--surface-soft);
}

.categories-dropdown {
    width: min(700px, 92vw);
    border-radius: 24px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.accordion-item {
    border: 1px solid var(--border);
    border-radius: 20px !important;
    overflow: hidden;
    margin-bottom: 1rem;
}

.accordion-button {
    font-weight: 800;
}

@media (max-width: 1199.98px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        padding-bottom: 1rem;
    }
}

@media (max-width: 991.98px) {
    .desktop-left-nav {
        display: block;
        width: 100%;
    }

    .header-actions {
        margin-left: 0;
        width: 100%;
        padding-top: 0.75rem;
    }

    .header-search {
        width: 100%;
        margin-top: 0.75rem;
    }

    .hero-panel,
    .hero-side {
        padding: 1.25rem;
    }

    .listing-gallery-main img {
        height: 360px;
    }
}

@media (max-width: 767.98px) {
    .hero-shell,
    .market-filter-card,
    .content-card,
    .category-card,
    .plan-card,
    .auth-card,
    .premium-banner {
        border-radius: 24px;
    }

    .listing-price-detail {
        font-size: 1.8rem;
    }

    .message-bubble {
        max-width: 100%;
    }

    .existing-images-grid {
        grid-template-columns: 1fr;
    }

    .phone-field-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 380px) {
    .mobile-bottom-nav {
        width: calc(100% - 1rem);
    }

    .mobile-bottom-nav a {
        font-size: 0.58rem;
    }

    .mobile-bottom-nav a i {
        font-size: 1.1rem;
    }
}

@media (min-width: 992px) {
    .pb-mobile-nav {
        padding-bottom: 0;
    }
}
