:root {
    --bg-body: #050505;
    --bg-card: #0a0a0a;
    --text-dark: #ffffff;
    --text-muted: #a3a3a3;
    --primary-color: #ffffff;
    --primary-light: rgba(255, 255, 255, 0.1);
    --border-color: #262626;

    /* Mappings */
    --text-primary: var(--text-dark);
    --text-secondary: var(--text-muted);
    --accent-main: var(--primary-color);
    --accent-danger: #ef4444;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: float-particle 15s infinite;
}

.particle:nth-child(odd) {
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
}

@keyframes float-particle {

    0%,
    100% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }

    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }

    90% {
        opacity: 1;
        transform: translateY(-10vh) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-20vh) scale(0);
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #262626;
    border-radius: 4px;
}

.sidebar-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle border */
    position: sticky;
    top: 100px;
    /* Adjusted for navbar */
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    z-index: 10;
    backdrop-filter: blur(10px);
}

.category-search {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 12px 15px;
    width: 100%;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.category-search:focus {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.3);
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.category-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid transparent;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.category-item.active {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 10px 20px -5px rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 1.2rem;
    color: #ffffff;
    transition: all 0.2s ease;
}

.category-item.active .category-icon {
    background: #000000;
    color: #ffffff;
}

.category-info {
    flex: 1;
}

.category-name {
    font-weight: 600;
    display: block;
    line-height: 1.2;
    font-size: 0.95rem;
}

.category-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
}

.category-item.active .category-count {
    color: rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.05);
}

.all-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.category-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.18), rgba(15, 23, 42, 1));
    color: #f9fafb;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
}

.category-select-label {
    flex: 1;
    min-height: 40px;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.28);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.28);
    transition: all 0.2s ease;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.category-menu-btn:active {
    transform: translateY(1px);
}

 .category-drawer.offcanvas {
    width: 320px;
    max-width: 92vw;
    background: #000000;
    color: #f9fafb;
}

 .category-drawer-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    padding: 18px 18px;
}

 .category-drawer-title {
    color: #f9fafb;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.3px;
}

 .category-drawer-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.65);
    background: transparent;
    color: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-drawer-list {
    padding: 10px 10px 16px;
}

 .category-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #f9fafb;
}

 .category-drawer-item:hover {
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
}

 .category-drawer-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.category-drawer-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-drawer-info {
    flex: 1;
    min-width: 0;
}

 .category-drawer-name {
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

 .category-drawer-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
    font-weight: 800;
    font-size: 11px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

 .category-drawer-chevron {
    color: rgba(156, 163, 175, 0.9);
    flex-shrink: 0;
}

 .category-drawer-item.active {
    background: rgba(15, 23, 42, 1);
    border: 1px solid #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

 .category-drawer-item.active .category-drawer-chevron {
    color: #ffffff;
}

@media (max-width: 768px) {
    .category-topbar {
        margin-top: 8px;
        padding: 8px 14px;
        border-radius: 999px;
        position: sticky;
        top: 70px;
        z-index: 20;
        box-shadow:
            0 8px 22px rgba(0, 0, 0, 0.85),
            0 0 0 1px rgba(15, 23, 42, 0.95);
    }

    .category-drawer.offcanvas {
        box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9), 0 18px 40px rgba(0, 0, 0, 0.75);
    }

    .category-drawer-item {
        margin-bottom: 2px;
    }
}

.main-content {
    padding: 12px 8px;
}

.product-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.product-item {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 1200px) {
    .product-item {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .product-item {
        flex: 0 0 33.3333%;
        max-width: 33.3333%;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .product-item {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 767.98px) {
    .product-item {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

.product-search-wrapper {
    position: relative;
    margin-bottom: 30px;
}

.product-search {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 16px;
    padding: 16px 20px 16px 50px;
    width: 100%;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.product-search:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: 8px;
    /* Square look */
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
}

.product-card-out {
    opacity: 0.75;
}

.product-card-out .product-img {
    filter: grayscale(100%);
}

.product-card-out .btn-buy {
    border-color: rgba(255, 255, 255, 0.15);
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
}

.product-card-out .btn-buy:hover {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    transform: none;
    box-shadow: none;
}

.btn-buy.btn-buy-disabled {
    cursor: not-allowed;
}

.product-img-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    /* Square look */
    overflow: hidden;
    margin-bottom: 16px;
    background: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sold-out-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.9));
    z-index: 2;
}

.sold-out-label {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: radial-gradient(circle at top, rgba(148, 163, 184, 0.15), rgba(15, 23, 42, 1));
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.8rem;
    text-align: center;
}

.no-image-placeholder i {
    font-size: 1.8rem;
}

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

.product-card:hover .product-img {
    transform: scale(1.1);
}

.product-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    min-height: 48px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #ffffff;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.product-meta-left {
    flex: 1;
}

.price-badge {
    background: transparent;
    color: #ffffff;
    padding: 0;
    border-radius: 0;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
}

.stock-text {
    font-size: 0.8rem;
    color: #f5f5f5;
    margin-top: 2px;
}

#swal-discount::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.btn-buy {
    border-radius: 6px;
    /* Square look */
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #ffffff;
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-buy:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.15);
}

.special-section-title {
    display: inline-block;
    padding: 10px 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .sidebar-card {
        height: auto;
        position: static;
        margin-bottom: 20px;
        top: 0;
    }
}