/* Base styling for public catalog */
.public-catalog {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

/* Ensure full width */
.public-catalog * {
    box-sizing: border-box;
}

/* Remove default body margins */
body.public-catalog {
    margin: 0;
    padding: 0;
}

/* Style mobile footer links in header */
.mobile-footer-links {
    display: none;
}

/* Header Styling */
.catalog-header {
    background: 
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="150" height="150" viewBox="0 0 150 150"><path d="M30 30 Q35 20 40 30 Q45 20 50 30 Q45 40 40 35 Q35 40 30 30Z" fill="rgba(255,255,255,0.2)"/><path d="M40 30 L40 50" stroke="rgba(255,255,255,0.18)" stroke-width="1"/><path d="M35 45 Q40 42 45 45" stroke="rgba(255,255,255,0.15)" fill="none"/><path d="M100 80 Q105 70 110 80 Q115 70 120 80 Q115 90 110 85 Q105 90 100 80Z" fill="rgba(255,255,255,0.18)"/><path d="M110 80 L110 100" stroke="rgba(255,255,255,0.15)" stroke-width="1"/><path d="M75 120 C70 115 70 105 75 100 C80 105 80 115 75 120Z" fill="rgba(255,255,255,0.18)"/><path d="M75 120 C80 115 90 115 95 120 C90 125 80 125 75 120Z" fill="rgba(255,255,255,0.15)"/><path d="M75 120 L75 140" stroke="rgba(255,255,255,0.15)" stroke-width="1"/><circle cx="40" cy="28" r="2" fill="rgba(255,255,255,0.25)"/><circle cx="110" cy="78" r="2" fill="rgba(255,255,255,0.22)"/><circle cx="75" cy="118" r="2" fill="rgba(255,255,255,0.22)"/><path d="M5 10 Q10 5 20 8 Q15 15 5 10Z" fill="rgba(255,255,255,0.15)"/><path d="M130 40 Q135 35 145 38 Q140 45 130 40Z" fill="rgba(255,255,255,0.15)"/><path d="M60 60 Q65 55 70 60 Q65 65 60 60Z" fill="rgba(255,255,255,0.12)"/><path d="M20 100 Q25 95 30 100 Q25 105 20 100Z" fill="rgba(255,255,255,0.12)"/><path d="M120 130 Q125 125 130 130 Q125 135 120 130Z" fill="rgba(255,255,255,0.12)"/></svg>') repeat,
    linear-gradient(135deg, #98A869 0%, #abbc76 100%);
    color: white;
    padding: 1rem 2rem;
    /* Add safe area support */
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-left: max(2rem, env(safe-area-inset-left));
    padding-right: max(2rem, env(safe-area-inset-right));
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0;
    border-bottom: 1px solid rgb(255, 255, 255);
}

.catalog-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><radialGradient id="a" cx="50%" cy="50%"><stop offset="0%" stop-color="rgba(255,255,255,.1)"/><stop offset="100%" stop-color="rgba(255,255,255,0)"/></radialGradient></defs><circle cx="10" cy="10" r="10" fill="url(%23a)"/><circle cx="50" cy="5" r="8" fill="url(%23a)"/><circle cx="90" cy="15" r="12" fill="url(%23a)"/></svg>') repeat;
    opacity: 0.1;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(100px); }
}

/* Three-column header row */
.header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.brand-logo {
    flex: 0 0 auto;
}

