/* =========================================================
   Kegalle Marketplace - Clean Premium Frontend Theme
   File: /public/css/kegalle-theme.css
   ========================================================= */

:root{
    --brand:#00A76F;
    --brand-dark:#047857;
    --brand-soft:#E8FFF4;
    --bg:#F5F7FB;
    --card:#FFFFFF;
    --text:#0F172A;
    --muted:#667085;
    --line:#E5EAF1;
    --footer:#071226;
    --shadow:0 18px 50px rgba(15,23,42,.08);
    --shadow-lg:0 30px 80px rgba(15,23,42,.14);
    --container:1320px;
}

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

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

body{
    font-family:Inter, "Segoe UI", Arial, sans-serif;
    font-size:16px;
    line-height:1.6;
    background:var(--bg);
    color:var(--text);
    -webkit-font-smoothing:antialiased;
}

a{
    color:inherit;
    text-decoration:none;
}

img{
    max-width:100%;
    display:block;
}

button,
input,
select{
    font-family:inherit;
}

.kg-container{
    width:min(var(--container), calc(100% - 56px));
    margin-inline:auto;
}

main{
    min-height:60vh;
}

/* HEADER */

.kg-header{
    position:sticky;
    top:0;
    z-index:1000;
    background:#fff;
    border-bottom:1px solid var(--line);
    box-shadow:0 8px 28px rgba(15,23,42,.05);
}

.kg-topnav{
    min-height:76px;
    display:grid;
    grid-template-columns:220px minmax(360px,1fr) auto 44px;
    gap:20px;
    align-items:center;
}

.kg-brand{
    display:flex;
    align-items:center;
    gap:12px;
}

