:root {
    --primary-color: #0d6efd;
    --secondary-color: #f8f9fa;
    --dark-color: #1f2937;
    --muted-color: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #16a34a;
}

/* =========================================
   STICKY PREMIUM HEADER
========================================= */

.header {
    position: sticky !important;
    top: 0;
    z-index: 1050;
    width: 100%;
    transition: all 0.35s ease;
}

/* =========================================
   MAIN HEADER
========================================= */

.main-header {
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    border-bottom: 1px solid rgba(255,255,255,0.4);

    box-shadow:
        0 4px 20px rgba(0,0,0,0.04),
        0 1px 0 rgba(255,255,255,0.5) inset;
}

/* =========================================
   LOGO
========================================= */

.logo {
    text-decoration: none;
}

.logo .sitename {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;

    background: linear-gradient(135deg, #0d6efd, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =========================================
   SEARCH BAR
========================================= */

.search-widget {
    border-radius: 18px;
}

.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    z-index: 10;
    pointer-events: none;
}

.search-input {
    height: 50px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    padding-left: 50px !important;
    padding-right: 15px;
    box-shadow: none;
}

.search-input:focus {
    border-color: #EC3237;
    box-shadow: 0 0 0 0.15rem rgba(236, 50, 55, 0.15);
}

.search-btn {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    border: none;
    border-radius: 10px;
    padding: 0 10px;
    font-weight: 600;
    background: #EC3237;
    color: #fff;
    transition: all .25s ease;
}

.search-btn:hover {
    background: #F6A3A5;
}

/* =========================================
   HEADER ACTION BUTTONS
========================================= */

.header-actions {
    gap: 10px;
}

.header-action-btn {
    position: relative;

    width: 46px;
    height: 46px;

    border-radius: 16px;

    background: rgba(255,255,255,0.75);

    display: flex;
    align-items: center;
    justify-content: center;

    color: #1f2937;
    font-size: 1.15rem;

    border: 1px solid rgba(255,255,255,0.45);

    transition: all 0.3s ease;

    box-shadow:
        0 4px 15px rgba(0,0,0,0.05),
        inset 0 1px 0 rgba(255,255,255,0.6);

    text-decoration: none;
}

.header-action-btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #0d6efd, #2563eb);
    color: #fff;

    box-shadow:
        0 10px 24px rgba(13,110,253,0.28);
}

/* =========================================
   BADGES
========================================= */

.header-action-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;

    min-width: 20px;
    height: 20px;

    border-radius: 50px;

    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 11px;
    font-weight: 700;

    border: 2px solid #fff;
}

/* =========================================
   NAVIGATION BAR
========================================= */

.header-nav {
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    border-top: 1px solid rgba(255,255,255,0.25);
    border-bottom: 1px solid rgba(255,255,255,0.25);
}

/* =========================================
   NAV MENU
========================================= */

.navmenu > ul {
    display: flex;
    align-items: center;
    gap: 10px;

    margin: 0;
    padding: 8px 6px; /* <-- important fix */

    list-style: none;
}

.navmenu > ul > li {
    position: relative;
    display: flex;
    align-items: center;
    padding: 5px;
}

.navmenu > ul > li > a {
    display: flex;
    align-items: center;
    gap: 7px;

    padding: 13px 18px;

    font-size: 14px;
    font-weight: 600;

    color: #1f2937;
    text-decoration: none;

    border-radius: 14px;

    transition: all 0.25s ease;

    white-space: nowrap;
}

/* Hover */
.navmenu > ul > li > a:hover,
.navmenu > ul > li > a.active {
    background: rgba(13,110,253,0.10);
    color: #0d6efd;
}

/* =========================================
   DROPDOWNS
========================================= */

.navmenu .dropdown ul {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;

    min-width: 240px;

    background: rgba(255,255,255,0.92);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    border-radius: 18px;

    padding: 12px;

    box-shadow:
        0 18px 45px rgba(0,0,0,0.10);

    border: 1px solid rgba(255,255,255,0.45);

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);

    transition: all 0.3s ease;

    list-style: none;
    z-index: 999;
}

.navmenu .dropdown:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navmenu .dropdown ul li a {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 11px 14px;

    border-radius: 12px;

    color: #374151;
    text-decoration: none;
    font-size: 14px;

    transition: all 0.25s ease;
}

.navmenu .dropdown ul li a:hover {
    background: rgba(13,110,253,0.08);
    color: #0d6efd;
    transform: translateX(4px);
}

/* Nested dropdown */
.navmenu .dropdown .dropdown ul {
    top: 0;
    left: calc(100% + 12px);
}

/* =========================================
   ACCOUNT DROPDOWN
========================================= */

