:root {
    --primary: #2c3e50;
    --primary-light: #34495e;
    --accent: #e74c3c;
    --accent-hover: #c0392b;
    --success: #27ae60;
    --warning: #f39c12;
    --light: #f8f9fa;
    --dark: #1a1a2e;
}

* { font-family: 'Poppins', sans-serif; }

body { background: #f5f6fa; }

/* Top Bar */
.top-bar {
    background: var(--dark);
    color: #fff;
    font-size: 13px;
    padding: 8px 0;
}
.top-bar a { color: #fff; text-decoration: none; }
.top-bar a:hover { color: var(--accent); }

/* Navbar */
.navbar-main {
    background: #fff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    padding: 12px 0;
}
.navbar-brand {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary) !important;
    padding: 0;
}
.navbar-brand span { color: var(--accent); }
.logo-img {
    max-height: 42px;
    max-width: 100%;
    width: auto;
    display: block;
}

@media (max-width: 991px) {
    .logo-img { max-height: 34px; }
    .search-box { max-width: 280px; }
}

@media (max-width: 767px) {
    .logo-img { max-height: 28px; }
}

.nav-link {
    font-weight: 500;
    color: var(--primary) !important;
    padding: 8px 16px !important;
    border-radius: 6px;
    transition: all 0.3s;
}
.nav-link:hover {
    background: var(--light);
    color: var(--accent) !important;
}

.search-box {
    position: relative;
    max-width: 360px;
    width: 100%;
}
.search-box input {
    border-radius: 30px;
    padding: 10px 45px 10px 20px;
    border: 2px solid #e0e0e0;
    width: 100%;
    transition: all 0.3s;
}
.search-box input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(44,62,80,0.1);
}
.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: var(--primary);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.3s;
}
.search-box button:hover { background: var(--accent); }

.icon-btn {
    position: relative;
    color: var(--primary);
    font-size: 20px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s;
    text-decoration: none;
}
.icon-btn:hover {
    background: var(--light);
    color: var(--accent);
}
.icon-btn .badge {
    position: absolute;
    top: -2px;
    right: 2px;
    background: var(--accent);
    font-size: 10px;
    padding: 3px 6px;
}

/* Navbar Toggler */
.navbar-toggler {
    border: 1px solid var(--primary);
    padding: 4px 8px;
    font-size: 16px;
    line-height: 1;
    background: transparent;
    color: var(--primary);
    border-radius: 6px;
}
.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(44,62,80,0.15);
}
.navbar-toggler-icon {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2844, 62, 80, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

/* Mobile Offcanvas Menu */
.offcanvas {
    background: var(--primary);
    color: #fff;
    width: 280px;
}
.offcanvas-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1rem;
}
.offcanvas-title {
    color: #fff;
    font-weight: 600;
}
.mobile-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mobile-nav li a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 12px 0;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s;
}
.mobile-nav li a:hover {
    color: var(--accent);
    padding-left: 8px;
}
.mobile-nav hr {
    border-color: rgba(255,255,255,0.1);
}

/* Category Menu */
.category-menu {
    background: var(--primary);
    padding: 0;
}
.category-menu .nav {
    flex-wrap: nowrap;
    position: relative;
    overflow: hidden;
}
.category-menu .nav-link {
    color: #fff !important;
    padding: 12px 20px !important;
    border-radius: 0;
    font-size: 14px;
    white-space: nowrap;
}
.category-menu .nav-link:hover {
    background: var(--primary-light);
    color: #fff !important;
}
.category-menu .dropdown-menu-dark {
    background: var(--primary);
    border: none;
    border-radius: 0;
    margin-top: 0;
}
.category-menu .dropdown-menu-dark .dropdown-item {
    color: #fff;
    font-size: 14px;
    padding: 10px 20px;
}
.category-menu .dropdown-menu-dark .dropdown-item:hover {
    background: var(--primary-light);
}

/* Buttons */
.btn-primary-custom {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}
.btn-primary-custom:hover {
    background: var(--primary-light);
    color: #fff;
    transform: translateY(-2px);
}
.btn-accent {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}
.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-2px);
}

/* Cards */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: all 0.3s;
    height: 100%;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
.product-card .img-wrap {
    position: relative;
    overflow: hidden;
    padding-top: 100%;
}
.product-card .img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s;
}
.product-card:hover .img-wrap img { transform: scale(1.08); }
.product-card .badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.product-card .card-body { padding: 15px; }
.product-card .category { font-size: 12px; color: #888; text-transform: uppercase; }
.product-card .title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin: 5px 0;
    line-height: 1.4;
    height: 42px;
    overflow: hidden;
}
.product-card .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}
.product-card .price del {
    font-size: 14px;
    color: #888;
    margin-left: 8px;
    font-weight: 400;
}

/* Footer */
.footer-main {
    background: var(--dark);
    color: #aaa;
    padding: 60px 0 30px;
}
.footer-main h5 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}
.footer-main a {
    color: #aaa;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: all 0.3s;
}
.footer-main a:hover { color: var(--accent); padding-left: 5px; }
.footer-main .social a {
    display: inline-block;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 38px;
    margin-right: 8px;
    padding: 0;
}
.footer-main .social a:hover {
    background: var(--accent);
    color: #fff;
    padding-left: 0;
}
.footer-bottom {
    background: #111;
    color: #666;
    padding: 15px 0;
    font-size: 13px;
}