.kg-pin{
    width:46px;
    height:46px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:linear-gradient(135deg,#bfd531,var(--brand));
    color:#fff;
    font-weight:950;
    box-shadow:0 12px 30px rgba(0,167,111,.25);
}

.kg-brand b{
    display:block;
    font-size:24px;
    line-height:1;
    font-weight:950;
    letter-spacing:-.7px;
}

.kg-brand small{
    display:block;
    margin-top:3px;
    color:var(--muted);
    font-size:12px;
    font-weight:700;
}

.kg-mini-search{
    height:54px;
    display:grid;
    grid-template-columns:170px 1fr 110px;
    align-items:center;
    background:#fff;
    border:1px solid var(--line);
    border-radius:18px;
    overflow:hidden;
}

.kg-mini-search select,
.kg-mini-search input{
    height:100%;
    border:0;
    outline:0;
    padding:0 16px;
    background:#fff;
    color:var(--text);
}

.kg-mini-search select{
    border-right:1px solid var(--line);
    font-weight:800;
}

.kg-mini-search button{
    height:42px;
    margin-right:6px;
    border:0;
    border-radius:13px;
    background:var(--brand);
    color:#fff;
    font-weight:950;
    cursor:pointer;
}

.kg-actions{
    display:flex;
    align-items:center;
    gap:18px;
    white-space:nowrap;
}

.kg-actions a,
.kg-text-btn{
    border:0;
    background:transparent;
    color:var(--text);
    font-size:14px;
    font-weight:900;
    cursor:pointer;
}

.kg-actions .kg-post,
.kg-post{
    min-height:44px;
    display:inline-flex;
    align-items:center;
    padding:0 20px;
    border-radius:15px;
    background:var(--brand);
    color:#fff!important;
    box-shadow:0 10px 26px rgba(0,167,111,.25);
}

.kg-menu-btn{
    display:none;
    width:44px;
    height:44px;
    border:0;
    border-radius:14px;
    background:var(--brand);
    color:#fff;
    font-size:22px;
}

.kg-greenbar{
    background:linear-gradient(90deg,var(--brand-dark),var(--brand));
    color:#fff;
}

.kg-greenbar .kg-container{
    min-height:42px;
    display:flex;
    align-items:center;
    gap:24px;
    overflow-x:auto;
    white-space:nowrap;
}

.kg-greenbar a,
.kg-greenbar span{
    color:#fff;
    font-size:13px;
    font-weight:900;
}

.kg-greenbar span{
    margin-left:auto;
}

/* HERO */

.kg-home-hero,
.kg-premium-hero{
    background:
        linear-gradient(rgba(8,35,30,.55), rgba(8,35,30,.55)),
        url('/images/kegalle-placeholder.png') center/cover no-repeat;
    color:#fff;
    padding:92px 0;
}

.kg-home-hero-inner,
.kg-hero-grid{
    display:grid;
    grid-template-columns:1fr 360px;
    gap:48px;
    align-items:center;
}

.kg-home-left h1,
.kg-hero-content h1{
    font-size:56px;
    line-height:1.05;
    font-weight:950;
    letter-spacing:-1.6px;
    max-width:700px;
}

.kg-home-left h1 span,
.kg-hero-content h1 span{
    color:#18c98b;
}

.kg-home-left p,
.kg-hero-content p{
    font-size:18px;
    max-width:650px;
    margin:18px 0 28px;
    color:rgba(255,255,255,.92);
}

.kg-home-search,
.kg-search-premium{
    display:grid;
    grid-template-columns:190px 1fr 190px 130px;
    gap:0;
    max-width:920px;
    background:#fff;
    padding:10px;
    border-radius:18px;
    box-shadow:0 24px 70px rgba(0,0,0,.22);
}

.kg-home-search select,
.kg-home-search input,
.kg-search-premium select,
.kg-search-premium input{
    height:54px;
    border:0;
    border-right:1px solid var(--line);
    padding:0 18px;
    outline:0;
    color:var(--text);
}

.kg-home-search button,
.kg-search-premium button{
    height:54px;
    border:0;
    border-radius:14px;
    background:var(--brand);
    color:#fff;
    font-weight:900;
    cursor:pointer;
}

.kg-home-popular,
.kg-popular{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    margin-top:20px;
    color:#fff;
}

.kg-home-popular a,
.kg-popular a{
    background:rgba(255,255,255,.18);
    color:#fff;
    padding:8px 14px;
    border-radius:999px;
    font-weight:800;
}

.kg-home-seller-card,
.kg-stats-card,
.kg-join-card{
    background:#fff;
    color:var(--text);
    padding:32px;
    border-radius:28px;
    box-shadow:0 30px 80px rgba(0,0,0,.24);
}

.kg-home-seller-card h3,
.kg-stats-card h3{
    font-size:24px;
    line-height:1.25;
    font-weight:950;
}

.kg-home-seller-card h3 span{
    color:var(--brand-dark);
}

.kg-home-seller-card p,
.kg-stats-card p{
    color:var(--muted);
    margin:14px 0 20px;
}

.kg-home-seller-card a,
.kg-stats-card a{
    display:block;
    background:var(--brand);
    color:#fff;
    text-align:center;
    padding:15px;
    border-radius:14px;
    font-weight:950;
}

.kg-home-stats,
.kg-mini-stats{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    margin-top:24px;
}

.kg-home-stats strong,
.kg-mini-stats strong{
    display:block;
    font-size:28px;
    color:var(--text);
}

.kg-home-stats small,
.kg-mini-stats small{
    color:var(--muted);
    font-weight:800;
}

/* CATEGORIES */

.kg-home-categories,
.kg-categories,
.kg-category-row{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:18px;
    margin-top:-42px;
    position:relative;
    z-index:5;
}

.kg-home-categories a,
.kg-categories a{
    background:#fff;
    min-height:138px;
    padding:24px 18px;
    border-radius:24px;
    text-align:center;
    box-shadow:0 16px 45px rgba(15,23,42,.08);
    color:var(--text);
}

.kg-home-categories span,
.kg-categories span{
    width:58px;
    height:58px;
    display:grid;
    place-items:center;
    margin:0 auto 12px;
    border-radius:50%;
    background:var(--brand-soft);
    font-size:26px;
}

.kg-home-categories b,
.kg-categories b{
    display:block;
    font-size:15px;
    font-weight:950;
}

.kg-home-categories small,
.kg-categories small{
    color:var(--muted);
}

/* SECTIONS */

.kg-section{
    margin-top:78px;
}

.kg-home-section-head,
.kg-section-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:28px;
}

.kg-home-section-head h2,
.kg-section-head h2{
    font-size:34px;
    line-height:1.1;
    font-weight:950;
    letter-spacing:-.8px;
}

.kg-home-section-head a,
.kg-section-head a{
    color:var(--brand-dark);
    font-weight:900;
}

/* PRODUCT CARDS */

.kg-home-listing-grid,
.kg-grid,
.kg-premium-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:28px;
}

.kg-listing-card{
    display:flex;
    flex-direction:column;
    background:#fff!important;
    border-radius:26px!important;
    overflow:hidden!important;
    box-shadow:var(--shadow)!important;
    border:1px solid #eef2f7!important;
    transition:.25s ease;
}

.kg-listing-card:hover{
    transform:translateY(-8px);
    box-shadow:var(--shadow-lg)!important;
}

.kg-listing-image{
    position:relative;
    height:240px!important;
    background:#edf3f6!important;
    overflow:hidden;
}

.kg-listing-image img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.kg-image-placeholder{
    width:100%;
    height:100%;
    background:url('/images/kegalle-placeholder.png') center/cover no-repeat!important;
    color:transparent!important;
}