.account-dropdown .dropdown-menu {
    width: 320px;
    padding: 0;
    overflow: hidden;

    border: none;
    border-radius: 22px;

    background: rgba(255,255,255,0.94);

    backdrop-filter: blur(18px);

    box-shadow:
        0 22px 50px rgba(0,0,0,0.12);

    margin-top: 18px;
}

.account-dropdown .dropdown-header {
    padding: 22px;

    background:
        linear-gradient(135deg, #0d6efd, #7c3aed);

    color: #fff;
}

.account-dropdown .dropdown-header h6 {
    font-weight: 700;
    margin-bottom: 8px;
}

.account-dropdown .dropdown-body {
    padding: 12px;
}

.account-dropdown .dropdown-item {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 4px;

    transition: all 0.25s ease;
}

.account-dropdown .dropdown-item:hover {
    background: rgba(13,110,253,0.08);
    transform: translateX(4px);
}

.account-dropdown .dropdown-footer {
    padding: 18px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* =========================================
   MOBILE TOGGLE
========================================= */

.mobile-nav-toggle {
    font-size: 1.7rem;
    cursor: pointer;
    color: #1f2937;
    transition: all 0.3s ease;
}

.mobile-nav-toggle:hover {
    color: #0d6efd;
    transform: scale(1.08);
}

/* =========================================
   MOBILE SEARCH
========================================= */

#mobileSearch {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(18px);

    border-top: 1px solid rgba(0,0,0,0.05);

    padding: 16px 0;
}

/* =========================================
   SCROLL EFFECT
========================================= */

.header.scrolled .main-header {
    background: rgba(255,255,255,0.92);
    box-shadow:
        0 10px 35px rgba(0,0,0,0.08);
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1199px) {

    .desktop-search-form {
        display: none;
    }

    .header-nav {
        display: none;
    }

    .main-header {
        padding: 4px 0;
    }
}

@media (max-width: 767px) {

    .logo .sitename {
        font-size: 1.35rem;
    }

    .header-action-btn {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }
}

/* =========================================
   GLOBAL PAGE BACKGROUND
========================================= */

body {
    background:
        radial-gradient(circle at top left, rgba(13,110,253,0.18), transparent 22%),
        radial-gradient(circle at top right, rgba(59,130,246,0.14), transparent 25%),
        radial-gradient(circle at bottom right, rgba(168,85,247,0.18), transparent 28%),
        radial-gradient(circle at bottom left, rgba(14,165,233,0.12), transparent 24%),
        linear-gradient(135deg, #f4f8ff 0%, #edf3fb 35%, #e9eff8 65%, #f8fbff 100%);

    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* =========================================
   FLOATING BLURRED SHAPES
========================================= */

body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(110px);
    z-index: -1;
    opacity: 0.75;
    pointer-events: none;
}

/* Large blue glow */
body::before {
    width: 420px;
    height: 420px;
    background: rgba(13,110,253,0.22);
    top: -120px;
    left: -120px;
}

/* Purple glow */
body::after {
    width: 460px;
    height: 460px;
    background: rgba(168,85,247,0.20);
    bottom: -160px;
    right: -140px;
}

/* =========================================
   ADDITIONAL CENTER AMBIENT GLOW
========================================= */

.main::after {
    content: '';
    position: fixed;
    width: 500px;
    height: 500px;
    background: rgba(59,130,246,0.10);
    top: 30%;
    left: 35%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
}

/* =========================================
   MORE VISIBLE GRID TEXTURE
========================================= */

.main::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.45) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.45) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}

/* Ensure content stays above texture */
.main > * {
    position: relative;
    z-index: 1;
}

.shop-container {
    max-width: 1650px;
}

.shop-toolbar {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,.04);
}

.toolbar-title {
    font-weight: 700;
    color: #1f2937;
}

.toolbar-subtitle {
    font-size: 13px;
    color: #6b7280;
}

.toolbar-select {
    min-width: 240px;
    border-radius: 12px;
    border: 1px solid #dbe2ea;
    height: 46px;
    font-weight: 500;
}

.toolbar-select:focus {
    border-color: #EC3237;
    box-shadow: 0 0 0 0.15rem rgba(236, 50, 55, .15);
}

@media (max-width: 768px) {

    .shop-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-right {
        width: 100%;
    }

    .toolbar-select {
        width: 100%;
        min-width: 100%;
    }
}

/* =========================================
   GLASS EFFECT FOR CARDS
========================================= */

