/* Desktop Navbar */
.main-navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1050; background: #FFFFFF; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); transition: transform 0.4s ease-in-out; transform: translateY(0); --nav-h: 80px; }
.main-navbar.navbar-hidden { transform: translateY(-100%); }
.main-navbar.navbar-visible { transform: translateY(0); }
.navbar-content { padding: 15px 0; }
.logo img { height: 50px; width: auto; max-width: 100%; transition: transform 0.3s ease; object-fit: contain; }

/* Search */
.search-container { position: relative; width: 100%; max-width: 400px; }
.search-input { width: 100%; padding: 8px 36px 8px 10px; border: 1px solid transparent; border-radius: 25px; height: 30px; background-color: #eae6e6!important; outline: none; font-size: 14px; font-family: "AloveraDisplay", sans-serif; }
.search-container img { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 16px!important; color: #666!important; pointer-events: none; }
.search-input::placeholder { color: #999; }

/* Category Navigation */
.category-list { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 0 auto; padding-left: 0; list-style: none; }
.category-list a { color: #000000; text-decoration: none; font-size: 16px!important; opacity: 0.7; letter-spacing: 1px; transition: color 0.3s ease; font-family: "AloveraDisplay", sans-serif; font-weight: 100; -webkit-text-stroke: 0 transparent; }
.category-list a:hover { color: #000000; opacity: 1;  transition: 0.3s ease-in-out; -webkit-text-stroke: 0.7px #000; }
.category-list > li > a { display: inline-block; text-decoration: none; }

/* Navigation Icons */
.nav-icons .nav-icon { color: #000000; font-size: 20px; margin: 0 8px; text-decoration: none; position: relative; transition: all 0.3s ease; }
.nav-icons .nav-icon:hover { color: #9A0000; transform: scale(1.1); }

/* Cart Count */
.cart-count {
	position: absolute;
	top: 12px;
	right: 4px;
	/* background: #bab1b1; */
	color: #000;
	font-size: 10px;
	padding: 2px 6px;
	border-radius: 50%;
	min-width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
}
/* Social Icons */
.social-icons .social-link { color: #000000; margin: 0 5px; font-size: 16px; text-decoration: none; border: 1px solid #000000; border-radius: 50%; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; box-sizing: border-box; }
.social-icons .social-link i { line-height: 1; }
.social-link:hover { background: #9A0000; color: white; }

/* Dropdown Styles */
.category-item { position: relative; }
.category-item::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 0; height: 1px; background-color: #4F0808; transition: width 0.3s ease; }
.category-item:hover::after { width: 100%; }
.subcategory-dropdown { position: absolute; top: 100%; left: 0; background: #FFFFFF; border-radius: 8px; min-width: 200px; opacity: 0; visibility: hidden; margin-top: 10px; transition: all 0.3s ease; z-index: 1000; }
.category-item:hover .subcategory-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.subcategory-dropdown ul { list-style: none; margin: 0; padding: 10px 0; }
.subcategory-dropdown li { margin: 0; }
.subcategory-dropdown a { color: #333 !important; padding: 1px 1px !important; font-size: 13px !important; border-bottom: 1px solid #f0f0f0; transition: background 0.2s ease; display: block; }
.subcategory-dropdown a:hover { background: #000; color: #9A0000 !important; }
.subcategory-dropdown li:last-child a { border-bottom: none; }
.has-dropdown > a::after { content: '\f107'; font-family: "Font Awesome 5 Free"; font-weight: 900; margin-left: 5px; font-size: 12px; transition: transform 0.3s ease; }
.category-item:hover .has-dropdown > a::after { transform: rotate(180deg); }

/* Mobile Navbar */
.mobile-navbar { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 1050; background: white; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); padding: 15px 0; }
.mobile-search { display: none; width: 100%; padding: 10px 0; border-top: 1px solid #f0f0f0; }
.mobile-search .search-input { border: 2px solid #4f0808; border-radius: 15px; padding: 10px 15px; width: 100%; }

/* Mobile Menu */
.mobile-menu { position: fixed; top: 0; left: -100%; width: 85%; max-width: 400px; min-width: 280px; height: 100vh; background: white; z-index: 1100; transition: left 0.3s ease; box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1); overflow-y: auto; }
.mobile-menu.open { left: 0; }
.mobile-menu-header { padding: 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; background: #9A0000; color: white; position: sticky; top: 0; z-index: 10; }
.close-menu { background: none; border: none; font-size: 24px; cursor: pointer; color: white; }
.mobile-category-list { list-style: none; padding: 0; margin: 0; }

/* Mobile Menu Icons */
.category-icon-img { width: 24px; height: 24px; object-fit: cover; border-radius: 4px; margin-right: 12px; }
.category-icon-fallback { width: 24px; height: 24px; font-size: 16px; color: #9A0000; margin-right: 12px; display: flex; align-items: center; justify-content: center; }
.subcategory-icon-img { width: 20px; height: 20px; object-fit: cover; border-radius: 3px; margin-right: 10px; }
.subcategory-icon-fallback { width: 20px; height: 20px; font-size: 12px; color: #666; margin-right: 10px; display: flex; align-items: center; justify-content: center; }
.category-info { display: flex; align-items: center; }
.category-name { font-size: 16px; font-weight: 500; color: #333; }
.subcategory-name { font-size: 14px; color: #666; }

/* Mobile Category Links */
.category-link { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; color: #333; text-decoration: none; font-size: 16px; font-weight: 500; transition: background-color 0.2s; font-family: "Bona Nova", serif; }
.category-link:hover { background-color: #f8f9fa; color: #9A0000; }
.category-toggle { background: none; border: none; color: #9A0000; font-size: 14px; cursor: pointer; padding: 5px; }
.subcategory-list { background-color: #f8f9fa; padding: 0; margin: 0; list-style: none; max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out, padding 0.3s ease-out; }
.subcategory-list.show { max-height: 500px; transition: max-height 0.4s ease-in, padding 0.3s ease-in; }
.subcategory-item { border-bottom: 1px solid #e9ecef; }
.subcategory-item:last-child { border-bottom: none; }
.subcategory-link { display: flex; align-items: center; padding: 12px 40px; color: #666; text-decoration: none; font-size: 14px; transition: all 0.2s; position: relative; }
.subcategory-link:before { content: "•"; position: absolute; left: 25px; color: #9A0000; }
.subcategory-link:hover { background-color: #e9ecef; color: #9A0000; padding-left: 45px; }
.category-icon { margin-right: 10px; color: #9A0000; font-size: 18px; }
.category-toggle i { transition: transform 0.3s ease; }
.category-toggle.active i { transform: rotate(180deg); }

/* User Dropdown */
.user-dropdown { display: none; position: absolute; top: 100%; right: 0; background: white; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); border-radius: 8px; min-width: 200px; z-index: 1000; }
.user-dropdown ul { list-style: none; margin: 0; padding: 10px 0; }
.user-dropdown li a { display: block; padding: 10px 20px; color: #333; text-decoration: none; font-size: 14px; }
.user-dropdown li a:hover { background: #f8f9fa; color: #9A0000; }

/* Cart Sidebar */
.cart-sidebar { position: fixed; top: 0; right: -500px; width: 500px; height: 100vh; background: white; z-index: 1100; transition: right 0.3s ease; box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1); }
.cart-sidebar.open { right: 0; }
.cart-header { padding: 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; background: var(--third-color); color: white; font-family: "Conthic", sans-serif; }
.close-cart { background: none; border: none; font-size: 24px; cursor: pointer; color: white; }
.cart-content { padding: 20px; height: calc(100vh - 160px); overflow-y: auto; }
.cart-footer { padding: 20px; border-top: 1px solid #f0f0f0; background: #f8f9fa; position: absolute; bottom: 0; left: 0; right: 0; }
.cart-subtotal { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 15px; }
.cart-buttons { display: flex; gap: 10px; }
.view-cart-btn, .checkout-btn { flex: 1; padding: 10px; text-align: center; text-decoration: none; border-radius: 5px; font-weight: bold; transition: all 0.3s ease; }
.view-cart-btn { background: var(--background-color); color: var(--third-color); border: 2px solid var(--third-color); }
.view-cart-btn:hover { background: var(--third-color); color: var(--background-color); }
.checkout-btn { background: var(--third-color); color: var(--background-color); }
.checkout-btn:hover { background: var(--background-color); color: var(--third-color); border: 1px solid var(--third-color); }

/* Search Results */
.search-results { position: absolute; top: 55px; left: -170px!important; right: 0; padding-left: 5px; background: white; border: 1px solid #ddd; border-radius: 5px; max-height: 500px; width: 420px; overflow-y: auto; z-index: 1000; display: none; }
.search-results li { display: flex; align-items: center; border-bottom: 1px solid #ddd; padding: 10px; cursor: pointer; list-style: none; }
.search-results li:hover { background: #f8f9fa; }
.search-results li:last-child { border-bottom: none; }
.search-results li img { width: 35px; height: 35px; object-fit: cover; border-radius: 5px; margin-right: 5px; }
.search-results li a { font-size: 12px; font-weight: bold; text-decoration: none; color: #4f0808; }
.search-results li a:hover { color: #9A0000; }

/* Hidden class for mobile search */
.hidden-no-space { display: none !important; width: 0 !important; height: 0 !important; overflow: hidden !important; padding: 0 !important; margin: 0 !important; flex: 0 0 0% !important; }

/* Body padding for fixed navbar */
body { padding-top: 80px; }

/* Desktop Mega Menu */
@media (min-width: 769px) {
  .subcategory-dropdown { position: absolute; top: 100%; left: 0; background: #FFFFFF; min-width: 200px; border-radius: 0; padding: 16px 0; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease, visibility .2s; z-index: 1040; }
  .subcategory-dropdown .mega-inner { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
  .subcategory-dropdown ul { display: grid !important; grid-template-columns: 1fr; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
  .subcategory-dropdown li { border: 0; margin: 0; }
  .subcategory-dropdown a { display: block; border: 0 !important; color: #9A0000 !important; font-size: 14px; text-decoration: none; transition: color .15s ease, padding-left .15s ease; }
  .subcategory-dropdown a:hover { color: #000 !important; padding-left: 4px; background: transparent; }
  .subcategory-link:before { content: none !important; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-navbar { display: none; }
    .mobile-navbar { display: block; }
    .cart-sidebar { width: 90%; }
    .mobile-menu { width: 90%; }
    body { padding-top: 70px; }
    .cart-count { position: absolute; top: 31px; right: 17px; ; color: #000; font-size: 10px; padding: 2px 5px; border-radius: 50%; min-width: 16px; height: 16px; }
    .category-icon-img { width: 20px; height: 20px; margin-right: 10px; }
    .category-icon-fallback { width: 20px; height: 20px; font-size: 14px; margin-right: 10px; }
    .subcategory-icon-img { width: 18px; height: 18px; margin-right: 8px; }
    .subcategory-icon-fallback { width: 18px; height: 18px; font-size: 11px; margin-right: 8px; }
    .category-name { font-size: 15px; }
    .subcategory-name { font-size: 13px; }
}

/* Center navigation on desktop */
@media (min-width: 768px) {
  .main-navbar .col-lg-8.col-md-8 { display: flex !important; justify-content: center !important; }
}