.kg-card-badges{
    position:absolute;
    top:14px;
    left:14px;
    right:54px;
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.kg-badge{
    display:inline-flex;
    align-items:center;
    min-height:26px;
    padding:5px 10px;
    border-radius:999px;
    background:#ef4444;
    color:#fff;
    font-size:12px;
    line-height:1;
    font-weight:950;
}

.kg-badge-yellow{
    background:#f59e0b;
}

.kg-save-btn{
    position:absolute;
    top:12px;
    right:12px;
    width:38px;
    height:38px;
    border-radius:50%;
    border:0;
    background:#fff;
    color:var(--text);
    box-shadow:0 8px 20px rgba(15,23,42,.15);
}

.kg-listing-body{
    padding:24px!important;
}

.kg-listing-body small{
    font-size:10.5px!important;
    font-weight:950!important;
    text-transform:uppercase;
    letter-spacing:1px;
    color:var(--muted)!important;
}

.kg-listing-body h3{
    font-size:19px!important;
    line-height:1.28!important;
    min-height:52px!important;
    margin:14px 0 18px!important;
    font-weight:950!important;
    color:var(--text)!important;
}

.kg-listing-body p{
    font-size:13.5px!important;
    color:var(--muted)!important;
    margin:7px 0!important;
}

.kg-price{
    display:block!important;
    font-size:30px!important;
    line-height:1!important;
    letter-spacing:-1.2px!important;
    color:var(--brand-dark)!important;
    font-weight:950!important;
    margin:18px 0!important;
    white-space:nowrap!important;
}

.kg-card-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:12px!important;
}

.kg-mini-cta{
    height:44px!important;
    border-radius:14px!important;
    font-size:13px!important;
    font-weight:950!important;
    display:flex;
    align-items:center;
    justify-content:center;
}

.kg-mini-cta.call,
.kg-mini-cta:first-child{
    background:var(--brand);
    color:#fff;
}

.kg-mini-cta.wa,
.kg-mini-cta:last-child{
    background:var(--brand-soft);
    color:var(--brand-dark);
}

/* STORE CARDS */

.kg-home-store-grid,
.kg-store-grid,
.kg-premium-store-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:26px;
}

.kg-home-store-card,
.kg-store-card{
    background:#fff;
    border-radius:24px;
    padding:26px;
    text-align:center;
    box-shadow:0 16px 45px rgba(15,23,42,.08);
    color:var(--text);
}

.kg-home-store-logo,
.kg-store-logo{
    width:90px;
    height:90px;
    margin:0 auto 16px;
    border-radius:22px;
    overflow:hidden;
    background:#eef2f7;
}

.kg-home-store-logo img,
.kg-store-logo img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.kg-home-store-card h3,
.kg-store-card h3{
    font-size:18px;
    font-weight:950;
}

.kg-home-store-card p,
.kg-home-store-card small,
.kg-store-card p,
.kg-store-card small{
    color:var(--muted);
}

.kg-home-store-card span,
.kg-store-card span{
    display:block;
    margin-top:16px;
    background:#f1f5f9;
    color:var(--brand-dark);
    padding:12px;
    border-radius:12px;
    font-weight:950;
}

/* HOW IT WORKS */

.kg-home-how,
.kg-how{
    margin-top:78px;
    background:#ecfdf5;
    border-radius:30px;
    padding:46px;
}

.kg-home-how h2,
.kg-how h2{
    text-align:center;
    font-size:32px;
    font-weight:950;
}

.kg-home-how > div,
.kg-how > div{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:28px;
    margin-top:30px;
}

.kg-home-how article,
.kg-how article{
    text-align:center;
}

.kg-home-how article b,
.kg-how article b{
    width:42px;
    height:42px;
    display:grid;
    place-items:center;
    margin:0 auto 14px;
    border-radius:50%;
    background:var(--brand);
    color:#fff;
}

/* APP BANNER */

.kg-home-app-banner,
.kg-app-banner{
    margin-top:42px;
    background:var(--brand);
    color:#fff;
    border-radius:30px;
    padding:48px;
}

.kg-home-app-banner h2,
.kg-app-banner h2{
    font-size:36px;
    font-weight:950;
}

.kg-home-app-banner a,
.kg-app-banner a{
    display:inline-flex;
    background:var(--text);
    color:#fff;
    padding:13px 20px;
    border-radius:12px;
    margin-right:10px;
    font-weight:900;
}

/* NEWSLETTER */

.kg-home-newsletter{
    margin:34px auto 0;
    background:#fff;
    border-radius:24px;
    display:grid;
    grid-template-columns:1fr 520px;
    overflow:hidden;
    box-shadow:0 14px 40px rgba(15,23,42,.06);
}

.kg-home-newsletter > div{
    padding:28px;
}

