/* ======================================================
   DADAXWEAR LUXURY EDITION - v12.0 (ULTRA-PREMIUM)
   Focus: Fixed Checkout, Glassmorphism, Stylish Add Icon
====================================================== 
*/

:root {
    --primary: #ff6b00;
    --primary-glow: rgba(255, 107, 0, 0.4);
    --bg: #050607;
    --card: #0f1115;
    --card-hover: #16191e;
    --text-white: #ffffff;
    --text-muted: #8e9aaf;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass: rgba(12, 14, 17, 0.95);
}

/* --- Base Reset --- */
* {
    margin: 0; padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg);
    color: var(--text-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Header --- */
.top-header {
    background: var(--glass);
    height: 65px;
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(25px);
    display: flex; align-items: center;
}

.header-container {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 18px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo-wrapper {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #1e2024 0%, #050607 100%);
    border-radius: 10px; border: 1px solid var(--border-color);
    padding: 6px;
}
.web-logo { width: 100%; height: 100%; object-fit: contain; }
.logo-text { font-size: 1.15rem; font-weight: 900; letter-spacing: -0.5px; text-transform: uppercase; }
.logo-text span { color: var(--primary); }

.header-actions { display: flex; align-items: center; }
.admin-badge {
    background: rgba(255, 107, 0, 0.1); color: var(--primary);
    width: 38px; height: 38px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-right: 12px; text-decoration: none; border: 1px solid rgba(255, 107, 0, 0.2);
}
.user-trigger { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--primary); padding: 2px; }
#user-logo-display { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* --- Category Pills --- */
.category-wrapper { padding: 15px 0 10px 18px; overflow-x: auto; scrollbar-width: none; }
.category-wrapper::-webkit-scrollbar { display: none; }
.category-slider { display: flex; gap: 10px; white-space: nowrap; }
.cat-pill {
    background: #111316; color: #8e9aaf; border: 1px solid var(--border-color);
    padding: 10px 22px; border-radius: 14px; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cat-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 5px 15px var(--primary-glow); }

/* --- Sections --- */
.section-container { padding: 20px 16px; margin-bottom: 20px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; }
.badge-count { background: #1a1d21; padding: 3px 12px; border-radius: 50px; font-size: 0.75rem; color: var(--primary); font-weight: 700; border: 1px solid var(--border-color); }

/* --- [PREMIUM REBUILD] Product Card --- */
.product-grid {
    display: grid; 
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.product-card {
    background: transparent; 
    transition: 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.img-wrapper {
    width: 100%; 
    aspect-ratio: 1/1;
    background: #0f1115;
    overflow: hidden;
    position: relative;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.img-wrapper img { 
    width: 100%; height: 100%; object-fit: cover; 
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1); 
}

.product-card:active .img-wrapper img { transform: scale(1.08); }

.product-info { padding: 12px 6px; position: relative; }

.product-info h3 {
    font-size: 0.88rem; 
    font-weight: 500;
    color: #f1f5f9;
    margin-bottom: 4px; 
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-bottom { display: flex; justify-content: space-between; align-items: center; }
.product-price { font-size: 1.1rem; font-weight: 800; color: var(--primary); letter-spacing: -0.3px; }

/* Stylish Add Button (Floating Style) */
.add-btn-small {
    background: linear-gradient(135deg, var(--primary), #ff8c33);
    color: #fff; 
    width: 34px; height: 34px; 
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px var(--primary-glow);
    border: none;
    font-size: 1rem;
    transition: 0.3s ease;
}

.add-btn-small:active { transform: scale(0.85) rotate(90deg); }

/* --- [FIXED] Cart Drawer --- */
.cart-drawer {
    position: fixed; top: 0; right: -100%; width: 100%; max-width: 420px;
    height: 100vh; background: #0c0e11; z-index: 2001;
    transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex; flex-direction: column;
}
.cart-drawer.open { right: 0; }

.cart-header {
    padding: 20px 24px; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.close-drawer { background: #1a1d21; border: none; color: #fff; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }

/* Scrollable Cart Body */
.cart-body { 
    padding: 20px; flex: 1; overflow-y: auto;
    scrollbar-width: none;
}
.cart-body::-webkit-scrollbar { display: none; }

.cart-item {
    display: flex; gap: 14px; background: rgba(255,255,255,0.03);
    padding: 12px; border-radius: 18px; margin-bottom: 12px;
    border: 1px solid var(--border-color);
    align-items: center;
}
.cart-item-img { width: 55px; height: 55px; border-radius: 12px; object-fit: cover; background: #1a1d21; }
.cart-item-details { flex: 1; }
.cart-item-details h4 { font-size: 0.85rem; margin-bottom: 2px; color: #fff; font-weight: 600; }
.cart-item-details p { font-size: 0.95rem; color: var(--primary); font-weight: 800; }

.qty-control {
    display: flex; align-items: center; gap: 10px;
    background: #1a1d21; padding: 4px 10px; border-radius: 12px;
    border: 1px solid var(--border-color);
}
.qty-btn { background: none; border: none; color: var(--primary); font-size: 1.1rem; font-weight: bold; cursor: pointer; }

/* FIXED FOOTER SYSTEM */
.cart-footer {
    padding: 24px; 
    background: #121417; 
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    margin-top: auto; /* Ensures it stays at bottom */
}

.cart-summary { display: flex; justify-content: space-between; margin-bottom: 20px; align-items: baseline; }
.cart-summary span:first-child { color: var(--text-muted); font-weight: 500; font-size: 0.9rem; }
.cart-summary #cart-subtotal { font-size: 1.4rem; font-weight: 900; color: var(--primary); }

.master-checkout-btn {
    all: unset;
    background: var(--primary); color: #fff;
    width: 100%; height: 56px; border-radius: 18px;
    font-weight: 800; font-size: 1rem; display: flex; 
    align-items: center; justify-content: center; gap: 12px;
    box-shadow: 0 10px 25px var(--primary-glow);
    transition: 0.3s;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.master-checkout-btn:active { transform: scale(0.96); }

/* --- Bottom Nav --- */
.bottom-nav {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 92%; max-width: 420px; height: 68px;
    background: rgba(18, 20, 25, 0.96); backdrop-filter: blur(20px);
    border: 1px solid var(--border-color); border-radius: 22px;
    z-index: 1500; display: flex; justify-content: space-around; align-items: center;
    box-shadow: 0 15px 45px rgba(0,0,0,0.7);
}

.nav-link { color: #5c6370; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; }
.nav-link.active { color: var(--primary); }
.nav-link i { font-size: 1.4rem; }
.nav-label { font-size: 0.7rem; font-weight: 700; }

#cart-count-badge {
    position: absolute; top: -6px; right: -8px;
    background: var(--primary); color: #fff; font-size: 0.65rem;
    min-width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; border: 2px solid #121419;
}

/* Toast System */
#toast-container { position: fixed; bottom: 105px; left: 50%; transform: translateX(-50%); z-index: 9999; width: 90%; max-width: 350px; pointer-events: none; }
#toast { 
    background: #fff; color: #000; padding: 14px 24px; border-radius: 16px; 
    font-weight: 700; font-size: 0.9rem; text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    opacity: 0; transform: translateY(20px); transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.show-toast #toast { opacity: 1; transform: translateY(0); }

/* Overlay */
#cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); z-index: 2000; display: none; }

@media (min-width: 768px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
    .section-container { max-width: 1100px; margin: 0 auto; }
}
