:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --secondary: #6c757d;
    --success: #198754;
    --info: #0dcaf0;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #212529;
    --text-main: #2b3445;
    --text-muted: #7d879c;
    --border-color: #f3f5f9;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: #f6f9fc;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

/* Header Styles */
.header-top {
    font-size: 0.875rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.main-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    position: relative;
    z-index: 1000;
}

.navbar-brand img {
    height: 50px;
}

.search-bar-container {
    max-width: 600px;
    width: 100%;
}

.search-input-group {
    background: #f3f5f9;
    border-radius: 50px;
    padding: 5px;
    border: 1px solid transparent;
    transition: var(--transition);
    display: flex;
}

.search-input-group:focus-within {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.search-input {
    border: none;
    background: transparent;
    padding: 0 20px;
    height: 40px;
    width: 100%;
    outline: none;
    color: var(--text-main);
}

.search-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* Live Search Results */
#searchResults {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    /* Force full width of container */
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    /* High z-index as requested */
    overflow-y: auto;
    /* Enable scroll */
    max-height: 300px;
    /* Limit height */
    margin-top: 5px;
    /* Slight gap */
    border: 1px solid #eee;
    border-top: none;
}

.psearch-results {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-bottom: 1px solid #f3f5f9;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none !important;
}

.psearch-results:last-child {
    border-bottom: none;
}

.psearch-results:hover {
    background-color: #f8faff;
}

.psearch-results img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid #f1f1f1;
}

.psearch-info {
    flex: 1;
    min-width: 0;
    /* For truncation */
}

.psearch-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.psearch-results:hover .psearch-title {
    color: var(--primary);
}

.psearch-price {
    font-size: 0.9rem;
    color: var(--danger);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.psearch-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.header-action-btn {
    position: relative;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f6f9fc;
    color: var(--text-main);
    transition: var(--transition);
    margin-left: 10px;
}

.header-action-btn:hover {
    background: var(--primary);
    color: #fff;
}

.header-action-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* Catalog Menu */
.desktop-menu {
    border-top: 1px solid #eee;
    background: #fff;
}

.desktop-menu .nav-link {
    font-weight: 600;
    padding: 15px 20px;
    color: var(--text-main);
}

.desktop-menu .nav-link:hover {
    color: var(--primary);
}

/* Banner Slider */
.hero-section {
    padding: 30px 0;
}

.main-slider {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--hover-shadow);
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Categories */
.category-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


.category-card:hover {
    border-color: transparent;
    box-shadow: var(--card-shadow);
    transform: translateY(-5px);
}

.category-icon {
    width: 100px;
    height: 100px;
    background: #eef2ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    transition: var(--transition);
}

.category-card:hover .category-icon {
    background: var(--primary);
    color: #fff;
}

/* Section Heading */
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-left: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 25px;
    background: var(--primary);
    border-radius: 10px;
}

/* Product Card */
.product-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid #f0f0f0;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    height: 100%;
}

.product-card:hover {
    box-shadow: var(--hover-shadow);
    border-color: transparent;
    transform: translateY(-5px);
}

.product-thumb {
    position: relative;
    overflow: hidden;
    padding-top: 100%;
}

.product-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-thumb img {
    transform: scale(1.08);
}

.product-actions {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.product-card:hover .product-actions {
    bottom: 0;
}

.action-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #eee;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    cursor: pointer;
}

.action-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 600;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    height: 3.0em;
    /* Ensure consistent height for grid alignment */
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.old-price {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* Footer */
.modern-footer {
    background: #0f172a;
    color: #94a3b8;
    padding-top: 80px;
    margin-top: 80px;
}

.footer-logo img {
    height: 50px;
    margin-bottom: 25px;
    filter: brightness(0) invert(1);
}

.footer-heading {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 25px;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #94a3b8;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #fff;
    padding-left: 5px;
}

.footer-bottom {
    background: #020617;
    padding: 25px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Scroll To Top */
#scrollToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.3);
}

#scrollToTop.active {
    opacity: 1;
    visibility: visible;
}

#scrollToTop:hover {
    transform: translateY(-5px);
}