.kg-home-newsletter form{
    display:grid;
    grid-template-columns:1fr 150px;
}

.kg-home-newsletter input{
    border:0;
    border-left:1px solid var(--line);
    padding:0 24px;
}

.kg-home-newsletter button{
    border:0;
    background:var(--brand);
    color:#fff;
    font-weight:950;
}

/* FOOTER */

.kg-footer{
    margin-top:70px;
    background:var(--footer);
    color:#dbeafe;
    padding:56px 0 0;
}

.kg-footer-grid{
    display:grid;
    grid-template-columns:1.4fr 1fr 1fr 1.2fr;
    gap:42px;
}

.kg-brand-light{
    color:#fff;
}

.kg-footer p{
    color:#aab8cc;
    margin-top:14px;
    max-width:320px;
}

.kg-footer h4{
    color:#fff;
    font-size:16px;
    margin-bottom:18px;
}

.kg-footer a{
    display:block;
    color:#cbd5e1;
    margin:9px 0;
    font-weight:600;
}

.kg-news{
    margin-top:14px;
    display:grid;
    gap:10px;
}

.kg-news input{
    height:48px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:12px;
    background:#172236;
    color:#fff;
    padding:0 16px;
}

.kg-news button{
    height:42px;
    border:0;
    border-radius:12px;
    background:var(--brand);
    color:#fff;
    font-weight:950;
}

.kg-copy{
    margin-top:42px;
    padding:20px 0;
    border-top:1px solid rgba(255,255,255,.08);
    color:#94a3b8;
    font-size:13px;
}

.kg-whatsapp{
    position:fixed;
    right:22px;
    bottom:22px;
    z-index:1200;
    min-height:48px;
    display:inline-flex;
    align-items:center;
    padding:0 20px;
    border-radius:999px;
    background:#25D366;
    color:#fff;
    font-weight:950;
    box-shadow:0 16px 36px rgba(37,211,102,.3);
}

/* RESPONSIVE */

@media(max-width:1100px){
    .kg-topnav{
        grid-template-columns:1fr auto;
        padding:14px 0;
    }

    .kg-mini-search,
    .kg-actions{
        grid-column:1/-1;
    }

    .kg-actions{
        overflow-x:auto;
        padding-bottom:6px;
    }

    .kg-home-hero-inner,
    .kg-hero-grid,
    .kg-home-newsletter{
        grid-template-columns:1fr;
    }

    .kg-home-search,
    .kg-search-premium{
        grid-template-columns:1fr;
        border-radius:24px;
    }

    .kg-home-search select,
    .kg-home-search input,
    .kg-search-premium select,
    .kg-search-premium input{
        border-right:0;
        border-bottom:1px solid var(--line);
    }

    .kg-home-listing-grid,
    .kg-grid,
    .kg-premium-grid,
    .kg-home-store-grid,
    .kg-store-grid,
    .kg-premium-store-grid{
        grid-template-columns:repeat(2,1fr);
    }

    .kg-home-how > div,
    .kg-how > div{
        grid-template-columns:repeat(2,1fr);
    }
}

@media(max-width:700px){
    .kg-container{
        width:min(100% - 28px, var(--container));
    }

    .kg-mini-search{
        grid-template-columns:1fr;
        height:auto;
        border-radius:18px;
    }

    .kg-mini-search select,
    .kg-mini-search input,
    .kg-mini-search button{
        height:48px;
        width:100%;
        margin:0;
        border-radius:0;
    }

    .kg-greenbar span{
        display:none;
    }

    .kg-home-hero,
    .kg-premium-hero{
        padding:56px 0;
    }

    .kg-home-left h1,
    .kg-hero-content h1{
        font-size:40px;
    }

    .kg-home-categories,
    .kg-categories,
    .kg-category-row,
    .kg-home-listing-grid,
    .kg-grid,
    .kg-premium-grid,
    .kg-home-store-grid,
    .kg-store-grid,
    .kg-premium-store-grid,
    .kg-home-how > div,
    .kg-how > div{
        grid-template-columns:1fr;
    }

    .kg-home-categories,
    .kg-categories,
    .kg-category-row{
        margin-top:24px;
    }

    .kg-price{
        font-size:26px!important;
    }

    .kg-home-newsletter form{
        grid-template-columns:1fr;
    }

    .kg-home-newsletter input,
    .kg-home-newsletter button{
        min-height:54px;
    }

    .kg-footer-grid{
        grid-template-columns:1fr;
    }
}

/* =========================================================
   Kegalle Phase 2 Frontend Upgrade
   Append to /public/css/kegalle-theme.css
   ========================================================= */

.kg-home-hero,
.kg-premium-hero{
    padding:78px 0 72px!important;
}