.product-box,
.sidebar .widget-item,
.page-title {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* =========================================
   OPTIONAL SECTION SPACING
========================================= */

.category-product-list {
    position: relative;
    padding: 10px;
    z-index: 2;
}

/* =========================
   PAGE HEADER
========================== */
.page-title {
    background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
    padding: 45px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.breadcrumbs ol {
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
    list-style: none;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumbs li {
    color: var(--muted-color);
    font-size: 14px;
}

.breadcrumbs li a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* =========================
   SIDEBAR
========================== */
.sidebar .widget-item {
    background: #fff;
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
    position: sticky;
    top: 20px;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 12px;
}

.widget-title::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    left: 0;
    bottom: 0;
    border-radius: 20px;
}

.widget-item {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #212529;
}

.category-item {
    border-bottom: 1px solid #f1f3f5;
    margin-right: 5px;
}

.category-item:last-child {
    border-bottom: 0;
}

.category-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: #495057;
    text-decoration: none;
    transition: all .2s ease;
}

.category-item a:hover {
    color: #0d6efd;
    padding-left: 6px;
}

.widgets-container::-webkit-scrollbar,
.category-tree::-webkit-scrollbar {
    width: 6px;
}

.widgets-container::-webkit-scrollbar-thumb,
.category-tree::-webkit-scrollbar-thumb {
    background: #d0d7de;
    border-radius: 20px;
}

.category-tree {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--dark-color);
    background: #f8fafc;
    transition: all 0.25s ease;
    font-weight: 500;
}

.category-item a:hover {
    /*background: var(--primary-color);*/
    background: #EC3237;
    color: #fff;
    transform: translateX(5px);
}

/* =========================
   PRODUCT GRID
========================== */
.product-box {
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    transition: all 0.35s ease;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 5px 20px rgba(0,0,0,0.04);
    position: relative;
}

.product-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 35px rgba(0,0,0,0.10);
}

.product-thumb {
    position: relative;
    overflow: hidden;
    background: #f8fafc;
}

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

.product-box:hover .product-thumb img {
    transform: scale(1.08);
}

.product-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
    opacity: 0;
    transition: all 0.3s ease;
}

.product-box:hover .product-overlay {
    opacity: 1;
}

.product-quick-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-action-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.95);
    color: var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    text-decoration: none;
    backdrop-filter: blur(8px);
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.08);
}

.product-content {
    padding: 22px;
}

.product-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1px;
}

.product-title a {
    color: var(--dark-color);
    text-decoration: none;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
}

.current-price{
    font-size:1.2rem;
    font-weight:700;
    color:#198754;
}

.old-price{
    text-decoration:line-through;
    color:#999;
    margin-left:10px;
}

.product-thumb{
    height:260px;
    overflow:hidden;
}

.product-thumb img{
    width:100%;
    height:100%;
    object-fit:contain;
    background:#fff;
}

.product-badge{
    position:absolute;
    top:10px;
    left:10px;
    z-index:2;
    padding:4px 10px;
    border-radius:20px;
    font-size:.75rem;
    font-weight:600;
}

.product-badge.featured{
    background:#198754;
    color:#fff;
}

.product-badge.category{
    top:45px;
    background:#fff;
    color:#333;
}

.variant-selector {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    font-size: 14px;
}

.variant-selector:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.15rem rgba(13,110,253,.15);
}

.variant-stock {
    color: var(--success-color) !important;
    font-size: 13px;
    font-weight: 500;
}

.add-to-cart-btn {
    background: linear-gradient(135deg, #EC3237, #d62a2f);
    border: none;
    color: #fff;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    letter-spacing: .3px;
}

.add-to-cart-btn:hover {
    background: #d62a2f;
    color: #fff;
    transform: translateY(-2px);
}

.cart-status {
    text-align: center;
}

.cart-status .badge {
    font-size: .78rem;
    padding: 7px 12px;
    border-radius: 999px;
}

.cart-updated {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40,167,69,.2);
    transition: all .3s ease;
}

.cart-qty-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 10px;
    font-size: 18px;
    transition: .25s;
}

.qty-btn:hover {
    background: #EC3237;
    border-color: #EC3237;
    color: #fff;
}

.qty-input {
    width: 65px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 10px;
    height: 36px;
    font-weight: 600;
}

/* =========================
   PAGINATION
========================== */
.pagination {
    gap: 8px;
    flex-wrap: wrap;
}

.page-link {
    border: none;
    border-radius: 12px !important;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-color);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.25s ease;
}

.page-link:hover {
    background: var(--primary-color);
    color: #fff;
}

.page-item.active .page-link {
    background: var(--primary-color);
    color: #fff;
}

.scrollable-dropdown {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Optional scrollbar styling */
.scrollable-dropdown::-webkit-scrollbar {
    width: 6px;
}

.scrollable-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.scrollable-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}



/* =========================
   RESPONSIVE
========================== */
@media (max-width: 991px) {
    .sidebar {
        margin-bottom: 30px;
    }

    .sidebar .widget-item {
        position: relative;
        top: auto;
    }
}

@media (max-width: 767px) {
    .product-thumb img {
        height: 220px;
    }

    .page-title {
        padding: 30px 0;
    }

    .page-title h1 {
        font-size: 1.6rem;
    }
}