/**
 * Modern Fintech Design Style
 * Based on Finology app design
 */

/* ========================================
   ROOT VARIABLES
   ======================================== */
:root {
    /* Primary Colors */
    --primary-blue: #4461F2;
    --primary-dark: #2D3561;
    --bg-light: #F5F5FA;
    --bg-white: #FFFFFF;
    
    /* Accent Colors */
    --accent-green: #00D09E;
    --accent-red: #FF6B6B;
    --accent-orange: #FF9500;
    --accent-purple: #A855F7;
    --accent-cyan: #22D3EE;
    
    /* Text Colors */
    --text-dark: #1F2937;
    --text-gray: #6B7280;
    --text-light: #9CA3AF;
    
    /* Border & Shadow */
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.rounded-custom {
    border-radius: var(--border-radius);
}

/* Hide scrollbar for image sliders */
.image-slider-container::-webkit-scrollbar {
    display: none;
}

.shadow-custom {
    box-shadow: var(--card-shadow);
}

/* Admin container with padding */
.container-custom {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 576px) {
    .container-custom {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ========================================
   GLOBAL STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 15px;
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar-custom {
    background: var(--bg-white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Sticky navbar on mobile */
@media (max-width: 991.98px) {
    .navbar-custom {
        position: sticky;
        top: 0;
        z-index: 1030;
    }

    /* Add padding to body to prevent content jumping under sticky navbar */
    body {
        padding-top: 0;
    }
}

.navbar-brand {
    font-weight: 700;
    font-size: 24px;
    color: var(--primary-blue) !important;
}

.nav-link {
    color: var(--text-gray) !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-link:hover {
    color: var(--primary-blue) !important;
    background: rgba(68, 97, 242, 0.08);
}

.btn-add-product {
    background: #00d09e !important;
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 12px !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 208, 158, 0.3);
    transition: background 0.2s ease;
}

.btn-add-product:hover {
    background: #00b88a !important;
    color: white !important;
}

.search-input {
    border-radius: 12px !important;
    border: 1px solid #E5E7EB;
    padding: 10px 16px;
    background: var(--bg-light);
}

.search-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(68, 97, 242, 0.1);
}

.btn-search {
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px 24px;
    margin-left: 8px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-search:hover {
    background: #3651d9;
    color: white;
}

.location-filter {
    border-radius: 10px !important;
    border: 1px solid #E5E7EB;
    padding: 8px 12px;
    font-weight: 500;
    background: var(--bg-white);
}

/* ========================================
   CARDS
   ======================================== */
.card {
    border: none;
    border-radius: var(--border-radius);
    background: var(--bg-white);
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.product-card {
    border-radius: var(--border-radius);
    background: white;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid transparent;
    transition: all 0.3s;
}

.product-card:hover {
    border-left-color: var(--primary-blue);
    box-shadow: var(--card-shadow-hover);
}

.product-card.border-green {
    border-left-color: var(--accent-green);
}

.product-card.border-red {
    border-left-color: var(--accent-red);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary {
    background: var(--primary-blue) !important;
    border: none !important;
    border-radius: 12px;
    padding: 12px 28px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(68, 97, 242, 0.3);
}

.btn-primary:hover {
    background: #3651d9 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(68, 97, 242, 0.4);
}

.btn-success {
    background: var(--accent-green) !important;
    border: none !important;
    border-radius: 12px;
}

.btn-danger {
    background: var(--accent-red) !important;
    border: none !important;
    border-radius: 12px;
}

/* ========================================
   FORMS
   ======================================== */
.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    padding: 12px 16px;
    background: var(--bg-light);
    transition: all 0.3s;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--bg-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 12px;
    padding-right: 40px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-green);
    background-color: rgba(68, 97, 242, 0.06);
    box-shadow: 0 0 0 3px rgba(0, 208, 158, 0.25);
}

.form-select:focus {
    background: rgba(68, 97, 242, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%234461f2' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 12px;
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

/* ========================================
   PRICE DISPLAY
   ======================================== */
.price-card {
    background: var(--primary-blue);
    color: white;
    padding: 24px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 8px 24px rgba(68, 97, 242, 0.3);
}

.price-large {
    font-size: 48px;
    font-weight: 700;
    margin: 12px 0;
}

.price-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.price-badge.up {
    background: rgba(0, 208, 158, 0.2);
    color: var(--accent-green);
}

.price-badge.down {
    background: rgba(255, 107, 107, 0.2);
    color: var(--accent-red);
}

/* ========================================
   LIST ITEMS
   ======================================== */
.list-item {
    background: white;
    padding: 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.list-item:hover {
    box-shadow: var(--card-shadow);
    border-left-color: var(--primary-blue);
}

.list-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-right: 14px;
}

.list-item-icon.green {
    background: rgba(0, 208, 158, 0.1);
    color: var(--accent-green);
}

.list-item-icon.red {
    background: rgba(255, 107, 107, 0.1);
    color: var(--accent-red);
}

.list-item-icon.blue {
    background: rgba(68, 97, 242, 0.1);
    color: var(--primary-blue);
}

.list-item-icon.orange {
    background: rgba(255, 149, 0, 0.1);
    color: var(--accent-orange);
}

/* ========================================
   PROGRESS BARS
   ======================================== */
.progress {
    height: 8px;
    border-radius: 10px;
    background: #E5E7EB;
}

.progress-bar {
    border-radius: 10px;
}

.progress-bar.bg-green {
    background: var(--accent-green);
}

.progress-bar.bg-orange {
    background: var(--accent-orange);
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
}

.badge-success {
    background: rgba(0, 208, 158, 0.1);
    color: var(--accent-green);
}

.badge-danger {
    background: rgba(255, 107, 107, 0.1);
    color: var(--accent-red);
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 16px 20px;
    font-weight: 500;
}

.alert-success {
    background: rgba(0, 208, 158, 0.1);
    color: var(--accent-green);
}

.alert-danger {
    background: rgba(255, 107, 107, 0.1);
    color: var(--accent-red);
}

/* ========================================
   LOGIN / AUTH PAGES
   ======================================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    max-width: 440px;
    width: 100%;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.social-buttons {
    display: flex;
    gap: 12px;
    margin: 24px 0;
}

.social-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.social-btn:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .auth-card {
        padding: 28px;
    }
    
    /* Mobile navbar spacing */
    .navbar-collapse {
        margin-top: 1rem;
    }
    
    .navbar-collapse .nav-item {
        margin-bottom: 0.5rem;
    }
    
    .navbar-collapse .search-form {
        margin: 1rem 0;
    }
    
    .navbar-collapse .btn-add-product {
        margin-bottom: 0.5rem;
        background: var(--accent-green) !important;
        box-shadow: 0 4px 12px rgba(0, 208, 158, 0.3) !important;
    }
    
    /* Mobile autosuggest - higher z-index */
    .autocomplete-suggestions {
        z-index: 2000 !important;
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 250px !important;
        margin-top: 4px !important;
    }
    
    /* Mobile notification bell */
    #notification-bell {
        display: inline-block !important;
    }
    
    /* Mobile dropdown menu */
    .navbar-nav .dropdown-menu {
        position: absolute !important;
    }
}

/* ========================================
   AUTOCOMPLETE SUGGESTIONS
   ======================================== */
.autocomplete-suggestions {
    position: absolute;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
    margin-top: 4px;
    display: none;
}

.autocomplete-suggestions.show {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #F5F5FA;
    color: #333;
    background: white;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #F8F9FA;
    color: #000;
}

.autocomplete-item.active {
    background: var(--primary-blue);
    color: white;
}

/* ========================================
   CUSTOM TABS STYLING
   ======================================== */
.nav-tabs {
    border-bottom: 2px solid #E5E7EB;
    gap: 0;
    margin-bottom: 0;
}

.nav-tabs .nav-item {
    flex: 1;
}

.nav-tabs .nav-link {
    border: 2px solid transparent;
    border-bottom: 2px solid #E5E7EB;
    border-radius: 12px 12px 0 0;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    background: transparent;
    text-align: center;
    margin-bottom: -2px;
    position: relative;
}

@media (min-width: 768px) {
    .nav-tabs .nav-link {
        padding: 16px 32px;
        font-size: 17px;
    }
}

.nav-tabs .nav-link:hover {
    color: var(--primary-blue);
    background: rgba(68, 97, 242, 0.05);
    border-color: #E5E7EB;
    border-bottom-color: #E5E7EB;
}

.nav-tabs .nav-link.active {
    color: var(--primary-blue);
    background: white;
    border-color: #E5E7EB;
    border-bottom-color: white;
    font-weight: 700;
}

/* ========================================
   HOMEPAGE HERO SECTION
   ======================================== */
.hero-section-accent {
    background: white;
    border-radius: var(--border-radius);
    padding: 48px 32px;
    box-shadow: var(--card-shadow);
    margin-bottom: 48px;
}

.hero-content {
    text-align: center;
    margin-bottom: 32px;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
}

.search-scan-box {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-light);
    padding: 32px;
    border-radius: var(--border-radius-sm);
    border: 2px solid rgba(68, 97, 242, 0.1);
}

.search-scan-box .input-group-text {
    border-radius: 12px 0 0 12px;
    border: 1px solid #E5E7EB;
    padding: 12px 16px;
}

.search-scan-box .form-control {
    border-radius: 0;
    border-top: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
    border-left: none;
    border-right: none;
    padding: 12px 16px;
    background: white;
}

.search-scan-box .btn-primary {
    border-radius: 0 12px 12px 0;
    padding: 12px 32px;
}

.btn-scan {
    background: var(--accent-green) !important;
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 208, 158, 0.3);
    transition: all 0.3s;
}

.btn-scan:hover {
    background: #00b889 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 208, 158, 0.4);
}

/* ========================================
   CATEGORIES GRID
   ======================================== */
.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

/* Wide desktop: 9 categories per row */
@media (min-width: 1400px) {
    .categories-grid {
        grid-template-columns: repeat(9, 1fr) !important;
    }
}

/* Medium desktop: 6 categories per row */
@media (min-width: 992px) and (max-width: 1399px) {
    .categories-grid {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

.category-box {
    background: white;
    border-radius: var(--border-radius-sm);
    padding: 14px 16px;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
    text-decoration: none;
    box-shadow: var(--card-shadow);
}

.category-box:hover {
    border-color: var(--primary-blue);
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

/* Desktop: smaller vertical padding for category boxes */
@media (min-width: 992px) {
    .category-box {
        padding-top: 8px;
        padding-bottom: 8px;
    }
}

.category-icon-large {
    font-size: 48px;
    margin-bottom: 12px;
}

.category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

/* ========================================
   PRODUCT CARDS (HOME)
   ======================================== */
.product-card-home {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-home:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
}

.product-image-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--bg-light);
    position: relative;
}

.product-image-fixed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-body {
    padding: 20px;
    padding-bottom:0px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-category {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 12px;
}

.health-grade {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    text-align: center;
    line-height: 32px;
    font-weight: 700;
    font-size: 16px;
}

.health-grade-A { background: #00D09E; color: white; }
.health-grade-B { background: #4ADE80; color: white; }
.health-grade-C { background: #FCD34D; color: #1F2937; }
.health-grade-D { background: #FB923C; color: white; }
.health-grade-E { background: #FF6B6B; color: white; }

.rating-badge {
    color: #FCD34D;
    font-weight: 600;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 16px;
    margin-top: auto;
}

.btn-view-product {
    background: var(--bg-light);
    border: none;
    color: var(--text-dark);
    font-weight: 600;
    padding: 12px;
    border-radius: 10px;
    transition: all 0.3s;
}

.btn-view-product:hover {
    background: var(--primary-blue);
    color: white;
}

/* ========================================
   FOOTER DARK
   ======================================== */
.footer-dark {
    background: #1F2937;
    color: #9CA3AF;
    padding: 60px 0 0;
    margin-top: 80px;
}

.footer-heading {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-description {
    color: #9CA3AF;
    line-height: 1.7;
    margin-bottom: 20px;
}

.footer-stats {
    display: flex;
    gap: 32px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-blue);
}

.stat-label {
    font-size: 13px;
    color: #6B7280;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-list li {
    margin-bottom: 12px;
}

.footer-link-item {
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 15px;
}

.footer-link-item:hover {
    color: white;
}

.footer-contact {
    margin-bottom: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.contact-icon {
    font-size: 18px;
}

.contact-link {
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.3s;
}

.contact-link:hover {
    color: var(--primary-blue);
}

.contact-text {
    color: #9CA3AF;
    font-size: 15px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    text-decoration: none;
    transition: all 0.3s;
}

.social-link:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 0;
    margin-top: 48px;
}

.footer-copyright,
.footer-powered {
    color: #6B7280;
    font-size: 14px;
    margin: 0;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    
    .search-scan-box {
        padding: 24px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px;
    }
    
    .category-icon-large {
        font-size: 36px;
    }
    
    .footer-stats {
        justify-content: center;
        gap: 15px;
        flex-wrap: nowrap;
    }
    
    .stat-item {
        flex: 1;
        min-width: 0;
        text-align: center;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ========================================
   MOBILE OPTIMIZATIONS
   ======================================== */
/* Product card images - reduce height on index page */
.featured-products .card-img-top {
    height: 160px !important;
}

/* Product card images - consistent height for search/category */
.card-img-top {
    height: 180px;
    object-fit: cover;
}

/* Price styling on mobile */
@media (max-width: 576px) {
    .price-large {
        font-size: 1.1rem !important;
    }
    
    .product-price {
        font-size: 1rem !important;
    }
    
    .product-name,
.card-title {
        font-size: 0.9rem;
    }
}

/* Rating stars on image overlay */
.product-card-rating {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10;
}

/* Sofia Sans for Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: 'Sofia Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Product titles use Inter (not Sofia Sans) */
.product-title,
.product-name,
.card-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Breadcrumb smaller font */
.breadcrumb {
    font-size: 0.85rem;
}

/* ========================================
   HORIZONTAL SCROLL CAROUSEL
   ======================================== */
.horizontal-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 10px;
}

.horizontal-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.horizontal-scroll-wrapper {
    display: flex;
    gap: 20px;
    padding: 5px 0;
}

.horizontal-scroll-item {
    flex: 0 0 auto;
    width: 280px;
}

/* Specific styling for horizontal cards */
.horizontal-scroll-item .product-card-home {
    height: 100%;
}

.horizontal-scroll-item .product-image-wrapper {
    height: 180px;
}

.horizontal-scroll-item .product-image-fixed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.horizontal-scroll-item .product-body {
    padding: 20px;
}

.horizontal-scroll-item .product-title {
    font-size: 16px;
    min-height: auto;
}

.horizontal-scroll-item .product-category {
    font-size: 13px;
    margin-bottom: 12px;
}

.horizontal-scroll-item .product-price {
    font-size: inherit;
}

/* Carousel navigation arrows */
.carousel-nav {
    position: relative;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent-brown);
    transition: all 0.3s;
}

.carousel-arrow:hover {
    background: var(--accent-brown);
    color: white;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.carousel-arrow.prev {
    left: -24px;
}

.carousel-arrow.next {
    right: -24px;
}

.carousel-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-arrow:disabled:hover {
    background: white;
    color: var(--accent-brown);
}

/* Mobile - smaller cards */
@media (max-width: 768px) {
    .horizontal-scroll-item {
        width: calc(50% - 10px);
    }
    
    .horizontal-scroll-item .product-image-wrapper {
        height: 180px;
    }
    
    .horizontal-scroll-wrapper {
        gap: 15px;
    }
    
    .carousel-arrow {
        display: none;
    }
    
    /* Mobile scroll hint arrow - same style as desktop */
    .carousel-nav::after {
        content: '›';
        position: absolute;
        right: -5px; /* Slightly outside right edge */
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        background: white;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: var(--accent-brown);
        z-index: 5;
        pointer-events: all;
        cursor: pointer;
        transition: opacity 0.3s;
        animation: slideHint 1.5s ease-in-out infinite;
    }
    
    .carousel-nav.scrolled::after {
        opacity: 0;
        pointer-events: none;
    }
    
    @keyframes slideHint {
        0%, 100% {
            transform: translateY(-50%) translateX(0);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        50% {
            transform: translateY(-50%) translateX(5px);
            box-shadow: 0 6px 16px rgba(0,0,0,0.25);
        }
    }
}

/* Very small mobile */
@media (max-width: 480px) {
    .horizontal-scroll-item {
        width: calc(50% - 8px);
    }
    
    .horizontal-scroll-item .product-image-wrapper {
        height: 180px;
    }
    
    .horizontal-scroll-wrapper {
        gap: 12px;
    }
}

/* View All Card */
.view-all-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
    background: #3651d9;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    flex-direction: column;
    gap: 15px;
}

.view-all-card:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
    background: #2a40b8;
}

.view-all-icon {
    font-size: 48px;
}

.view-all-text {
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-align: center;
    line-height: 1.4;
}

/* Smooth scroll behavior */
.horizontal-scroll-container {
    scroll-behavior: smooth;
}

/* ========================================
   BARCODE SCANNER OPTIMIZATION
   ======================================== */
#scanner-container,
#scanner-reader {
    overflow: hidden;
    position: relative;
    z-index: 10;
    min-height: 250px;
}

#inline-scanner-reader {
    overflow: hidden;
    position: relative;
    z-index: 10;
    min-height: 180px;
}

#scanner-container video,
#scanner-reader video {
    height: auto !important;
    min-height: 280px;
    max-height: 400px !important;
    object-fit: cover;
    border-radius: 12px;
    width: 100% !important;
}

#inline-scanner-reader video {
    height: auto !important;
    min-height: 180px;
    max-height: 250px !important;
    object-fit: cover;
    border-radius: 12px;
    width: 100% !important;
}

#scanner-container canvas,
#scanner-reader canvas {
    max-height: 400px !important;
    border-radius: 12px;
}

#inline-scanner-reader canvas {
    max-height: 250px !important;
    border-radius: 12px;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    #scanner-container video,
    #scanner-reader video,
    #inline-scanner-reader video {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Inline scanner on homepage - compact styling */
#search-ui-scanner #inline-scanner-reader {
    border-radius: 12px;
    overflow: hidden;
}

/* Scanner modal styles */
.barcode-scanner-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.barcode-scanner-modal .scanner-header {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.barcode-scanner-modal .scanner-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--accent-brown);
}

.barcode-scanner-modal .scanner-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    color: #666;
}

.barcode-scanner-modal .scanner-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: var(--bg-light);
}

.barcode-scanner-modal .scanner-video-container {
    width: 100%;
    max-width: 500px;
    min-height: 300px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.barcode-scanner-modal .scanner-video-container #scanner-reader {
    min-height: 300px;
}

.barcode-scanner-modal .scanner-video-container video {
    min-height: 300px !important;
}

.barcode-scanner-modal .scanner-controls {
    margin-top: 15px;
    text-align: center;
}

.barcode-scanner-modal .scanner-hint {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.barcode-scanner-modal .scanner-status {
    padding: 15px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-blue);
}

/* Hide placeholder when scanner container has content */
#scanner-container:not(:empty) + #scanner-placeholder {
    display: none !important;
}

