/* =================================================
   CATEGORY DRAWER — PREMIUM (কালো + গোল্ড/অ্যাম্বার)
   index.html এর "ক্যাটাগরি" মেনুর সব স্টাইল এই ফাইলে।
   রঙ বদলাতে চাইলে নিচের --cd-gold গুলো বদলালেই হবে।
================================================= */

.category-drawer{
    --cd-gold:#ffb020;
    --cd-gold-soft:#ffd27a;
    --cd-text:#f5f6f8;
    --cd-muted:#9aa1ad;
    --cd-ease:cubic-bezier(.22,.8,.24,1);
}

/* ---------- ওভারলে (ঝাপসা কালো পর্দা) ---------- */
.category-overlay{
    position:fixed;
    inset:0;
    z-index:2998;
    display:block;
    background:rgba(6,7,9,.58);
    -webkit-backdrop-filter:blur(5px);
    backdrop-filter:blur(5px);
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:opacity .35s ease, visibility 0s linear .35s;
}
.category-overlay.active{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transition:opacity .35s ease, visibility 0s;
}

/* ---------- ড্রয়ার ---------- */
.category-drawer{
    position:fixed;
    top:0;
    left:0;
    z-index:2999;
    width:min(86vw,340px);
    height:100vh;
    height:100dvh;
    display:flex;
    flex-direction:column;
    padding:22px 16px calc(18px + env(safe-area-inset-bottom,0px));
    overflow-y:auto;
    overscroll-behavior:contain;
    scrollbar-width:none;
    color:var(--cd-text);
    background:
        radial-gradient(120% 55% at 0% 0%, rgba(255,176,32,.17), rgba(255,176,32,0) 60%),
        radial-gradient(90% 40% at 100% 100%, rgba(255,176,32,.08), rgba(255,176,32,0) 65%),
        linear-gradient(180deg,#17181c 0%,#0c0d0f 100%);
    border-right:1px solid rgba(255,176,32,.18);
    border-radius:0 26px 26px 0;
    box-shadow:24px 0 60px rgba(0,0,0,.55);
    transform:translateX(-106%);
    visibility:hidden;
    transition:transform .45s var(--cd-ease), visibility 0s linear .45s;
}
.category-drawer::-webkit-scrollbar{display:none}
.category-drawer.active{
    transform:none;
    visibility:visible;
    transition:transform .45s var(--cd-ease), visibility 0s;
}

/* ---------- মাথা: লোগো + টাইটেল + বন্ধ বাটন ---------- */
.category-drawer-head{
    position:relative;
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    padding:4px 2px 20px;
    margin:0 0 4px;
    border:0;
}
.category-drawer-head::after{
    content:"";
    position:absolute;
    left:2px;
    right:2px;
    bottom:0;
    height:1px;
    background:linear-gradient(90deg,rgba(255,176,32,.6),rgba(255,255,255,.1) 55%,rgba(255,255,255,0));
}
.cd-titles{min-width:0}
.cd-logo{
    width:108px;
    height:24px;
    margin-bottom:14px;
    background:url("image/logo.png") left center/contain no-repeat;
    opacity:.95;
}
.category-drawer-head h2{
    margin:0;
    font-size:26px;
    line-height:1.25;
    font-weight:700;
    color:#fff;
}
.cd-sub{
    margin:6px 0 0;
    font-size:13px;
    line-height:1.5;
    color:var(--cd-muted);
}

.category-close{
    flex:0 0 38px;
    width:38px;
    height:38px;
    padding:0;
    margin:0;
    display:grid;
    place-items:center;
    border-radius:50%;
    border:1px solid rgba(255,255,255,.12);
    background:rgba(255,255,255,.06);
    color:#fff;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
    transition:background .25s, border-color .25s, color .25s, transform .3s var(--cd-ease);
}
.category-close svg{
    width:18px;
    height:18px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
}
.category-close:hover{
    background:rgba(255,176,32,.16);
    border-color:rgba(255,176,32,.5);
    color:var(--cd-gold-soft);
    transform:rotate(90deg);
}
.category-close:active{transform:rotate(90deg) scale(.92)}

/* ---------- ক্যাটাগরির তালিকা ---------- */
.cat-list{
    display:flex;
    flex-direction:column;
    gap:10px;
    padding:16px 0 20px;
}

.cat-item{
    position:relative;
    display:flex;
    align-items:center;
    gap:14px;
    width:100%;
    margin:0;
    padding:11px 14px 11px 11px;
    border-radius:18px;
    border:1px solid rgba(255,255,255,.08);
    background:linear-gradient(135deg,rgba(255,255,255,.075),rgba(255,255,255,.025));
    color:var(--cd-text);
    font-size:16px;
    font-weight:600;
    line-height:1.35;
    text-align:left;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
    transition:transform .25s var(--cd-ease), background .25s, border-color .25s, box-shadow .25s;
}

.cat-ico{
    flex:0 0 44px;
    width:44px;
    height:44px;
    display:grid;
    place-items:center;
    border-radius:14px;
    color:var(--cd-gold);
    background:linear-gradient(145deg,rgba(255,176,32,.2),rgba(255,176,32,.05));
    border:1px solid rgba(255,176,32,.28);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.08);
    transition:background .25s, color .25s, border-color .25s, box-shadow .25s;
}
.cat-ico svg{
    width:22px;
    height:22px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.7;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.cat-name{
    flex:1;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
}

.cat-arrow{
    flex:0 0 18px;
    width:18px;
    height:18px;
    fill:none;
    stroke:rgba(255,255,255,.38);
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
    transition:stroke .25s, transform .25s var(--cd-ease);
}

/* হোভার (শুধু মাউসওয়ালা ডিভাইসে, ফোনে আটকে থাকবে না) */
@media (hover:hover){
    .cat-item:hover{
        transform:translateX(4px);
        background:linear-gradient(135deg,rgba(255,176,32,.15),rgba(255,255,255,.04));
        border-color:rgba(255,176,32,.42);
        box-shadow:0 10px 24px rgba(0,0,0,.35);
    }
    .cat-item:hover .cat-arrow{
        stroke:var(--cd-gold);
        transform:translateX(3px);
    }
}
.cat-item:active{transform:scale(.985)}
.cat-item:focus-visible,
.category-close:focus-visible{
    outline:2px solid var(--cd-gold);
    outline-offset:2px;
}

/* এখন যে ক্যাটাগরি সিলেক্ট করা আছে */
.cat-item.is-current{
    background:linear-gradient(135deg,rgba(255,176,32,.24),rgba(255,176,32,.06));
    border-color:rgba(255,176,32,.6);
    box-shadow:0 0 0 1px rgba(255,176,32,.12), 0 12px 28px rgba(255,176,32,.09);
}
.cat-item.is-current::before{
    content:"";
    position:absolute;
    left:-1px;
    top:20%;
    bottom:20%;
    width:3px;
    border-radius:0 3px 3px 0;
    background:var(--cd-gold);
}
.cat-item.is-current .cat-ico{
    color:#1a1204;
    background:linear-gradient(145deg,#ffd27a,#f59e0b);
    border-color:transparent;
    box-shadow:0 6px 16px rgba(245,158,11,.38);
}
.cat-item.is-current .cat-name{color:#fff}
.cat-item.is-current .cat-arrow{stroke:var(--cd-gold)}

/* ---------- নিচের ছোট নোট ---------- */
.cat-foot{
    margin-top:auto;
    display:flex;
    align-items:center;
    gap:10px;
    padding:16px 6px 0;
    border-top:1px solid rgba(255,255,255,.07);
    color:var(--cd-muted);
    font-size:12px;
    line-height:1.55;
}
.cat-foot svg{
    flex:0 0 16px;
    width:16px;
    height:16px;
    fill:none;
    stroke:var(--cd-gold);
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
    opacity:.85;
}

/* ---------- মেনু খোলার সময় একটার পর একটা ভেসে আসা ---------- */
@keyframes catItemIn{
    from{opacity:0;transform:translateX(-18px)}
    to{opacity:1;transform:none}
}
@keyframes catFadeIn{
    from{opacity:0;transform:translateY(-6px)}
    to{opacity:1;transform:none}
}
.category-drawer.active .category-drawer-head{
    animation:catFadeIn .5s var(--cd-ease) .08s backwards;
}
.category-drawer.active .cat-item{
    animation:catItemIn .5s var(--cd-ease) backwards;
    animation-delay:calc(var(--i, 0) * 55ms + 140ms);
}
.category-drawer.active .cat-foot{
    animation:catFadeIn .5s var(--cd-ease) .5s backwards;
}

/* ---------- হেডারের ক্যাটাগরি বাটন (গ্রিড আইকন) ---------- */
.category-header-btn{
    border:1px solid rgba(255,255,255,.14);
    -webkit-tap-highlight-color:transparent;
    transition:background .2s, border-color .2s, box-shadow .25s, transform .2s;
}
.category-header-btn:hover{
    background:rgba(255,255,255,.22);
    border-color:rgba(255,176,32,.55);
}
.category-header-btn:active{transform:scale(.92)}
.category-header-btn.is-active{
    border-color:#ffb020;
    box-shadow:0 0 0 4px rgba(255,176,32,.22);
}
.category-header-btn:focus-visible{
    outline:2px solid #ffb020;
    outline-offset:2px;
}

/* ---------- মোশন কমাতে চাইলে ---------- */
@media (prefers-reduced-motion:reduce){
    .category-drawer,
    .category-overlay,
    .cat-item,
    .cat-arrow,
    .category-close{transition-duration:.01ms !important}
    .category-drawer.active .category-drawer-head,
    .category-drawer.active .cat-item,
    .category-drawer.active .cat-foot{animation:none}
}
