/* 
   SellBuyPartnership - Premium Design System 
   Version: 3.0 (Brand Aligned)
*/

:root {
    /* Refined Brand Palette */
    --primary: #2E3192;
    /* True Navy from Logo */
    --primary-light: #3d41b5;
    --primary-dark: #1e2060;

    --accent-gold: #C8A15E;
    /* True Gold from Logo */
    --accent-gold-light: #d9b87d;

    --accent-maroon: #8B1A1E;
    /* Maroon from Logo */

    --bg-main: #ffffff;
    /* Pure White for Premium Clarity */
    --bg-soft: #f8fafc;
    --secondary: #0f172a;
    /* Deep Navy for contrast elements */

    /* UI Refinement */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --border-premium: #cbd5e1;

    /* Sophisticated Accents */
    --shadow-premium: 0 4px 20px -5px rgba(0, 0, 0, 0.08);
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.05);

    /* Layout Constants */
    --radius-full: 100px;
    --radius-standard: 12px;
    --section-gap: 120px;
}

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

html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Poppins', 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
}

/* Global safety: prevent common overflow issues on responsive layouts */
img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

button,
input,
textarea,
select {
    max-width: 100%;
}

a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
}

/* ================= UTILITIES ================= */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-padding {
    padding: var(--section-padding);
}

.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(46, 49, 146, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
    box-shadow: 0 6px 20px 0 rgba(46, 49, 146, 0.4);
}

.btn-accent {
    background: var(--accent-gold);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-gold-light);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    /*color: var(--text-main);*/
}

.btn-outline:hover {
    background: var(--bg-main);
    border-color: var(--primary);
    color: var(--primary);
}

/* Listing detail — sidebar primary CTA on dark panels (sale + partnership) */
.seller-card .sidebar-cta-btn,
.partner-card .sidebar-cta-btn {
    position: relative;
    z-index: 2;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 22px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: 0.02em;
    line-height: 1.2;
    cursor: pointer;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 6px 20px rgba(0, 0, 0, 0.18);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
        transform 0.2s ease, box-shadow 0.2s ease;
}

.seller-card .sidebar-cta-btn:hover,
.partner-card .sidebar-cta-btn:hover {
    color: var(--primary);
    background: #ffffff;
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 12px 32px rgba(0, 0, 0, 0.25);
}

.seller-card .sidebar-cta-btn:focus-visible,
.partner-card .sidebar-cta-btn:focus-visible {
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 0 0 3px rgba(250, 204, 21, 0.55);
}

.seller-card .sidebar-cta-btn:active,
.partner-card .sidebar-cta-btn:active {
    transform: translateY(0);
}

/* ================= UNIFIED HEADER REDESIGN ================= */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: #fff;
    height: 100px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-header.scrolled {
    height: 82px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-right: 14px;
}

.logo img {
    height: 64px;
    width: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-header.scrolled .logo img {
    height: 50px;
}

/* Nav Menu */
.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 2px;
}

.nav-link {
    padding: 10px 12px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 13px;
    border-radius: 10px;
    transition: all 0.3s ease;
    white-space: nowrap;
    line-height: 1;
}

.nav-link:hover {
    background: var(--bg-soft);
    color: var(--primary);
}

/* Header Right Actions */
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 14px;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    position: relative;
    flex-shrink: 0;
}

/* Mini Search for non-index pages */
.header-search .search-mini {
    display: flex;
    background: var(--bg-soft);
    border-radius: 50px;
    padding: 2px 5px 2px 15px;
    border: 1px solid var(--border-light);
    width: 160px;
    transition: all 0.3s ease;
}

.header-search .search-mini:focus-within {
    width: 210px;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(46, 49, 146, 0.05);
}

.search-mini input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    width: 100%;
    color: var(--text-main);
}

.search-mini button {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    cursor: pointer;
}

/* Buttons Styling */
.btn-primary-sm {
    background: var(--primary);
    color: #fff;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(46, 49, 146, 0.15);
}