#scanner-placeholder {
    position: relative;
    z-index: 1;
}

/* Camera controls styling */
#camera-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#camera-select {
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

#camera-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(68, 97, 242, 0.25);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%234461F2' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
}

#stop-scan {
    display: inline-block;
    padding: 4px 8px;
    transition: all 0.2s ease;
    color: #dc3545 !important;
    text-decoration: underline !important;
    font-size: 0.85rem;
}

#stop-scan:hover {
    color: #bb2d3b !important;
    text-decoration: underline !important;
}

/* Hide spinner arrows from number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* ========================================
   FILLED FIELD INDICATOR
   ======================================== */
.form-control.field-filled,
.form-select.field-filled {
    border-color: rgba(40, 167, 69, 0.4) !important;
    background-color: rgba(40, 167, 69, 0.04) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2328a745'%3e%3cpath d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem 1rem;
    padding-right: 2.5rem;
}

.form-control.field-filled:focus,
.form-select.field-filled:focus {
    border-color: rgba(40, 167, 69, 0.6) !important;
    background-color: rgba(40, 167, 69, 0.06) !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
}

/* ========================================
   ADD PRODUCT PROGRESS BAR
   ======================================== */
.add-product-progress {
    background: var(--bg-white);
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 56px;
    z-index: 990;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.progress-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    background: var(--bg-light);
    transition: all 0.3s ease;
    cursor: pointer;
}