/* Hero Slider */
.hero-slider {
    position: relative;
    height: 450px;
    overflow: hidden;
}
.hero-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s;
    background-size: cover;
    background-position: center;
}
.hero-slider .slide.active { opacity: 1; }
.hero-slider .slide-content {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    max-width: 500px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.hero-slider .slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 100%);
}

/* Breadcrumb */
.breadcrumb-wrap {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 40px 0;
    color: #fff;
}
.breadcrumb-wrap h1 { font-size: 28px; font-weight: 700; }

/* Flash Messages */
.flash-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    animation: slideIn 0.4s ease;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Admin */
.admin-sidebar {
    width: 260px;
    background: var(--dark);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s;
}
.admin-sidebar-header {
    padding: 20px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-sidebar-header span { color: var(--accent); }
.admin-sidebar-menu { padding: 15px 0; }
.admin-sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #aaa;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}
.admin-sidebar-menu a:hover, .admin-sidebar-menu a.active {
    background: #16213e;
    color: #fff;
    border-left-color: var(--accent);
}
.admin-sidebar-menu i { width: 25px; font-size: 16px; }

.admin-main {
    margin-left: 260px;
    min-height: 100vh;
}
.admin-topbar {
    background: #fff;
    padding: 15px 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-content { padding: 25px; }

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.stat-card .icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
}
.stat-card .number { font-size: 24px; font-weight: 700; }
.stat-card .label { color: #888; font-size: 13px; }

.card-table { background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.card-table .card-header { background: transparent; border-bottom: 1px solid #eee; padding: 20px; }

.badge-pending { background: #f39c12; }
.badge-processing { background: #3498db; }
.badge-shipped { background: #9b59b6; }
.badge-delivered { background: #27ae60; }
.badge-cancelled { background: #e74c3c; }
.badge-refunded { background: #95a5a6; }

/* ============================================
   RICH FILTER SIDEBAR
   ============================================ */

.filter-sidebar .card-body {
    padding: 1.5rem;
}

.filter-section h5 {
    font-size: 15px;
    color: var(--primary);
}

.filter-section h5 i {
    font-size: 14px;
}

/* Active Filters */
.active-filters .badge {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 20px;
}
.active-filters .badge a {
    text-decoration: none;
}

/* Sort Options */
.sort-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sort-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}
.sort-item:hover {
    background: #f0f2f5;
    color: var(--primary);
}
.sort-item.active {
    background: rgba(44,62,80,0.08);
    color: var(--primary);
    font-weight: 600;
}
.sort-item i {
    font-size: 12px;
    color: var(--primary);
}

/* Category List */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}
.cat-item:hover {
    background: #f0f2f5;
    color: var(--primary);
}
.cat-item.active {
    background: rgba(44,62,80,0.08);
    color: var(--primary);
    font-weight: 600;
}
.cat-item .cat-count {
    background: #e9ecef;
    color: #666;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}
.cat-item.active .cat-count {
    background: var(--primary);
    color: #fff;
}

/* Price Slider */
.price-slider-wrap {
    position: relative;
    padding: 10px 0;
}
.range-track {
    position: relative;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin: 0 8px;
}
.range-fill {
    position: absolute;
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    top: 0;
}
.range-inputs {
    position: relative;
    height: 6px;
    margin-top: -6px;
}
.range-inputs input[type="range"] {
    position: absolute;
    width: 100%;
    height: 6px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
.range-inputs input[type="range"]::-webkit-slider-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: transform 0.15s;
}
.range-inputs input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.range-inputs input[type="range"]::-moz-range-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    cursor: pointer;
}

/* Custom Check List */
.check-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.check-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    font-weight: 500;
    margin: 0;
    position: relative;
}
.check-item:hover .check-box {
    border-color: var(--primary);
}
.check-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.check-box {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.check-box i {
    font-size: 10px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}
.check-input:checked + .check-box {
    background: var(--primary);
    border-color: var(--primary);
}
.check-input:checked + .check-box i {
    opacity: 1;
    transform: scale(1);
}
.check-label {
    flex: 1;
}
.check-count {
    background: #e9ecef;
    color: #666;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

/* Rating List */
.rating-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rating-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}
.rating-item:hover {
    background: #f0f2f5;
    color: var(--primary);
}
.rating-item.active {
    background: rgba(44,62,80,0.08);
    color: var(--primary);
    font-weight: 600;
}
.rating-item .stars {
    color: #f39c12;
    font-size: 12px;
    margin-right: 6px;
    letter-spacing: 1px;
}
.rating-item .stars .far {
    color: #ccc;
}
.rating-item .rating-text {
    color: #888;
    font-size: 12px;
}

/* Mobile collapse for sidebar */
@media (max-width: 991px) {
    .filter-sidebar {
        margin-bottom: 1rem;
    }
}

/* Responsive */
@media (max-width: 991px) {
    .search-box input { width: 100%; }
    .hero-slider { height: 350px; }
    .hero-slider .slide-content { left: 20px; right: 20px; }
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; }
}
