@import url("ui.css");
@import url("auth.css");
@import url("settings.css");
@import url("product.css");
@import url("publish.css");
@import url("listings.css");
@import url("dashboard.css");
@import url("pricing.css");

body {
    background-color: #0d0d0d;
    color: #f0f0f0;
    font-family: 'Inter', sans-serif;
    margin: 0;
    line-height: 1.6;
}

header {
    background-color: #121212;
    padding: 1rem 2rem;
    border-bottom: 1px solid #222;
    position: -webkit-sticky; /* iOS Safari needs the prefixed value */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;          /* let links wrap to a 2nd line instead of overflowing */
    gap: 0.5rem 1rem;
    /* No max-width/margin centering — logo stays flush left */
}

.logo {
    display: flex;
    flex-direction: row;          /* text LEFT, image RIGHT */
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #e8c97a;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    flex-shrink: 0;
}

.logo span {
    /* Keeps MercaTico text on the left */
    order: 0;
}

.logo-img {
    /* Image renders on the right of the text */
    order: 1;
}

.logo:hover {
    color: #f5dfa0;
}

.logo-img {
    width: 50px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;             /* wrap links instead of pushing past the screen */
    justify-content: flex-end;
    align-items: center;
    gap: 0.6rem 1.1rem;
    margin: 0;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #e8c97a;
}

.hero {
    text-align: center;
    padding: 6rem 2rem;
    background: linear-gradient(rgba(13, 13, 13, 0.8), rgba(13, 13, 13, 1));
}

.hero-text {
    max-width: 800px;
    margin: 0 auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #fff;
}

.hero p {
    font-size: 1.2rem;
    color: #aaa;
    margin-bottom: 2rem;
}

.cta-button {
    background-color: #e8c97a;
    color: #0d0d0d;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-block;
}

.cta-button.secondary {
    background-color: transparent;
    color: #e8c97a;
    border: 1px solid #e8c97a;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(232, 201, 122, 0.3);
}

.how-it-works, .categories, .featured-listings {
    padding: 4rem 2rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.how-it-works h2, .categories h2, .featured-listings h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #e8c97a;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    background-color: #1a1a1a;
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid #222;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.step:hover {
    transform: translateY(-5px);
    border-color: #e8c97a;
}

.step-icon {
    background-color: #e8c97a;
    color: #0d0d0d;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.step h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-item {
    display: block;
    text-decoration: none;
    background-color: #1a1a1a;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #333;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-item:hover {
    background-color: #e8c97a;
    color: #0d0d0d;
    transform: scale(1.05);
    border-color: #e8c97a;
}

footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid #222;
    margin-top: 2rem;
    background-color: #121212;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    padding: 0;
}

.footer-links a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover { color: #e8c97a; }

.hidden {
    display: none !important;
}

.loading {
    color: #aaa;
    font-size: 0.95rem;
    margin: 1rem 0;
}

.badge-featured {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background-color: rgba(232, 201, 122, 0.15);
    color: #e8c97a;
    border: 1px solid #e8c97a;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Featured Seller badge — a Pro membership perk. */
.badge-seller-pro {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background: linear-gradient(135deg, #e8c97a, #cfa94e);
    color: #0d0d0d;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.badge-sold {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background-color: rgba(224, 128, 128, 0.15);
    color: #e08080;
    border: 1px solid #e08080;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.listing-noimg {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: #1a1a1a;
    border-bottom: 1px solid #222;
}

.badge-expired {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background-color: rgba(150, 150, 150, 0.15);
    color: #aaa;
    border: 1px solid #777;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-mark-sold {
    background: transparent;
    border: 1px solid #e08080;
    color: #e08080;
    cursor: pointer;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.82rem;
}
.btn-mark-sold:hover { background: rgba(224,128,128,0.12); }

/* Nav auth-state visibility */
.nav-hidden { display: none !important; }

/* User dropdown menu */
.nav-user-menu {
    position: relative;
}

.nav-user-btn {
    background: none;
    border: none;
    color: #fff;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s ease;
}

.nav-user-btn:hover {
    color: #e8c97a;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    min-width: 170px;
    list-style: none;
    padding: 0.4rem 0;
    margin: 0;
    z-index: 200;
    box-shadow: 0 6px 24px rgba(0,0,0,0.6);
}

.nav-dropdown.open { display: block; }

.nav-dropdown li { padding: 0; }

.nav-dropdown a,
.nav-logout-btn {
    display: block;
    padding: 0.6rem 1.2rem;
    color: #f0f0f0;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.nav-dropdown a:hover,
.nav-logout-btn:hover {
    background-color: #252525;
    color: #e8c97a;
}

@media (max-width: 768px) {
    /* Logo on top, links centered and wrapping below — fits any number of items. */
    nav {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1.1rem;
    }

    .hero {
        padding: 4rem 1.5rem;
    }

    .hero h1 {
        font-size: 2.4rem;
    }
}

/* ─── Over-limit / downgrade banner (Option A) ───────────────────────────────
   Shown on /publish and /dashboard when an account has more active listings
   than its current plan allows (e.g. after a Pro→Basic/Free downgrade). Existing
   listings stay live; new ones are blocked. Informative, not alarming. */
.over-limit-banner {
    margin: 0.75rem 0 1rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid #6b5a2a;
    border-left: 4px solid #e8c97a;
    border-radius: 8px;
    background: #221d10;
    color: #e7dcc2;
    font-size: 0.9rem;
    line-height: 1.5;
}
.over-limit-banner.hidden { display: none; }
.over-limit-banner a {
    color: #e8c97a;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.over-limit-banner a:hover { text-decoration: underline; }

/* ─── Email-verification banner (shown on the dashboard to unverified users) ── */
.verify-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0 0 1.25rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid #6b5a2a;
    border-left: 4px solid #e8c97a;
    border-radius: 8px;
    background: #221d10;
    color: #e7dcc2;
    font-size: 0.92rem;
    line-height: 1.5;
}
.verify-banner.hidden { display: none; }
.verify-banner-text { flex: 1 1 260px; }
.verify-banner .cta-button { flex: 0 0 auto; padding: 0.55rem 1.1rem; font-size: 0.9rem; }