.logo-image {
    max-height: 300px;
    max-width: 350px;
    height: auto;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
    display: block;
    filter: drop-shadow(0 0 3px rgba(0,0,0,0.3)) drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.logo-image:hover {
    transform: scale(1.05);
}

/* Centered search container */
.search-container {
    position: relative;
    flex: 1;
    max-width: 800px;
}

.search-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    z-index: 1;
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: none;
    border-radius: 25px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    background: white;
    box-shadow: 0 6px 25px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

/* Right-aligned header links */
.header-links {
    flex: 0 0 auto;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding-bottom: 0.35rem;
    filter: drop-shadow(0 0 3px rgba(0,0,0,0.3)) drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.header-links a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.header-links a:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.header-links i {
    margin-right: 0.4rem;
}

.header-content {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.brand-title {
    font-size: 3rem;
    margin: 0;
    font-weight: 300;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.brand-title i {
    margin-right: 1rem;
    color: #ffd700;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.brand-subtitle {
    font-size: 1.2rem;
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-style: italic;
}

/* Filter Container (if needed for future use) */
.filter-container {
    display: flex;
    gap: 0.5rem;
}

.filter-container select {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-container select:focus {
    outline: none;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.view-toggle {
    display: flex;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 0.25rem;
}

.view-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: white;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active,
.view-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Loading State */
.loading-container {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #7BA05B;
}

/* Main Content - Force flex layout */
.catalog-main {
    display: flex !important;
    flex-direction: row !important;
    gap: 30px;
    max-width: 95%;
    width: 95%;
    margin: 0 auto;
    padding: 30px 20px;
    flex: 1;
}

.catalog-sidebar {
    width: 280px;
    flex-shrink: 0;
    align-self: flex-start;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.catalog-content {
    flex: 1;
    min-width: 0;
}

.sidebar-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.category-filters,
.price-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.filter-option:hover {
    background-color: #f8f9fa;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.filter-option span {
    font-size: 14px;
    color: #495057;
}

.product-stats {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.stats-content {
    color: #666;
    font-size: 1rem;
}

.stats-divider {
    margin: 0 1rem;
    opacity: 0.5;
}

/* Product Grid */
.product-grid {
    display: block; /* Changed from grid to block for category layout */
    margin-bottom: 2rem;
}

.product-grid.list-view {
    display: block;
}

/* Category Headers */
.category-header {
    margin: 2rem 0 1.5rem 0;
}

.category-header:first-child {
    margin-top: 0;
}

.category-header-content {
    position: relative;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.category-title i {
    font-size: 1.5rem;
    color: #98A869;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.75rem;
    border-radius: 12px;
}

.category-title h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.category-count {
    background: #98A869;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.category-line {
    height: 2px;
    background: linear-gradient(90deg, #98A869 0%, rgba(102, 126, 234, 0.1) 100%);
    border-radius: 1px;
}

/* Category Products */
.category-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.product-grid.list-view .category-products {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #98A869 0%, #c5da88 100%);
    color: #666;
    font-size: 2rem;
}

.product-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.product-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-category {
    background: rgba(102, 234, 190, 0.9);
    color: white;
}

.badge-subcategory {
    background: rgba(255, 255, 255, 0.9);
    color: #555;
}

.badge-low-stock {
    background: rgba(255, 107, 107, 0.9);
    color: white;
}

.badge-size {
    background: rgba(100, 100, 100, 0.85);
    color: white;
}

/* Size inline for mobile - hidden on desktop */
.size-inline {
    display: none;
    font-size: 0.85em;
    font-weight: 500;
    color: #666;
}

.product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #333;
    line-height: 1.4;
}

.product-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #98A869;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 10px;
}

.bulk-indicator {
    font-size: 0.75rem;
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
}

.quantity-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    padding-bottom: 5px;
}

.quantity-badge {
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.quantity-badge.low-stock {
    background: #fff3cd;
    color: #856404;
}

/* List View Styling */
.product-grid.list-view .product-card {
    display: flex;
    height: 150px;
}

.product-grid.list-view .product-image-container {
    width: 200px;
    height: 100%;
    flex-shrink: 0;
}

.product-grid.list-view .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.empty-state p {
    margin: 0;
    opacity: 0.7;
}

/* Product Modal */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.product-modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0,0,0,0.7);
    transform: rotate(90deg);
}

.modal-content {
    display: flex;
    height: 100%;
    max-height: 90vh;
    overflow: hidden;
}

.modal-image-section {
    flex: 1;
    position: relative;
    min-height: 400px;
}

.modal-image-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #666;
    font-size: 4rem;
}

.modal-info-section {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.5rem;
    line-height: 1.3;
}

.category-badge {
    background: #98A869;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-pricing {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 15px;
}

.main-price {
    font-size: 2rem;
    font-weight: 700;
    color: #98A869;
    margin-bottom: 0.5rem;
}

.bulk-pricing-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bulk-price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 10px;
    font-size: 0.9rem;
}

.bulk-quantity {
    font-weight: 600;
    color: #666;
}

.bulk-price {
    font-weight: 700;
    color: #28a745;
}

.modal-details {
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #666;
}

.modal-description {
    flex: 1;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #666;
}

.modal-actions {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.contact-info {
    text-align: center;
}

.contact-info p {
    margin: 0 0 0.5rem 0;
    color: #666;
}

.contact-info i {
    margin-right: 0.5rem;
    color: #64923f;
}

.contact-email {
    color: #64923f;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.contact-email:hover {
    text-decoration: underline;
}

/* Footer */
.catalog-footer {
  background: #98A869;
  color: white;
  padding: 1rem 0;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  border-top: 1px solid white;
}


.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    margin: 0;
}

.footer-content i.fa-heart {
    color: #e74c3c;
    animation: heartbeat 2s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-links i {
    margin-right: 0.5rem;
}

/* --- Fix for the white box/ghosting on collapse --- */
.category-section.collapsed {
    padding-bottom: 0 !important;
    margin-bottom: 5px !important;
}

.category-section.collapsed .category-products-container,
.category-section.collapsed .show-more-container {
    display: none !important; /* Forces total removal of hidden content */
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.category-section-header.collapsed {
    background-color: #6c757d !important;
    color: white !important;
    border-radius: 8px;
    margin-bottom: 5px;
}

.category-section-header.collapsed h2,
.category-section-header.collapsed .item-count,
.category-section-header.collapsed .category-toggle {
    color: white !important;
}

/* --- Dual Range Slider UI - Centered & Fixed --- */
.dual-range-container {
    padding: 20px 10px; /* More breathing room */
}

.price-values {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: #8BA86D;
    margin-bottom: 25px;
}

.range-slider {
    position: relative;
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 5px;
}

.range-track {
    position: absolute;
    height: 100%;
    background: #8BA86D;
    border-radius: 5px;
    z-index: 1;
}

.range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    background: none;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
    -webkit-appearance: none;
    margin: 0;
    z-index: 2;
}

/* Chrome, Safari, Edge - Centering the Thumb */
input[type="range"]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #8BA86D;
    pointer-events: auto;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid white;
    /* This ensures the thumb sits perfectly over the track */
    position: relative;
    margin-top: 1px; 
}

/* Firefox - Centering the Thumb */
input[type="range"]::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #8BA86D;
    pointer-events: auto;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Prevent the inputs from interfering with each other's clicks */
#minPriceInput {
    z-index: 3;
}
#maxPriceInput {
    z-index: 2;
}


/* Add a subtle scrollbar styling */
.modal-info-section {
    scrollbar-width: thin;
    scrollbar-color: #98A869 #f1f1f1;
}

.modal-info-section::-webkit-scrollbar {
    width: 6px;
}

.modal-info-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-info-section::-webkit-scrollbar-thumb {
    background: #98A869;
    border-radius: 3px;
}

.modal-info-section::-webkit-scrollbar-thumb:hover {
    background: #7a8a54;
}

/* Add fade gradient at bottom to indicate more content */
.modal-info-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, rgba(255,255,255,0.9));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show fade when content is scrollable */
.modal-info-section.has-scroll::after {
    opacity: 1;
}

/* Add scroll hint text at bottom */
.scroll-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(152, 168, 105, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.modal-info-section.has-scroll .scroll-hint {
    opacity: 1;
}

/* Bounce animation for scroll hint */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-5px);
    }
    60% {
        transform: translateX(-50%) translateY(-3px);
    }
}