.progress-step .step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ddd;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: linear-gradient(135deg, var(--primary-blue), #6366F1);
    color: white;
}

.progress-step.active .step-number {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.progress-step.completed {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.progress-step.completed .step-number {
    background: #28a745;
    color: white;
}

.progress-step.completed .step-number::after {
    content: '✓';
}

.progress-step.completed .step-number span {
    display: none;
}

.progress-connector {
    width: 30px;
    height: 3px;
    background: #ddd;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.progress-connector.active {
    background: linear-gradient(90deg, #28a745, var(--primary-blue));
}

/* Step navigation button */
.step-nav-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    color: white;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
}

.step-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    background: linear-gradient(135deg, #218838, #1ea97c);
}

.step-nav-btn:active {
    transform: translateY(0);
}

.step-nav-btn .arrow {
    font-size: 1.3rem;
    animation: bounceRight 1s ease-in-out infinite;
}

@keyframes bounceRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

@keyframes pulseContinuous {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(68, 97, 242, 0.3); }
    50% { transform: scale(1.03); box-shadow: 0 6px 20px rgba(68, 97, 242, 0.45); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(68, 97, 242, 0.3); }
}

.pulse-once {
    animation: pulseContinuous 1.5s ease-in-out infinite;
}

/* Back button */
.step-back-btn {
    background: transparent;
    border: 2px solid var(--text-light);
    color: var(--text-gray);
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.step-back-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

@media (max-width: 576px) {
    .progress-step {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .progress-step .step-label {
        display: none;
    }

    .progress-connector {
        width: 20px;
    }

    .step-nav-btn {
        padding: 14px 24px;
        font-size: 1rem;
    }
}

/* ========================================
   CATEGORY PICKER MODAL
   ======================================== */
.category-picker-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: white;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.category-picker-btn:hover {
    border-color: var(--primary-blue);
    background: rgba(68, 97, 242, 0.02);
}

.category-picker-btn::after {
    content: '▼';
    font-size: 0.7rem;
    color: #6c757d;
    margin-left: 10px;
}

.category-picker-btn.has-value {
    border-color: rgba(40, 167, 69, 0.4);
    background-color: rgba(40, 167, 69, 0.04);
}

.category-picker-btn.has-value #selected-category-text {
    font-weight: 500;
    color: var(--text-dark);
}

.category-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.category-modal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 100px;
}

.category-modal-item:hover {
    background: white;
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(68, 97, 242, 0.15);
}

.category-modal-item:active {
    transform: translateY(0);
}

.category-modal-item.selected {
    background: rgba(68, 97, 242, 0.1);
    border-color: var(--primary-blue);
}

.category-modal-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.category-modal-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-modal-icon .svg-icon {
    width: 100%;
    height: 100%;
    color: var(--accent-brown);
}

.category-modal-icon .svg-icon svg {
    width: 100%;
    height: 100%;
}

.category-modal-icon .emoji-icon {
    font-size: 32px;
}

.category-modal-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    text-align: center;
    line-height: 1.2;
}

