@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-green: #4CAF50;
    --primary-blue: #003366;
    --text-gray: #666666;
    --jiji-bg: #f8f9fa;
    --jiji-card-bg: #ffffff;
    --jiji-text: #2a2a2a;
    --jiji-text-muted: #6b7280;
    --jiji-border: #e5e7eb;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    background: var(--jiji-bg) !important;
    color: var(--jiji-text) !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif !important;
    letter-spacing: -0.02em !important;
    color: var(--jiji-text) !important;
}

h1 { font-size: 2rem !important; font-weight: 700 !important; }
h2 { font-size: 1.5rem !important; font-weight: 700 !important; }
h3 { font-size: 1.25rem !important; font-weight: 600 !important; }
h4 { font-size: 1.125rem !important; font-weight: 600 !important; }
h5 { font-size: 1rem !important; font-weight: 600 !important; }
h6 { font-size: 0.875rem !important; font-weight: 600 !important; }

/* Your custom CSS here */

/* Full Width Main Container - Only for Homepage */
body.page-home .main-container,
body.page-home .page-content,
body.page-search .main-container,
body.page-search .page-content {
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
}

body.page-home .container,
body.page-search .container {
    max-width: 100% !important;
}

/* Keep normal container width for product detail pages */
body:not(.page-home):not(.page-search) .main-container .container {
    max-width: 1320px !important;
    margin: 0 auto !important;
}

@media (max-width: 767px) {

    .main-container,
    .page-content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Category Sidebar Styling */
.sidebar-header {
    background: transparent !important;
    padding: 15px 0 !important;
    border-bottom: 1px solid #eee !important;
    color: #333 !important;
}

.sidebar-header h5 {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #333 !important;
}

.sidebar-header a {
    color: #333 !important;
}

.category-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    transition: all 0.2s ease;
    color: #555 !important;
    text-decoration: none !important;
}

.category-list li a:hover {
    color: var(--primary-green) !important;
}

.category-list li a i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    color: var(--primary-green) !important;
}

.category-list .count {
    color: #999 !important;
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    margin-left: auto;
}

.category-list li a::after {
    content: '>';
    font-size: 0.8rem;
    color: #ccc;
    margin-left: 10px;
}

/* Sidebar Boxed Styling */
.sidebar-modern-inner {
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05) !important;
    padding: 20px !important;
    overflow: hidden !important;
}

.sidebar-modern-inner .block-title {
    background: transparent !important;
    color: var(--primary-blue) !important;
    padding: 0 0 15px 0 !important;
    margin-bottom: 15px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    font-weight: 700 !important;
}

.category-list li a:hover {
    color: var(--primary-green) !important;
}