.scroll-hint {
    animation: bounce 2s infinite;
}

/* Alternative: Add arrow indicators */
.modal-scroll-indicator {
    position: absolute;
    right: 10px;
    bottom: 20px;
    color: #98A869;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: bounce 1.5s infinite;
}

.modal-info-section.has-scroll .modal-scroll-indicator {
    opacity: 0.7;
}

/* Subcategory and Size Headers */
.subcategory-header {
    padding: 15px 20px;
    padding-left: 35px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #6c757d;
    margin: 15px 0 10px 0;
}

.subcategory-header h3 {
    margin: 0;
    font-size: 18px;
    color: #495057;
    font-weight: 600;
}

.size-header {
    padding: 12px 20px;
    padding-left: 50px;
    background: #f1f3f5;
    border-left: 3px solid #adb5bd;
    margin: 10px 0 8px 0;
}

.size-header h4 {
    margin: 0;
    font-size: 16px;
    color: #6c757d;
    font-weight: 500;
}

/* Collapsible Category Sections */
.category-section {
    margin-bottom: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.category-section.collapsed {
    margin-bottom: 15px;
}

.category-section-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #8BA86D 0%, #6B8E5F 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.category-section-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 168, 109, 0.4);
}

.category-section-header.collapsed {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border-radius: 12px;
}