.btn-primary-sm:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 49, 146, 0.25);
}

.btn-accent-sm {
    background: var(--primary);
    /* Changed to primary for consistency or keep gold? User wanted professional. Primary usually looks more corporate. */
    color: #fff;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(200, 161, 94, 0.15);
}

/* Custom for List Business */
.listing-btn {
    background: var(--accent-gold);
}

.listing-btn:hover {
    background: var(--accent-gold-light);
    transform: translateY(-2px);
}

.nav-login-btn {
    border: 1.5px solid var(--border-light);
    padding: 10px 24px;
    border-radius: 50px;
    color: var(--text-main);
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 92px;
    line-height: 1;
}

.nav-login-btn:hover {
    background: var(--bg-soft);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

/* User Profile in Header */
.wishlist-link {
    font-size: 18px;
    color: var(--text-muted);
    position: relative;
    padding: 5px;
}

.wishlist-link:hover {
    color: var(--accent-maroon);
}

.wishlist-link .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-maroon);
    color: #fff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid #fff;
    box-sizing: border-box;
}

/* Listing card wishlist heart (used across listing grids) */
.p-wishlist.is-saved {
    color: var(--primary);
}

.p-wishlist.is-saved i {
    color: var(--primary);
}

.p-wishlist.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.user-name-label {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown .user-info {
    border: 1px solid transparent;
    padding: 6px 10px;
    background: var(--bg-soft);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: 42px;
    line-height: 0;
    /* Prevent weird inline-image baseline spacing */
}

.user-dropdown .user-info:hover {
    border-color: var(--border-light);
    background: #fff;
}

.user-dropdown {
    position: relative;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-light);
    display: block;
    flex: 0 0 30px;
    max-width: 30px;
    max-height: 30px;
}

.user-dropdown .user-info .fa-chevron-down {
    font-size: 11px;
    color: var(--text-muted);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.12);
    padding: 8px;
    display: none;
    z-index: 1002;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 14px;
    color: var(--text-main);
}

.dropdown-menu a:hover {
    background: var(--bg-soft);
    color: var(--primary);
}

.dropdown-menu hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid var(--border-light);
}

.logout-link {
    color: #ef4444 !important;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: var(--bg-soft);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-main);
}

/* ================= RESPONSIVE HEADER ================= */
@media (max-width: 1280px) {
    .header-container {
        gap: 10px;
    }

    .nav-link {
        padding: 8px 8px;
        font-size: 12px;
    }

    .header-search .search-mini {
        width: 138px;
    }

    .header-search .search-mini:focus-within {
        width: 170px;
    }

    .nav-login-btn {
        padding: 9px 18px;
        min-width: 84px;
    }

    .user-name-label {
        max-width: 80px;
    }
}

@media (max-width: 1100px) {
    .header-container {
        display: flex;
        justify-content: space-between;
    }

    .nav-links {
        display: none;
        /* Mobile menu will handle this */
    }

    .header-search .search-mini {
        width: 150px;
    }

    .header-search .search-mini:focus-within {
        width: 180px;
    }

    .nav-login-btn {
        padding: 9px 16px;
        font-size: 13px;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links.show {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 100px;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        padding: 40px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        z-index: 999;
        gap: 20px;
        overflow-y: auto;
    }

    .nav-link {
        font-size: 18px;
        padding: 15px 0;
        border-radius: 0;
        border-bottom: 1px solid var(--border-light);
    }
}

@media (max-width: 768px) {

    .header-search,
    .header-actions .nav-btn-link {
        display: none;
    }

    .main-header {
        height: 76px;
    }

    .logo img {
        height: 44px;
    }

    .main-header.scrolled .logo img {
        height: 40px;
    }

    .header-actions {
        gap: 10px;
    }

    .nav-login-btn {
        padding: 8px 14px;
        min-width: 74px;
        font-size: 13px;
        border-width: 1px;
    }

    .user-name-label {
        display: none;
    }

    .dropdown-menu {
        right: -8px;
        min-width: 190px;
    }

    /* Keep mobile slide-down menu aligned with sticky header height */
    .nav-links.show {
        top: 76px;
        padding: 22px 18px;
        gap: 10px;
    }
}

/* ================= LISTING CARDS ================= */
.p-card {
    background: white;
    border-radius: var(--radius-standard);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.p-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
    border-color: var(--primary-light);
}

.p-card-img {
    position: relative;
    height: 240px;
}

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

.p-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    box-shadow: var(--shadow-sm);
}