.kg-floating-search{
    position:fixed;
    left:50%;
    top:92px;
    transform:translateX(-50%) translateY(-16px);
    width:min(940px, calc(100% - 32px));
    z-index:950;
    opacity:0;
    pointer-events:none;
    transition:.22s ease;
}

body.kg-scrolled .kg-floating-search{
    opacity:1;
    transform:translateX(-50%) translateY(0);
    pointer-events:auto;
}

.kg-floating-search form{
    display:grid;
    grid-template-columns:170px 1fr 130px;
    gap:8px;
    padding:8px;
    border:1px solid rgba(229,234,241,.95);
    border-radius:18px;
    background:rgba(255,255,255,.96);
    backdrop-filter:blur(16px);
    box-shadow:0 18px 55px rgba(15,23,42,.13);
}

.kg-floating-search select,
.kg-floating-search input{
    height:44px;
    border:0;
    outline:0;
    padding:0 14px;
    background:#f8fafc;
    border-radius:12px;
}

.kg-floating-search button{
    border:0;
    border-radius:12px;
    background:var(--brand);
    color:#fff;
    font-weight:950;
}

.kg-listing-image img{
    transition:transform .32s ease;
}

.kg-listing-card:hover .kg-listing-image img{
    transform:scale(1.055);
}

.kg-listing-body{
    display:flex;
    flex-direction:column;
    min-height:270px;
}

.kg-listing-body h3{
    display:-webkit-box!important;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}

.kg-listing-body p{
    height:20px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.kg-price{
    margin-top:auto!important;
    padding-top:18px;
    min-height:52px;
    display:flex!important;
    align-items:flex-end;
}

.kg-save-btn{
    background:rgba(255,255,255,.78)!important;
    backdrop-filter:blur(12px);
    border:1px solid rgba(255,255,255,.7)!important;
    transition:.2s ease;
}

.kg-save-btn:hover{
    transform:scale(1.08);
    background:#fff!important;
    color:#ef4444!important;
}

.kg-home-store-card,
.kg-store-card{
    position:relative;
    min-height:278px;
}

.kg-home-store-card::after,
.kg-store-card::after{
    content:"Verified";
    position:absolute;
    top:18px;
    right:18px;
    padding:6px 10px;
    border-radius:999px;
    background:#ecfdf5;
    color:#047857;
    font-size:11px;
    font-weight:950;
}

.kg-home-newsletter{
    border:1px solid #e5eaf1;
}

.kg-home-newsletter h3{
    font-size:24px;
    font-weight:950;
    letter-spacing:-.5px;
}

.kg-home-newsletter p{
    color:var(--muted);
    margin-top:4px;
}

.kg-footer{
    padding-top:44px!important;
    margin-top:54px!important;
}

.kg-footer-grid{
    gap:30px!important;
}

.kg-copy{
    margin-top:28px!important;
}

.kg-listings-layout{
    display:grid;
    grid-template-columns:300px 1fr;
    gap:28px;
    align-items:start;
    margin-top:34px;
}

.kg-filter-panel{
    position:sticky;
    top:124px;
    background:#fff;
    border:1px solid #e5eaf1;
    border-radius:24px;
    padding:22px;
    box-shadow:0 12px 34px rgba(15,23,42,.05);
}

.kg-filter-panel h3{
    font-size:18px;
    font-weight:950;
    margin-bottom:18px;
}

.kg-filter-group{
    margin-bottom:16px;
}

.kg-filter-group label{
    display:block;
    font-size:12px;
    font-weight:950;
    color:var(--muted);
    text-transform:uppercase;
    letter-spacing:.7px;
    margin-bottom:8px;
}

.kg-filter-group input,
.kg-filter-group select{
    width:100%;
    height:46px;
    border:1px solid #e5eaf1;
    border-radius:13px;
    padding:0 14px;
    outline:0;
    background:#fff;
}

.kg-filter-submit{
    width:100%;
    height:46px;
    border:0;
    border-radius:13px;
    background:var(--brand);
    color:#fff;
    font-weight:950;
}

.kg-listings-toolbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    margin-bottom:22px;
}

.kg-grid-toggle{
    display:flex;
    gap:8px;
}

.kg-grid-toggle button,
.kg-filter-mobile-btn{
    height:40px;
    border:1px solid #e5eaf1;
    background:#fff;
    border-radius:12px;
    padding:0 13px;
    font-weight:900;
    cursor:pointer;
}

.kg-grid-toggle button.active{
    background:var(--brand);
    color:#fff;
    border-color:var(--brand);
}

.kg-listings-results[data-grid="3"] .kg-home-listing-grid{
    grid-template-columns:repeat(3,1fr);
}

.kg-listings-results[data-grid="4"] .kg-home-listing-grid{
    grid-template-columns:repeat(4,1fr);
}