.category-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.category-header-text h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.category-header-text .item-count {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 2px;
}

.category-toggle {
    font-size: 24px;
    transition: transform 0.3s;
}

.category-section-header.collapsed .category-toggle {
    transform: rotate(-90deg);
}

.category-products-container {
    padding: 20px;
    max-height: none;
    opacity: 1;
    transition: all 0.4s ease;
    overflow: visible;
}

.category-products-container.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
    overflow: hidden;
}

.category-products-container.collapsed .category-products {
    margin-bottom: 0;
}

.category-products-container.limited {
    max-height: 550px;
    overflow: hidden;
    position: relative;
}

.category-products-container.limited::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
}

.show-more-container {
    text-align: center;
    padding: 20px;
    background: white;
    max-height: 100px;
    opacity: 1;
    overflow: hidden;
    transition: all 0.4s ease;
}

.show-more-container.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
}

.show-more-container.sticky {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: white;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    margin: 0;
}

.btn-show-more {
    padding: 12px 30px;
    background: linear-gradient(135deg, #8BA86D 0%, #6B8E5F 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(139, 168, 109, 0.3);
}

.btn-show-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 168, 109, 0.4);
}

.btn-show-more i {
    margin-left: 8px;
    transition: transform 0.3s;
}

.btn-show-more.expanded i {
    transform: rotate(180deg);
}

/* Floating Filter Button for Mobile */
.floating-filter-button {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8BA86D 0%, #6B8E5F 100%);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s;
}

.floating-filter-button:active {
    transform: scale(0.95);
}

.floating-filter-button i {
    font-size: 24px;
}

/* Floating Bag Button for Mobile */
.floating-bag-button {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8BA86D 0%, #6B8E5F 100%);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s;
}

.floating-bag-button:active {
    transform: scale(0.95);
}

.floating-bag-button i {
    font-size: 24px;
}

.floating-bag-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 1200px) {
    .floating-bag-button {
        display: flex;
        align-items: center;
        justify-content: center;
        bottom: 80px; /* Move up to avoid footer */
    }
    
    /* Add bottom padding to prevent overlap with footer */
    .catalog-content {
        padding-bottom: 100px;
    }
}

@media (max-width: 600px) {
    .floating-bag-button,
    .floating-filter-button {
        display: flex;
        align-items: center;
        justify-content: center;
        bottom: 20px; /* Lower on mobile - more room */
    }
    
    /* Extra bottom padding for both buttons */
    .catalog-content {
        padding-bottom: 100px;
    }
}

/* Mobile Filter Modal */
.mobile-filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.mobile-filter-modal.active {
    display: block;
}

.mobile-filter-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.mobile-filter-header {
    padding: 20px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #8BA86D 0%, #6B8E5F 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.mobile-filter-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-filter-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.mobile-filter-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.mobile-filter-footer {
    padding: 15px;
    border-top: 2px solid #e9ecef;
}

.btn-apply-filters {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #8BA86D 0%, #6B8E5F 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-apply-filters:active {
    transform: scale(0.98);
}

/* Mobile Bag Modal */
.mobile-bag-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.mobile-bag-modal.active {
    display: block;
}

.mobile-bag-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.mobile-bag-header {
    padding: 20px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #8BA86D 0%, #6B8E5F 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.mobile-bag-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-bag-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.mobile-bag-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.mobile-bag-footer {
    padding: 15px;
    border-top: 2px solid #e9ecef;
}

/* Shopping Bag Sidebar */
.bag-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
}