#categoryModal .modal-body {
    padding: 16px;
}

#categoryModal .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

#categoryModal .modal-title {
    font-weight: 600;
    color: var(--accent-brown);
}

@media (max-width: 400px) {
    .category-modal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .category-modal-item {
        padding: 12px 6px;
        min-height: 90px;
    }

    .category-modal-icon {
        width: 40px;
        height: 40px;
    }

    .category-modal-icon .emoji-icon {
        font-size: 28px;
    }

    .category-modal-name {
        font-size: 0.8rem;
    }
}

/* ========================================
   MOBILE STORE/LOCATION MODALS
   ======================================== */

/* Store grid in modal */
.store-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.store-modal-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 500;
}

.store-modal-item:hover,
.store-modal-item:active {
    background: white;
    border-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(68, 97, 242, 0.15);
}

.store-modal-item.selected {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* Location list in modal */
.location-modal-list {
    max-height: 250px;
    overflow-y: auto;
}

.location-modal-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.location-modal-item:hover,
.location-modal-item:active {
    background: white;
    border-color: var(--primary-blue);
}

.location-modal-item.selected {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.location-modal-item .location-address {
    flex: 1;
    font-size: 0.95rem;
}

.location-modal-item .location-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Mobile modal fullscreen on small screens */
@media (max-width: 576px) {
    .store-modal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-height: 40vh;
    }

    .location-modal-list {
        max-height: 35vh;
    }
}