.kg-listings-results[data-grid="compact"] .kg-home-listing-grid{
    grid-template-columns:repeat(2,1fr);
}

.kg-listings-results[data-grid="compact"] .kg-listing-card{
    display:grid;
    grid-template-columns:220px 1fr;
}

.kg-listings-results[data-grid="compact"] .kg-listing-image{
    height:100%!important;
    min-height:220px;
}

.kg-sort-select{
    height:42px;
    border:1px solid #e5eaf1;
    border-radius:12px;
    padding:0 14px;
    background:#fff;
    font-weight:800;
}

.kg-skeleton{
    display:none;
    grid-template-columns:repeat(4,1fr);
    gap:28px;
}

body.kg-loading .kg-skeleton{
    display:grid;
}

.kg-skeleton-card{
    height:420px;
    border-radius:26px;
    background:linear-gradient(90deg,#eef2f7 25%,#f8fafc 37%,#eef2f7 63%);
    background-size:400% 100%;
    animation:kgShimmer 1.2s ease infinite;
}

@keyframes kgShimmer{
    0%{background-position:100% 0}
    100%{background-position:0 0}
}

.kg-empty-state{
    padding:64px 28px;
    border-radius:28px;
    background:#fff;
    border:1px dashed #cbd5e1;
    text-align:center;
}

.kg-empty-state h3{
    font-size:24px;
    font-weight:950;
}

.kg-empty-state p{
    margin-top:8px;
    color:var(--muted);
}

.kg-detail-wrap{
    padding:42px 0 70px;
}

.kg-detail-grid{
    display:grid;
    grid-template-columns:minmax(0,1fr) 380px;
    gap:30px;
    align-items:start;
}

.kg-detail-gallery{
    background:#fff;
    border-radius:30px;
    overflow:hidden;
    box-shadow:var(--shadow);
}

.kg-main-image{
    height:560px;
    background:#edf3f6;
}

.kg-main-image img,
.kg-main-image .kg-image-placeholder{
    width:100%;
    height:100%;
    object-fit:cover;
}

.kg-detail-thumbs{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:10px;
    padding:14px;
}

.kg-detail-thumbs img{
    height:92px;
    width:100%;
    object-fit:cover;
    border-radius:14px;
    cursor:pointer;
}

.kg-detail-card,
.kg-seller-card,
.kg-safety-card{
    background:#fff;
    border:1px solid #e5eaf1;
    border-radius:28px;
    padding:26px;
    box-shadow:0 12px 34px rgba(15,23,42,.05);
}

.kg-detail-card h1{
    font-size:38px;
    line-height:1.12;
    font-weight:950;
    letter-spacing:-1.2px;
}

.kg-detail-price{
    margin:18px 0;
    font-size:42px;
    font-weight:950;
    color:var(--brand-dark);
    letter-spacing:-1.6px;
}

.kg-detail-meta{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
    margin:18px 0;
}

.kg-detail-meta span{
    background:#f8fafc;
    border-radius:13px;
    padding:12px;
    color:#475467;
    font-weight:800;
}

.kg-detail-description{
    margin-top:22px;
    color:#475467;
}

.kg-detail-sidebar{
    position:sticky;
    top:124px;
    display:grid;
    gap:18px;
}

.kg-contact-actions{
    display:grid;
    gap:10px;
    margin-top:18px;
}

.kg-contact-actions a,
.kg-contact-actions button{
    min-height:48px;
    border:0;
    border-radius:14px;
    display:flex;
    justify-content:center;
    align-items:center;
    font-weight:950;
}

.kg-btn-primary{background:var(--brand);color:#fff}
.kg-btn-dark{background:#0f172a;color:#fff}
.kg-btn-soft{background:var(--brand-soft);color:var(--brand-dark)}

.kg-store-hero{
    margin-top:34px;
    background:#fff;
    border-radius:32px;
    overflow:hidden;
    box-shadow:var(--shadow);
}

.kg-store-cover{
    height:260px;
    background:
        linear-gradient(rgba(7,20,26,.25),rgba(7,20,26,.25)),
        url('/images/kegalle-placeholder.png') center/cover no-repeat;
}

.kg-store-profile{
    display:grid;
    grid-template-columns:120px 1fr auto;
    gap:22px;
    align-items:end;
    padding:0 30px 30px;
    margin-top:-58px;
}

.kg-store-avatar{
    width:120px;
    height:120px;
    border:6px solid #fff;
    border-radius:28px;
    overflow:hidden;
    background:#eef2f7;
}

.kg-store-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.kg-verified-badge{
    display:inline-flex;
    align-items:center;
    padding:6px 11px;
    border-radius:999px;
    background:#ecfdf5;
    color:#047857;
    font-size:12px;
    font-weight:950;
    margin-top:8px;
}

.kg-store-actions{
    display:flex;
    gap:10px;
}

.ka-widget-grid{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:18px;
}

.ka-widget{
    background:#fff;
    border:1px solid #e5eaf1;
    border-radius:22px;
    padding:22px;
    box-shadow:0 12px 30px rgba(15,23,42,.05);
}

.ka-widget span{
    color:#667085;
    font-weight:800;
    font-size:13px;
}

.ka-widget strong{
    display:block;
    font-size:30px;
    font-weight:950;
    margin-top:8px;
}

.ka-table-wrap{
    overflow:auto;
    border-radius:22px;
}

.ka-table thead th{
    position:sticky;
    top:0;
    z-index:2;
}

.ka-btn,
.ka-icon-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:0;
    border-radius:12px;
    font-weight:950;
    cursor:pointer;
}

.ka-icon-btn{
    width:36px;
    height:36px;
}

@media(max-width:1100px){
    .kg-listings-layout,
    .kg-detail-grid{
        grid-template-columns:1fr;
    }

    .kg-filter-panel,
    .kg-detail-sidebar{
        position:static;
    }

    .kg-listings-results[data-grid] .kg-home-listing-grid,
    .kg-skeleton{
        grid-template-columns:repeat(2,1fr);
    }

    .ka-widget-grid{
        grid-template-columns:repeat(2,1fr);
    }
}

@media(max-width:700px){
    .kg-floating-search{
        display:none;
    }

    .kg-listings-toolbar{
        align-items:flex-start;
        flex-direction:column;
    }

    .kg-listings-results[data-grid] .kg-home-listing-grid,
    .kg-skeleton{
        grid-template-columns:1fr;
    }

    .kg-listings-results[data-grid="compact"] .kg-listing-card{
        display:flex;
    }

    .kg-main-image{
        height:360px;
    }

    .kg-detail-card h1{
        font-size:30px;
    }

    .kg-store-profile{
        grid-template-columns:1fr;
        align-items:start;
    }

    .kg-store-actions{
        flex-direction:column;
    }

    .ka-widget-grid{
        grid-template-columns:1fr;
    }
}
/* ===============================
   Premium Auth Pages
================================ */

.kg-auth-page{
    min-height:calc(100vh - 180px);
    padding:64px 0;
    background:
        radial-gradient(circle at 12% 12%, rgba(0,167,111,.12), transparent 32%),
        radial-gradient(circle at 90% 20%, rgba(16,213,139,.14), transparent 30%),
        #f5f7fb;
}

.kg-auth-shell{
    width:min(1180px, calc(100% - 48px));
    margin:auto;
    display:grid;
    grid-template-columns:1.05fr .95fr;
    gap:34px;
    align-items:stretch;
}

.kg-auth-visual{
    position:relative;
    overflow:hidden;
    border-radius:34px;
    padding:54px;
    color:#fff;
    background:
        linear-gradient(rgba(7,20,26,.35),rgba(7,20,26,.55)),
        url('/images/kegalle-placeholder.png') center/cover no-repeat;
    box-shadow:0 28px 80px rgba(15,23,42,.16);
}

.kg-auth-visual::after{
    content:"";
    position:absolute;
    width:360px;
    height:360px;
    right:-120px;
    bottom:-120px;
    border-radius:50%;
    background:rgba(255,255,255,.12);
}

.kg-auth-brand{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:70px;
    position:relative;
    z-index:2;
}

.kg-auth-brand b{
    display:block;
    font-size:24px;
    line-height:1;
    font-weight:950;
}

.kg-auth-brand small{
    display:block;
    margin-top:4px;
    color:rgba(255,255,255,.78);
    font-weight:800;
}

.kg-auth-visual h1{
    max-width:560px;
    font-size:52px;
    line-height:1.02;
    letter-spacing:-1.8px;
    font-weight:950;
    position:relative;
    z-index:2;
}

.kg-auth-visual p{
    max-width:500px;
    margin-top:20px;
    color:rgba(255,255,255,.86);
    font-size:18px;
    line-height:1.7;
    position:relative;
    z-index:2;
}

.kg-auth-points{
    display:grid;
    gap:12px;
    margin-top:42px;
    position:relative;
    z-index:2;
}

.kg-auth-points span{
    display:inline-flex;
    align-items:center;
    width:max-content;
    max-width:100%;
    padding:11px 14px;
    border-radius:999px;
    background:rgba(255,255,255,.16);
    backdrop-filter:blur(10px);
    font-weight:850;
}

.kg-auth-card{
    background:#fff;
    border:1px solid #e5eaf1;
    border-radius:34px;
    padding:46px;
    box-shadow:0 22px 70px rgba(15,23,42,.10);
}

.kg-auth-eyebrow{
    display:inline-flex;
    align-items:center;
    min-height:32px;
    padding:0 13px;
    border-radius:999px;
    background:#e8fff4;
    color:#047857;
    font-size:12px;
    font-weight:950;
    text-transform:uppercase;
    letter-spacing:.8px;
}

.kg-auth-card h2{
    margin-top:18px;
    font-size:34px;
    line-height:1.1;
    letter-spacing:-.8px;
    font-weight:950;
}

.kg-auth-card > p{
    margin-top:10px;
    color:#667085;
}

.kg-auth-form{
    display:grid;
    gap:18px;
    margin-top:30px;
}

.kg-auth-form label{
    display:grid;
    gap:8px;
    font-size:13px;
    font-weight:950;
    color:#344054;
}

.kg-auth-form input{
    width:100%;
    height:54px;
    border:1px solid #e5eaf1;
    border-radius:15px;
    padding:0 16px;
    outline:0;
    background:#fff;
    color:#0f172a;
    transition:.18s ease;
}

.kg-auth-form input:focus{
    border-color:#00A76F;
    box-shadow:0 0 0 4px rgba(0,167,111,.12);
}

.kg-auth-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin-top:2px;
}

.kg-check{
    display:flex!important;
    grid-template-columns:auto 1fr;
    align-items:center;
    gap:8px!important;
    font-size:14px!important;
    font-weight:800!important;
    color:#667085!important;
}

.kg-check input{
    width:16px;
    height:16px;
}

.kg-auth-row a{
    color:#047857;
    font-size:14px;
    font-weight:900;
}

.kg-auth-form button{
    height:56px;
    border:0;
    border-radius:16px;
    background:linear-gradient(135deg,#00A76F,#17c98d);
    color:#fff;
    font-weight:950;
    font-size:15px;
    cursor:pointer;
    box-shadow:0 14px 34px rgba(0,167,111,.24);
}

.kg-auth-footer{
    margin-top:24px;
    padding-top:22px;
    border-top:1px solid #eef2f7;
    text-align:center;
    color:#667085;
    font-weight:800;
}

.kg-auth-footer a{
    color:#047857;
    font-weight:950;
}

.kg-auth-error{
    margin-top:20px;
    padding:14px 16px;
    border-radius:14px;
    background:#fee2e2;
    color:#991b1b;
    font-weight:850;
}

/* Mobile Auth */

@media(max-width:900px){
    .kg-auth-shell{
        grid-template-columns:1fr;
    }

    .kg-auth-visual{
        min-height:420px;
    }
}

@media(max-width:600px){
    .kg-auth-page{
        padding:28px 0;
    }

    .kg-auth-shell{
        width:min(100% - 28px, 1180px);
    }

    .kg-auth-visual,
    .kg-auth-card{
        border-radius:24px;
        padding:28px;
    }

    .kg-auth-brand{
        margin-bottom:44px;
    }

    .kg-auth-visual h1{
        font-size:36px;
    }

    .kg-auth-card h2{
        font-size:28px;
    }

    .kg-auth-row{
        flex-direction:column;
        align-items:flex-start;
    }
}
.kg-account-type{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
}

.kg-type-card{
    position:relative;
    display:flex!important;
    align-items:flex-start;
    gap:12px!important;
    padding:16px;
    border:1px solid #e5eaf1;
    border-radius:18px;
    background:#fff;
    cursor:pointer;
}

.kg-type-card input{
    width:18px!important;
    height:18px!important;
    margin-top:3px;
}

.kg-type-card b{
    display:block;
    font-size:15px;
    color:#0f172a;
}

.kg-type-card small{
    display:block;
    margin-top:4px;
    color:#667085;
    line-height:1.4;
}

.kg-type-card:has(input:checked){
    border-color:#00A76F;
    background:#e8fff4;
    box-shadow:0 0 0 4px rgba(0,167,111,.10);
}

@media(max-width:600px){
    .kg-account-type{
        grid-template-columns:1fr;
    }
}
.kg-field select{
    width:100%;
    height:54px;
    border:1px solid #e5eaf1;
    border-radius:15px;
    padding:0 16px;
    outline:0;
    background:#fff;
    color:#0f172a;
    font-weight:700;
}

.kg-field select:focus{
    border-color:#00A76F;
    box-shadow:0 0 0 4px rgba(0,167,111,.12);
}
.kg-social-login{
    display:grid;
    gap:12px;
    margin-top:18px;
}

.kg-social-btn{
    min-height:50px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid #e5eaf1;
    border-radius:15px;
    background:#fff;
    color:#0f172a;
    font-weight:950;
    transition:.18s ease;
}

.kg-social-btn:hover{
    border-color:#00A76F;
    background:#e8fff4;
    color:#047857;
}