.category-list li a i {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* 4-Column Product Grid Layout */
.make-grid .item-list,
.row-featured .item-list,
.make-list .item-list,
.category-list .item-list {
    width: 25% !important;
    float: left !important;
    padding: 10px !important;
    display: inline-block !important;
}

@media (max-width: 1199px) {

    .make-grid .item-list,
    .row-featured .item-list,
    .make-list .item-list,
    .category-list .item-list {
        width: 33.333% !important;
        /* 3 columns on medium screens */
    }
}

@media (max-width: 991px) {

    .make-grid .item-list,
    .row-featured .item-list,
    .make-list .item-list,
    .category-list .item-list {
        width: 50% !important;
        /* 2 columns on tablets and small screens */
    }
}

@media (max-width: 575px) {

    .make-grid .item-list,
    .row-featured .item-list,
    .make-list .item-list,
    .category-list .item-list {
        width: 50% !important;
        /* 2 columns on mobile - as requested */
        padding: 5px !important;
    }

    /* Smaller cards on mobile */
    .item-list .product-card {
        font-size: 0.85rem;
    }

    .item-list .card-img-top {
        aspect-ratio: 4/3 !important;
        height: auto !important;
    }

    .item-list .card-body {
        padding: 0.75rem !important;
    }

    .item-list .card-title {
        font-size: 0.9rem !important;
        margin-bottom: 0.25rem !important;
    }

    .item-list .card-title a {
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Smaller badges and metadata */
    .item-list .badge {
        font-size: 0.6em !important;
        padding: 0.2em 0.4em !important;
    }

    .item-list .text-muted.small {
        font-size: 0.7rem !important;
    }

    .item-list .text-muted.small a,
    .item-list .text-muted.small span {
        padding: 0.15rem 0.4rem !important;
        font-size: 0.65rem !important;
    }

    /* Smaller price */
    .item-list .text-primary.fw-bold {
        font-size: 1rem !important;
    }

    /* Smaller photo count badge */
    .photo-count {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.4rem !important;
    }
}

/* Fix camera icon stretching */
.photo-count i {
    display: inline-block;
    width: auto;
    flex-shrink: 0;
}

/* Product Card Styling */
.item-list {
    background: #fff;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    overflow: hidden;
}

.item-list:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

/* Premium Badge Styling */
.ribbon-horizontal {
    background-color: var(--primary-green) !important;
    border-radius: 6px !important;
}

.ribbon-horizontal span {
    color: white !important;
    font-weight: 600 !important;
}

/* Price Styling */
.item-price {
    color: var(--primary-green) !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
}

/* Product Title - Blue Color */
.item-list .add-title a,
.item-list h2 a {
    color: #0EA5E9 !important;
    font-weight: 600 !important;
}

.item-list .add-title a:hover,
.item-list h2 a:hover {
    color: #0284c7 !important;
}

/* Category/Location Text - Gray */
.item-list .category,
.item-list .add-desc,
.item-list .info-row {
    color: #6C757D !important;
}

/* View More Link Styling */
.sell-your-item {
    color: #0EA5E9 !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    float: right !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
}

.sell-your-item:hover {
    color: #0284c7 !important;
}

.sell-your-item i {
    font-size: 0.75rem !important;
}

/* Premium and Latest Listings Section Spacing */
.col-xl-12.content-box.layout-section {
    margin-bottom: 40px !important;
}

.navbar-nav .btn-nav-green {
    background-color: var(--primary-green) !important;
    color: white !important;
}

.navbar-nav .btn-nav-green:hover {
    color: white !important;
}

/* Keep the main header visible while scrolling. The base theme adds
   .stuck on downward scroll and slides the navbar out of view. */
.navbar-site.navbar.stuck {
    margin-top: 0 !important;
}

/* Browse Category Modal Styling */
#selectCategoryModal .modal-body {
    max-height: 70vh !important;
    overflow-y: auto !important;
}

#selectCategoryModal .f-category {
    padding: 15px;
}

#selectCategoryModal .f-category a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 120px;
}

#selectCategoryModal .f-category a:hover {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.15);
    transform: translateY(-2px);
}

#selectCategoryModal .f-category i {
    font-size: 2.5rem;
    color: var(--primary-green) !important;
    margin-bottom: 10px;
}

#selectCategoryModal .f-category h6 {
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    margin: 0;
}

#selectCategoryModal .f-category a:hover h6 {
    color: var(--primary-green);
}

/* Hide M-Pesa Debug Info */
#mpesaDebugInfo {
    display: none !important;
}

/* Ensure skip button visibility */
#skipBtn {
    display: inline-block !important;
}


/* Category Card Design - Refined */
.category-card {
    transition: all 0.3s ease;
    background: #fff;
    border-radius: 12px !important;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.15) !important;
}

.category-card .icon-wrapper {
    background-color: rgba(76, 175, 80, 0.1) !important;
    color: var(--primary-green) !important;
    transition: all 0.3s ease;
}

.category-card:hover .icon-wrapper {
    background-color: var(--primary-green) !important;
    color: #fff !important;
}

.category-card .card-title {
    color: #1f2937 !important;
    font-family: 'Inter', sans-serif;
}

.category-card .card-text {
    color: #6b7280 !important;
}


/* Product Card Refinement (Grid View) */
.make-grid .item-list {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    /* Padding is handled by the column width/gutter logic, keep it if needed or reset */
}

.make-grid .item-list:hover {
    transform: none !important;
    box-shadow: none !important;
}

.product-card {
    background: #fff;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12) !important;
}

/* Utility classes if not present */
.hover-shadow:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.transition-all {
    transition: all 0.3s ease !important;
}

.object-fit-cover {
    object-fit: cover;
}


