:root {
    --bg-dark: #0f1115;
    --bg-card: rgba(25, 28, 36, 0.7);
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(15, 17, 21, 0.6);
    --glass-blur: blur(12px);
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #050505;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 25%);
    background-attachment: fixed;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-dark);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
}

.brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cart-icon {
    position: relative;
    font-size: 1.2rem;
    color: var(--text-main);
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.cart-icon:hover {
    background: rgba(255,255,255,0.1);
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    height: 18px;
    min-width: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    transform: translate(25%, -25%);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1);
}

.badge.pop {
    transform: translate(25%, -25%) scale(1.3);
}

/* Categories */
.categories {
    display: flex;
    gap: 12px;
    padding: 0 24px 20px 24px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}
.categories::-webkit-scrollbar {
    display: none; /* Chrome */
}

.category-btn {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.category-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Main Content */
main {
    padding-top: 24px;
    padding-bottom: 100px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 24px;
}

.section-title h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.status-pill {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Product Cards */
.products-grid {
    display: grid;
    gap: 20px;
    padding: 0 24px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border-color: rgba(139, 92, 246, 0.3);
}

.image-wrapper {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: #1a1d24;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .image-wrapper img {
    transform: scale(1.05);
}

.product-info {
    padding: 16px;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.product-info .price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.stock-info {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.stock-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.3s, color 0.3s;
}

.stock-label strong {
    color: var(--text-main);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
    gap: 12px;
}

/* Floating Admin */
.floating-admin {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 432px;
    background: rgba(20, 22, 28, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 20;
}

.admin-avatar {
    position: relative;
    width: 36px;
    height: 36px;
}

.admin-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--success);
    border: 2px solid #14161c;
    border-radius: 50%;
}

.admin-text p {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.admin-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Modals Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Bottom Sheet */
#checkout-modal {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bottom-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--bg-dark);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border: 1px solid var(--border);
    border-bottom: none;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
}

#checkout-modal.active .bottom-sheet {
    transform: translateY(0);
}

.sheet-header, .drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.sheet-body {
    padding: 24px;
}

.sheet-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
}

.size-selector h4 {
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.size-options {
    display: flex;
    gap: 12px;
}

.size-option {
    flex: 1;
    cursor: pointer;
}

.size-option input {
    display: none;
}

.size-box {
    display: block;
    text-align: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.2s;
    background: rgba(255,255,255,0.02);
}

.size-stock {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.size-option input:checked + .size-box {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
}

.size-option.out-of-stock {
    opacity: 0.5;
    pointer-events: none;
}

.sheet-footer {
    padding: 20px 24px 30px;
    border-top: 1px solid var(--border);
}

.btn-checkout {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-checkout:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.btn-checkout:not(:disabled):hover {
    background: var(--primary-hover);
}

/* Cart Drawer */
#cart-drawer-overlay {
    display: flex;
    justify-content: flex-end; /* right side */
}

.cart-drawer {
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: var(--bg-dark);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
    display: flex;
    flex-direction: column;
}

#cart-drawer-overlay.active .cart-drawer {
    transform: translateX(0);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.empty-cart {
    text-align: center;
    color: var(--text-muted);
    margin-top: 50px;
}

.cart-item {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.02);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.cart-item-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.cart-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.cart-item-price {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.drawer-footer {
    padding: 20px 24px 30px;
    border-top: 1px solid var(--border);
    background: var(--bg-dark);
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cart-summary h3 {
    color: var(--text-main);
}

#btn-wa-checkout {
    background: #25D366; /* WhatsApp Green */
}
#btn-wa-checkout:hover {
    background: #20BA56;
}

/* Toast */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--success);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 100;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1);
    width: calc(100% - 48px);
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast i {
    font-size: 1.5rem;
    color: var(--success);
}

.toast h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.toast p {
    font-size: 0.8rem;
    color: var(--text-muted);
}