.bag-header {
    padding: 20px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #8BA86D 0%, #6B8E5F 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.bag-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bag-count {
    background: white;
    color: #8BA86D;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.bag-items {
    overflow-y: auto;
    padding: 15px;
    max-height: 400px;
}

.bag-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.bag-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.bag-empty p {
    margin: 10px 0 5px 0;
    font-size: 16px;
}

.bag-empty small {
    font-size: 13px;
}

.bag-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.bag-item-info {
    flex: 1;
}

.bag-item-name {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 4px;
}

.bag-item-details {
    font-size: 12px;
    color: #666;
}

.bag-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.bag-item-qty button {
    width: 24px;
    height: 24px;
    border: none;
    background: #8BA86D;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bag-item-qty button:hover {
    background: #6B8E5F;
}

.bag-item-qty span {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.bag-item-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bag-item-remove:hover {
    color: #c82333;
}

.bag-footer {
    padding: 15px;
    border-top: 2px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bag-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 5px;
}

.bag-total-label {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.bag-total-amount {
    font-size: 20px;
    font-weight: 700;
    color: #8BA86D;
}

.btn-clear-bag {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-bag:hover {
    background: #5a6268;
}

.btn-contact-sales {
    padding: 12px 20px;
    background: linear-gradient(135deg, #8BA86D 0%, #6B8E5F 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(139, 168, 109, 0.3);
}

.btn-contact-sales:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 168, 109, 0.4);
}

/* Add to Bag button on product cards */
.btn-add-to-bag {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #8BA86D 0%, #6B8E5F 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: auto;
}

.btn-add-to-bag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(139, 168, 109, 0.3);
}

.btn-add-to-bag i {
    margin-right: 5px;
}

/********************************************************************************** Responsive Design */

/* Mobile responsive for bag */
@media (max-width: 1200px) {
    .bag-sidebar {
        display: none;
    }
}

@media (max-width: 968px) {
    .catalog-main {
        flex-direction: column !important;
        padding: 20px 15px;
    }
    
    .catalog-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .catalog-content {
        width: 100%;
        display: block !important;
    }
    
    .product-grid {
        display: block !important;
    }
    
    .category-products {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 1rem !important;
    }
    
    .sidebar-section {
        padding: 15px;
        margin-bottom: 0;
    }
    
    .category-section-header {
        padding: 15px 20px;
    }
    
    .category-header-icon {
        font-size: 24px;
    }
    
    .category-header-text h2 {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .catalog-main {
        display: flex !important;
        flex-direction: row !important;
        gap: 5px;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        padding: 5px 2px;
    }

    .brand-title {
        font-size: 2rem;
    }
    
    .catalog-header {
        padding: 1rem;
    }
    
    /* Stack header vertically on mobile */
    .header-row {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .brand-logo {
        order: 1;
    }
    
    .logo-image {
        max-height: 80px;
        max-width: 200px;
    }
    
    .search-container {
        order: 2;
        width: 100%;
        max-width: 100%;
    }
    
    .search-container input {
        width: 100%;
        box-sizing: border-box;
        padding: 0.6rem 0.8rem 0.6rem 2.2rem;
        font-size: 0.9rem;
    }
    
    .search-container i {
        left: 0.8rem;
    }
    
    .header-links {
        order: 3;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        width: 100%;
    }
    
    .header-links a {
        font-size: 0.85rem;
    }

    .catalog-footer {
        position: relative;
    }

    .subcategory-header {
        padding: 12px 15px;
        padding-left: 25px;
    }
    
    .subcategory-header h3 {
        font-size: 16px;
    }
    
    .size-header {
        padding: 10px 15px;
        padding-left: 35px;
    }
    
    .size-header h4 {
        font-size: 14px;
    }

    .modal-header h2 {
        margin: 0 0 0.2rem 0;
        font-size: 1 rem;
    }

    .product-overlay {
        top: auto;
        bottom: 0.5rem;
        right: 0;
        left: 0;
        justify-content: center;
    }

    .badge-category {
        display: none;
    }

    .badge-subcategory {
        font-size: 10px;
    }

    .main-price {
        font-size: 1.5rem;
    }

    /* Stack modal content vertically on mobile */
    .modal-content {
        flex-direction: column;
    }

    .modal-header h2 {
        font-size: 1rem;
    }

    .modal-image-section {
        flex: 0 0 auto;
        width: 100%;
        min-height: 300px;
        max-height: 3500px;  /* Increased height */
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-image-section img {
        width: 100%;
        height: auto;  /* CHANGED - maintains aspect ratio */
        object-fit: contain;
        max-width: 100%;
        max-height: 350px;  /* Match container height */
    }
    
    .modal-image-placeholder {
        width: 100%;
        height: 100%;
        min-height: 250px;
        max-height: 300px;
    }
    
    .modal-info-section {
        flex: 1;
        overflow-y: auto;
    }

    /* Style mobile footer links in header */
    .mobile-footer-links {
        display: flex;
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
        padding-top: 5px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .mobile-footer-links a {
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        font-size: 14px;
        transition: color 0.3s ease;
    }
    
    .mobile-footer-links a:hover {
        color: #e67e22;
    }
    
    .mobile-footer-links i {
        margin-right: 5px;
    }
    
    .brand-title {
        font-size: 1.8rem;
    }
    
    .brand-subtitle {
        font-size: 1rem;
    }
    
    .filter-container {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-container select {
        flex: 1;
        min-width: 120px;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .view-toggle {
        display: none;
    }
    
    .view-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.9rem;
    }
    
    .catalog-main {
        padding: 1.5rem 1rem;
        max-width: 100%;
    }
    
    .product-stats {
        padding: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .stats-content {
        font-size: 0.9rem;
    }
    
    .category-header {
        margin: 1.5rem 0 1rem 0;
    }
    
    .category-title {
        padding: 0 0.5rem;
        gap: 0.75rem;
    }
    
    .category-title i {
        font-size: 1.2rem;
        padding: 0.5rem;
    }
    
    .category-title h2 {
        font-size: 1.4rem;
    }
    
    .category-count {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .category-products {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .category-products .product-image-container {
        height: 180px; /* Smaller than desktop 250px */
    }
    
    .category-products .product-info {
        padding: 1rem; /* Less padding than desktop 1.5rem */
    }
    
    .category-products .product-title {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .category-products .product-details {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }
    
    .category-products .product-price {
        font-size: 1.2rem;
    }
    
    .category-products .bulk-indicator {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
    
    .category-products .quantity-info {
        font-size: 0.85rem;
    }
    
    .category-products .quantity-badge {
        font-size: 0.75rem;
        padding: 0.15rem 0.5rem;
    }
    
    /* Mobile List View - Horizontal cards */
    .product-grid.list-view .category-products .product-card {
        display: flex;
        height: 120px;
        flex-direction: row; /* Horizontal layout */
    }
    
    .product-grid.list-view .category-products .product-image-container {
        width: 120px;
        height: 120px;
        flex-shrink: 0;
    }
    
    .product-grid.list-view .category-products .product-info {
        flex: 1;
        padding: 0.75rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .product-grid.list-view .category-products .product-title {
        font-size: 0.95rem;
        margin: 0 0 0.25rem 0;
    }
    
    .product-grid.list-view .category-products .product-details {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .product-grid.list-view .category-products .product-price {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
}

/* Very small screens - stack sidebar sections */
@media (max-width: 600px) {
    /* Hide sidebar on mobile - will show in modal instead */
    .catalog-sidebar {
        display: none;
    }
    
    /* List view for products on mobile */
    .category-products {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .product-card {
        flex-direction: row !important;
        height: 100px !important;
    }
    
    .product-image-container {
        width: 120px !important;
        min-width: 120px;
        height: 100px !important;
        flex-shrink: 0;
    }
    
    .product-info {
        padding: 8px !important;
        flex: 1;
    }
    
    .product-title {
        font-size: 14px !important;
        margin-bottom: 5px !important;
    }
    
    .product-price {
        font-size: 16px !important;
        padding-bottom: 1px;
    }
    
    .quantity-info {
        font-size: 12px !important;
        margin-top: 5px;
    }
    
    .btn-add-to-bag {
        margin-top: auto !important;
        padding: 6px !important;
        font-size: 12px !important;
    }

    .badge-size {
        display: none;
    }
    
    /* Show size inline on mobile */
    .size-inline {
        display: inline;
    }
}