.badge-sale {
    background: #dcfce7;
    color: #166534;
}

.badge-partner {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid rgba(133, 77, 14, 0.1);
}

.p-wishlist {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-maroon);
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.p-card-body {
    padding: 32px;
    flex: 1;
}

.p-card-cat {
    color: var(--accent-gold);
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: block;
}

.p-card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-main);
    line-height: 1.4;
}

.p-card-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 24px;
}

/* ================= FOOTER ================= */
.main-footer {
    background: var(--secondary);
    color: white;
    padding: 80px 0 36px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 40px;
    width: 100%;
    min-width: 0;
}

.footer-grid > * {
    min-width: 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-about img {
    height: 72px;
    margin-bottom: 24px;
    width: auto;
    max-width: 280px;
    display: block;
    object-fit: contain;
}

.footer-about {
    max-width: 360px;
}

.footer-section h4 {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 32px;
    position: relative;
    padding-bottom: 12px;
    text-align: left;
    width: fit-content;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-gold);
}

.footer-links li {
    list-style: none;
    margin-bottom: 16px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.86);
}

.footer-links a:hover {
    color: var(--accent-gold);
}

.footer-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    line-height: 1.6;
    margin-top: 10px;
}

.footer-contact {
    margin-top: 22px;
    font-size: 14px;
    line-height: 1.7;
}

.footer-contact p {
    margin: 0 0 8px;
}

.footer-contact p:last-child {
    margin-bottom: 0;
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: color 0.2s ease;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.footer-contact a:hover {
    color: var(--accent-gold);
}

.footer-contact i {
    color: var(--accent-gold);
    width: 1.1em;
    text-align: center;
    flex-shrink: 0;
}

.social-icons {
    margin-top: 30px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-icon:hover {
    background: var(--primary) !important;
    border-color: var(--primary);
    transform: translateY(-3px);
}

.app-promo {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 24px;
}

.app-downloads {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.app-downloads img {
    height: 44px;
    border-radius: 8px;
    object-fit: contain;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 0 0;
    margin-top: 8px;
}

.footer-bottom-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-legal {
    display: flex;
    gap: 32px;
}

.footer-legal a {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
}

.footer-legal a:hover {
    color: var(--accent-gold);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
    .container {
        padding: 0 32px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 60px;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer-contact a {
        justify-content: center;
    }

    .social-icons {
        justify-content: center;
    }

    .app-downloads {
        align-items: center;
    }

    .footer-section h4 {
        text-align: center;
        width: 100%;
    }

    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-bottom-flex {
        justify-content: center !important;
        text-align: center;
    }

    .footer-legal {
        justify-content: center;
        width: 100%;
    }

}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .main-header {
        height: 72px;
    }

    .main-header.scrolled {
        height: 66px;
    }

    .logo img {
        height: 40px;
    }

    .main-header.scrolled .logo img {
        height: 36px;
    }

    .header-container {
        gap: 8px;
    }

    .header-right {
        gap: 8px;
    }

    .header-actions {
        gap: 8px;
    }

    .nav-login-btn {
        padding: 7px 12px;
        min-width: 68px;
        font-size: 12px;
    }

    .mobile-menu-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .footer-about img {
        margin: 0 auto 24px;
    }

    .footer-legal {
        flex-direction: column;
        gap: 10px;
    }

    .app-downloads {
        align-items: center;
    }

    .nav-links.show {
        top: 72px;
        padding: 18px 14px;
        gap: 8px;
    }
}