/* Product Details Page Redesign */
.product-view-layout {
    padding-top: 20px;
}

.product-gallery .card {
    border: none !important;
    box-shadow: none !important;
}

/* Hide default sidebar card styling when inside the info panel */
.product-info-panel .sidebar-card {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    margin-bottom: 0 !important;
}

.product-info-panel .sidebar-card .card-header {
    display: none;
    /* Hide standard headers like "Manage Listing" if redundant */
}

.product-info-panel .sidebar-card .card-content {
    padding: 0 !important;
}

.product-info-panel .card-body {
    padding: 0 !important;
}

/* Make action buttons block level and styled */
.product-info-panel .btn-block {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    border-radius: 8px;
    padding: 12px;
    font-weight: 600;
}

/* Enhance Price Styling */
.product-info-panel h2.text-primary {
    color: #0ea5e9 !important;
}

/* Spec sections */
.product-specs .tab-content {
    padding: 15px 0;
}

/* Mobile Responsiveness */
@media (max-width: 767px) {

    .product-view-layout .col-md-7,
    .product-view-layout .col-md-5 {
        width: 100%;
    }

    .product-gallery {
        margin-bottom: 20px;
    }
}

/* Product Gallery Image Sizing */
.main-gallery .swiper-slide img {
    width: 100% !important;
    aspect-ratio: 4/3 !important;
    object-fit: cover !important;
    border-radius: 12px !important;
}

.thumbs-gallery .swiper-slide img {
    aspect-ratio: 1/1 !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    cursor: pointer !important;
}

/* === Jiji-Style Section Headers === */
.jiji-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--jiji-border);
}

.jiji-section-header h2 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    margin: 0;
    color: var(--jiji-text) !important;
}

.jiji-section-header .jiji-view-more {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-green) !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.jiji-section-header .jiji-view-more:hover {
    color: #388e3c !important;
}

/* === Jiji-Style Cards === */
.jiji-card {
    background: var(--jiji-card-bg);
    border-radius: 12px;
    border: 1px solid var(--jiji-border);
    transition: all 0.25s ease;
    overflow: hidden;
}

.jiji-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.jiji-card .jiji-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--jiji-text);
}

.jiji-card .jiji-card-meta {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--jiji-text-muted);
}

.jiji-card .jiji-card-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-green);
}

/* === Jiji-Style Buttons === */
.btn-jiji {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
}

.btn-jiji-primary {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

.btn-jiji-primary:hover {
    background: #388e3c;
    border-color: #388e3c;
    color: white;
}

/* === Jiji-Style Stats === */
.jiji-stats-item {
    text-align: center;
    padding: 1.5rem;
}

.jiji-stats-item .jiji-stats-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-green);
    line-height: 1.2;
}

.jiji-stats-item .jiji-stats-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--jiji-text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Jiji-Style Search === */
.jiji-search-bar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--jiji-border);
    overflow: hidden;
}

.jiji-search-bar input {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 400;
    border: none;
    padding: 1rem 1.25rem;
}

.jiji-search-bar input:focus {
    box-shadow: none;
}

/* === Jiji-Style Category Cards === */
.jiji-category-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--jiji-border);
    padding: 1.25rem 0.75rem;
    text-align: center;
    transition: all 0.25s ease;
    text-decoration: none;
    display: block;
}

.jiji-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: transparent;
    text-decoration: none;
}

.jiji-category-card .jiji-cat-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.1);
    color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.5rem;
    transition: all 0.25s ease;
}

.jiji-category-card:hover .jiji-cat-icon {
    background: var(--primary-green);
    color: white;
}

.jiji-category-card .jiji-cat-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--jiji-text);
    margin-bottom: 0.25rem;
}

.jiji-category-card .jiji-cat-count {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--jiji-text-muted);
}

/* Typography Utilities */
.jiji-text-sm { font-size: 0.8125rem !important; }
.jiji-text-xs { font-size: 0.75rem !important; }
.jiji-font-medium { font-weight: 500 !important; }
.jiji-font-semibold { font-weight: 600 !important; }
.jiji-font-bold { font-weight: 700 !important; }
.jiji-text-muted { color: var(--jiji-text-muted) !important; }
