/* Global Horizontal Scroll Fix */
html, body {
    overflow-x: hidden;
}

:root {
    /* Old Project Colors */
    --erust-primary: #13ec5b;
    --erust-primary-dark: #10d14f;
    --erust-primary-light: #e8fcef;
    --erust-text: #111813;
    --erust-text-secondary: #61896f;
    --erust-bg-light: #f6f8f6;

    /* Existing Project Vars (kept for compatibility) */
    --erust-primary-hover: #0a8f36;
    --erust-secondary: #e8f5e9;
    --erust-accent: #f9a825;

    /* Text Colors */
    --text-main: #1a1a1a;
    --text-muted: #666666;
    --text-light: #ffffff;

    /* Backgrounds */
    --bg-main: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-glass: rgba(255, 255, 255, 0.85);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);

    /* Font Families */
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

/* Typography */
body {
    background-color: var(--bg-secondary);
    color: var(--text-main);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.display-1,
.display-2,
.display-3,
.display-4,
.section-heading,
.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.section-heading {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
    font-size: 2.25rem;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--erust-primary);
    border-radius: 2px;
}

/* Buttons - Global Standardized Styles */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    transition: var(--transition-fast);
}

/* Primary Button (Filled - Green) */
.btn-success,
.btn-erust-primary {
    border-radius: 8px;
    background-color: var(--erust-primary);
    border-color: var(--erust-primary);
    color: var(--bs-btn-active-color, #fff);
}

.btn-success:hover,
.btn-erust-primary:hover {
    background-color: var(--erust-primary-hover);
    border-color: var(--erust-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(12, 169, 64, 0.3);
    color: var(--bs-btn-active-color, #fff);
}

.btn-success:active,
.btn-erust-primary:active {
    color: var(--bs-btn-active-color, #fff);
    background-color: var(--bs-btn-active-bg, var(--erust-primary-hover));
    border-color: var(--bs-btn-active-border-color, var(--erust-primary-hover));
}

/* Outline Button (Border - Green) */
.btn-outline-success,
.btn-erust-outline {
    border-radius: 8px;
    color: var(--erust-primary);
    border-color: var(--erust-primary);
    background-color: transparent;
}

.btn-outline-success:hover,
.btn-erust-outline:hover {
    color: var(--bs-btn-active-color, #fff);
    background-color: var(--erust-primary);
    border-color: var(--erust-primary);
}

.btn-outline-success:active,
.btn-erust-outline:active {
    color: var(--bs-btn-active-color, #fff);
    background-color: var(--bs-btn-active-bg, var(--erust-primary-hover));
    border-color: var(--bs-btn-active-border-color, var(--erust-primary-hover));
}

/* Global 8px Border Radius for Cards, Inputs, Search Boxes */
.card,
.form-control,
.form-select,
.input-group,
.search-input,
.custom-search-input,
.dropdown-menu,
.alert,
.badge,
.modal-content {
    border-radius: 8px !important;
}

/* Responsive Button Sizes */
@media (min-width: 768px) {
    .btn-sm.btn-md-lg {
        padding: 0.75rem 1.75rem;
        font-size: 1.125rem;
    }
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    z-index: 1030;
}

.navbar-brand {
    font-size: 1.75rem;
    color: var(--erust-primary) !important;
}

.nav-link {
    font-weight: 600;
    color: var(--text-main) !important;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    color: var(--erust-primary) !important;
}

/* Hover Dropdown Logic */
@media (min-width: 992px) {
    .navbar-nav .dropdown:hover>.dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

/* Standard Dropdown Item Styles */
.dropdown-menu .dropdown-item {
    padding: 0.5rem 1.5rem;
    transition: background-color 0.2s, color 0.2s;
    border-left: 3px solid transparent;
    font-family: var(--font-body);
    font-weight: 500;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    background-color: var(--erust-primary-light);
    color: var(--erust-text);
    border-left-color: var(--erust-primary);
}

.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active {
    background-color: var(--erust-primary);
    color: white;
    border-left-color: var(--erust-primary);
}

/* Mega Menu Styles */
.mega-menu {
    width: 750px;
    padding: 0;
    overflow: hidden;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    z-index: 1000;
}

.mega-menu-content {
    background: #fff;
}

.mega-menu-list {
    padding: 0.5rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.mega-menu-list .dropdown-item {
    padding: 0.5rem 1.5rem;
    transition: background-color 0.2s, color 0.2s;
    border-left: 3px solid transparent;
    font-family: var(--font-body);
    /* Ensure font match */
}

.mega-menu-list .dropdown-item:hover {
    background-color: var(--erust-primary-light);
    color: var(--erust-text);
    border-left-color: var(--erust-primary);
}

.mega-menu-image-container {
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: 100%;
    min-height: 280px;
}

.mega-menu-image {
    width: 100%;
    height: 100%;
    background-color: var(--bg-main);
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
}

/* Premium Card Styles */
.card-premium {
    background: var(--bg-main);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    overflow: hidden;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card-premium:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    background-color: var(--bg-main);
    overflow: hidden;
}

.card-image-wrapper img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition-smooth);
}

.card-premium:hover .card-image-wrapper img {
    transform: translate(-50%, -50%) scale(1.05);
}

/* Hover Actions Overlay */
.card-actions {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-smooth);
    z-index: 2;
}

.card-premium:hover .card-actions {
    opacity: 1;
    transform: translateY(0);
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-main);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition-fast);
    text-decoration: none;
}

.action-btn:hover {
    background: var(--erust-primary);
    color: white;
}

/* Card Content */
.card-body-custom {
    padding: 1.5rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.card-title-custom {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-title-custom a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition-fast);
}

.card-title-custom a:hover {
    color: var(--erust-primary);
}

.card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--erust-primary);
    margin-top: auto;
}

/* Slick Custom Navigation */
.slick-prev-custom,
.slick-next-custom,
.slick-prev-category,
.slick-next-category {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: var(--bg-main);
    border: 1px solid var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    color: var(--text-main);
    font-size: 1.25rem;
}

.slick-prev-custom:hover,
.slick-next-custom:hover,
.slick-prev-category:hover,
.slick-next-category:hover {
    background: var(--erust-primary);
    color: white;
    border-color: var(--erust-primary);
    box-shadow: var(--shadow-md);
}

.slick-prev-custom,
.slick-prev-category {
    left: -24px;
}

.slick-next-custom,
.slick-next-category {
    right: -24px;
}

/* Newsletter */
.newsletter-section {
    background-color: var(--erust-secondary);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

.newsletter-form .form-control {
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
}

.newsletter-form .form-control:focus {
    box-shadow: var(--shadow-sm);
    border-color: var(--erust-primary);
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-video-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Slider Responsive Fixes */
@media (max-width: 992px) {
    #mainSlider .carousel-item {
        height: auto !important;
        max-height: none !important;
    }

    #mainSlider .carousel-item video,
    #mainSlider .carousel-item img {
        height: auto !important;
        max-height: 500px !important;
        /* Cap height on mobile so it doesn't take full scroll */
        object-fit: contain !important;
        /* Ensure video is not cropped */
        position: relative !important;
        /* Reset any absolute positioning if present */
    }

    /* Ensure slider captions are visible or adjusted if needed */
    #mainSlider .carousel-caption {
        position: relative;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        width: 100%;
        margin: 0;
        border-radius: 0;
    }
}

