/* RADIANT MARKETPLACE CONCEPT */
:root {
    --bg: #FAFAFA;
    --glass: rgba(255, 255, 255, 0.85);
    /* More opaque for profile */
    --blur: saturate(180%) blur(20px);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --accent-1: #FF2E63;
    --accent-2: #08D9D6;
    --accent-3: #252A34;
    --grad-1: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 100%);
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    background: #f8f8f8;
    color: var(--accent-3);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
    overflow: hidden;
}

/* 1. LAYOUT GRID (Universal) */
.app-shell {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 70px;
    /* Content + Mobile Nav */
    background: white;
}

@media (min-width: 1024px) {
    .app-shell {
        grid-template-columns: 80px 1fr 340px;
        /* Nav | Profile | Chat */
        grid-template-rows: 1fr;
        background: #fafafa;
    }
}

/* 2. LEFT NAV (Desktop) */
.nav-col {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    background: white;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 10;
}

@media (min-width: 1024px) {
    .nav-col {
        display: flex;
    }
}

.logo-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(45deg, var(--accent-1), var(--accent-2));
    margin-bottom: 40px;
    cursor: pointer;
    transition: 0.3s;
}

.logo-box:hover {
    transform: rotate(180deg);
}

.nav-btn {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    color: #ccc;
    margin-bottom: 25px;
    cursor: pointer;
    transition: 0.2s;
    border-radius: 12px;
}

.nav-btn:hover {
    color: var(--accent-1);
    background: rgba(0, 0, 0, 0.03);
}

.nav-btn.active {
    color: white;
    background: var(--accent-3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}


/* 3. CENTER: MARKETPLACE SCROLL */
.mk-col {
    position: relative;
    overflow-y: auto;
    /* Allow internal scrolling */
    height: 100vh;
    /* Fix: Ensure container has height so overflow works */
    scroll-behavior: smooth;
    border-radius: 0;
    padding-bottom: 80px;
}

.mk-col::-webkit-scrollbar {
    display: none;
}

@media (min-width: 1024px) {
    .mk-col {
        padding: 40px !important;
        /* Fix: Force padding to prevent top clipping */
        padding-bottom: 40px !important;
    }
}

/* MARKETPLACE HEADER (HERO) */
.mk-hero {
    position: relative;
    width: 100%;
    height: 280px;
    background: url('/img/marketplace/hero_banner.png') center/cover no-repeat;
    border-radius: 20px;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.mk-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2));
    z-index: 1;
}

.mk-hero-content {
    position: relative;
    z-index: 2;
    padding: 40px;
    color: white;
    max-width: 60%;
}

.mk-hero h1 {
    font-size: 2.5rem;
    line-height: 1.1;
    margin: 0 0 10px 0;
    font-weight: 800;
}

.mk-hero span {
    color: var(--accent-2);
}

.mk-hero p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.btn-hero {
    padding: 12px 30px;
    background: var(--accent-1);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

.btn-hero:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(255, 46, 99, 0.4);
}



/* CATEGORIES */
.cat-rail {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.cat-rail::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    background: white;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-pill.active,
.cat-pill:hover {
    background: var(--accent-3);
    color: white;
    transform: translateY(-2px);
}

/* PRODUCT GRID */
.mk-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding-bottom: 40px;
}

@media (min-width: 768px) {
    .mk-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .mk-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.p-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: 0.3s;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    position: relative;
}

.p-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.p-img-wrap {
    height: 220px;
    width: 100%;
    position: relative;
    background: #f0f0f0;
}

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

.p-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--accent-3);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 12px;
}

.p-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    transition: 0.2s;
}

.p-fav:hover {
    color: var(--accent-1);
    transform: scale(1.1);
}

.p-body {
    padding: 15px;
}

.p-vendor {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.p-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.p-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.p-price-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.p-old-price {
    font-size: 0.8rem;
    color: #FF4757;
    text-decoration: line-through;
    line-height: 1;
    margin-bottom: 2px;
    font-weight: 600;
}

.p-price {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent-3);
    line-height: 1;
}

.btn-add {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: white;
    color: var(--accent-3);
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    font-size: 1.2rem;
}

.btn-add:hover {
    transform: scale(1.05);
    background: var(--accent-3);
    color: white;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}


/* 4. RIGHT: CART (Desktop) */
/* 4. RIGHT: CART (Desktop) */
.col-chat {
    /* Base styles handled by _layout.css (.col-chat) */
    /* We just ensure it's hidden on mobile and flex on desktop */
}

@media (min-width: 1024px) {
    .col-chat {
        /* _layout.css handles sticky/size */
        /* Ensure background matches if needed */
        background: white;
    }
}

.c-title {
    font-weight: 700;
    color: #ccc;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
}

.c-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    flex: 1;
}

.cart-item {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 10px;
    border-radius: 15px;
    background: #FAFAFA;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
}

.cart-info {
    flex: 1;
}

.cart-name {
    font-size: 0.9rem;
    font-weight: 700;
}

.cart-price {
    font-size: 0.8rem;
    color: #888;
}

.cart-btn {
    display: none;
    /* Hide old delete button if present */
}

.qty-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: white;
    color: #ccc;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    padding-bottom: 2px;
    line-height: 1;
}

.qty-btn:hover {
    border-color: var(--accent-3);
    color: var(--accent-3);
    transform: scale(1.1);
}

.qty-num {
    font-weight: 700;
    font-size: 1rem;
    min-width: 15px;
    text-align: center;
    color: var(--accent-3);
}

.cart-total {
    margin-top: auto;
    border-top: 1px dashed #eee;
    padding-top: 20px;
}

.ct-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 1.1rem;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background: black;
    color: white;
    border-radius: 15px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.btn-checkout:hover {
    transform: scale(1.02);
    background: var(--accent-1);
}

/* 5. MOBILE BOTTOM NAV (Handled by standard _mobile-dock.css now) */
/*
.mob-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.02);
}

@media (min-width: 1024px) {
    .mob-nav {
        display: none;
    }
}

.mn-item {
    font-size: 1.5rem;
    color: #ccc;
    transition: 0.2s;
}

.mn-item.active {
    color: var(--accent-1);
    transform: translateY(-2px);
}
*/

/* 6. RESPONSIVE ADAPTATIONS (Mobile First Polishing) */
@media (max-width: 768px) {

    /* Main Container Padding adjustments */
    .mk-col {
        padding: 20px !important;
        padding-top: 30px !important;
        /* Slightly less than desktop */
        padding-bottom: 100px !important;
        /* Space for mobile dock */
    }

    /* Hero Section - Stacked/Compact */
    .mk-hero {
        height: auto !important;
        /* Allow growth */
        min-height: 280px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        background-position: center left;
        /* Ensure focus on image part */
        padding: 20px;
    }

    .mk-hero-content {
        max-width: 100%;
        padding: 20px;
        text-align: left;
    }

    .mk-hero h1 {
        font-size: 2rem;
    }

    /* Grid - Tighten Gaps */
    .mk-grid {
        gap: 10px;
        padding-bottom: 80px;
    }

    .p-img-wrap {
        height: 160px;
        /* Smaller images */
    }

    .p-body {
        padding: 10px;
    }

    .p-title {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }

    .p-price {
        font-size: 1rem;
    }

    /* Category Rail */
    .cat-rail {
        gap: 10px;
        margin-bottom: 20px;
    }

    .cat-pill {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* Extra Small Devices */
@media (max-width: 380px) {
    .mk-grid {
        grid-template-columns: 1fr;
        /* Single column for very small screens */
    }

    .mk-hero h1 {
        font-size: 1.8rem;
    }
}