/* Sidebar Filter Styles */
.sidebar-filter {
    background: var(--bg-main);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.sidebar-section {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-main);
    margin: 1rem 0.5rem;
    display: flex;
    align-items: center;
}

.sidebar-title i {
    color: var(--erust-primary);
}

/* Search Input */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 0.875rem 3rem 0.875rem 1rem;
    border: 2px solid var(--bg-secondary);
    border-radius: 50px;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    background: var(--bg-secondary);
}

.search-input:focus {
    border-color: var(--erust-primary);
    background: var(--bg-main);
    box-shadow: 0 0 0 4px rgba(19, 236, 91, 0.1);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    position: absolute;
    right: 6px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--erust-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.search-btn:hover {
    background: var(--erust-primary-hover);
    transform: scale(1.05);
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 0.25rem;
}

.category-link {
    display: flex;
    align-items: center;
    padding: 0.20rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition-fast);
    border: 2px solid transparent;
}

.category-link:hover {
    background: var(--erust-primary-light);
    color: var(--erust-primary-hover);
    transform: translateX(4px);
}

.category-link.active {
    background: var(--erust-primary);
    color: white;
    font-weight: 600;
}

.category-link.active i {
    color: white;
}

.category-link i {
    font-size: 0.9rem;
    color: var(--erust-primary);
}

.category-link span {
    flex-grow: 1;
}

/* Custom Search Input Standardized */
.custom-search-wrapper {
    position: relative;
    width: 100%;
}

.custom-search-input {
    border-radius: 50px !important;
    padding-left: 1.5rem !important;
    padding-right: 3rem !important;
    /* Space for button */
    border: 1px solid #ced4da;
    height: 48px;
    /* Consistent height */
}

.custom-search-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
    border-color: #198754;
}

.custom-search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #198754;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    z-index: 5;
}

.custom-search-btn:hover {
    background-color: rgba(25, 135, 84, 0.1);
}

.custom-search-btn i {
    font-size: 1.2rem;
}