/* Custom CSS for Packaging Catalogue */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #0891b2;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
}

/* Gradient Background */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
}

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-brand img {
    height: 50px;
}

/* Hero Section */
.hero-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-image-placeholder {
    background-image: url(http://zanzisouk.com/assets/images/food-packaging-bg.jpg);
    background-size: cover;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}


/* Filter Buttons */
.filter-btn {
    border-radius: 25px;
    padding: 8px 16px;
    font-weight: 500;
    transition: var(--transition);
    border: 2px solid transparent;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.filter-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Product Cards */
.product-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: none;
    overflow: hidden;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.product-image {
    height: 100px;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 500px;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image-placeholder {
    color: var(--secondary-color);
    font-size: 3rem;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.product-description {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.product-pricing {
    margin-bottom: 1rem;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: var(--light-color);
    border-radius: 8px;
}

.price-label {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.price-value {
    font-weight: 600;
    color: var(--primary-color);
}

.minimum-quantity {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(var(--warning-color), 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--warning-color);
}

.btn-add-to-collection {
    width: 100%;
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem;
    transition: var(--transition);
}

.btn-add-to-collection:hover {
    transform: translateY(-2px);
}

.btn-add-to-collection.added {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

/* Collection Items */
.collection-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.collection-item:hover {
    box-shadow: var(--box-shadow);
}

.collection-item-image {
    width: 80px;
    height: 80px;
    background: var(--light-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.collection-item-info {
    flex: 1;
}

.collection-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.collection-item-description {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.collection-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Modals */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .filter-buttons {
        width: 100%;
    }
    
    .filter-btn {
        margin-bottom: 0.5rem;
    }
    
    .product-card {
        margin-bottom: 2rem;
    }
    
    .collection-item {
        flex-direction: column;
        text-align: center;
    }
    
    .collection-item-image {
        margin: 0 auto 1rem auto;
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-soft {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.border-soft {
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.category-filters {
    margin-bottom: 20px;
}

.category-slider-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.scroll-arrow {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 2;
}

.scroll-arrow:hover:not(.disabled) {
    background: #0056b3;
    transform: scale(1.1);
}

.scroll-arrow.disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

.scroll-arrow.left {
    margin-right: 10px;
}

.scroll-arrow.right {
    margin-left: 10px;
}

.category-filter-buttons {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 5px 0;
    flex: 1;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.category-filter-buttons::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.category-btn {
    background: white;
    border: 2px solid #e9ecef;
    color: #495057;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: fit-content;
}

.category-btn:hover {
    background: #e9ecef;
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-2px);
}

.category-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.category-btn i {
    font-size: 14px;
}

/* Tag Dropdown Styles */
.tag-dropdown-container {
    margin-bottom: 20px;
}

.tag-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 300px;
}

.tag-dropdown-btn {
    width: 100%;
    background: white;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag-dropdown-btn:hover {
    border-color: #007bff;
}

.tag-dropdown.open .tag-dropdown-btn {
    border-color: #007bff;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.tag-dropdown.open .tag-dropdown-btn i {
    transform: rotate(180deg);
}

.tag-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #007bff;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.tag-dropdown.open .tag-dropdown-menu {
    display: block;
}

.tag-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.clear-tags-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.clear-tags-btn:hover {
    background: #f5c6cb;
}

.tag-options {
    padding: 8px 0;
}

.tag-option {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin: 0;
}

.tag-option:hover {
    background: #f8f9fa;
}

.tag-option input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.tag-label {
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Product Tags Display */
.product-tags {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.product-tag {
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Results Count */
.results-count {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 500;
}

/* No Products Message */
.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .category-slider-container {
        padding: 8px;
    }
    
    .scroll-arrow {
        width: 35px;
        height: 35px;
    }
    
    .category-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .tag-dropdown {
        max-width: 100%;
    }
    
    .tag-dropdown-menu {
        max-height: 250px;
    }
}

@media (max-width: 576px) {
    .category-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .scroll-arrow {
        width: 30px;
        height: 30px;
    }
    
    .tag-option {
        padding: 6px 12px;
    }
}

/* Product Card Responsive Styles */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    height: auto;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

/* Product Image Container - Square aspect ratio */
.product-image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* 4:3 aspect ratio for more square look */
    overflow: hidden;
    background-color: #f8f9fa;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* Product Title */
.product-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.4rem;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.4em; /* Fixed height for consistency */
}

/* Product Description */
.product-description {
    font-size: 0.75rem;
    line-height: 1.3;
    margin-bottom: 0.4rem;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2em; /* Fixed height for consistency */
}

/* Product Tags */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-bottom: 0.4rem;
    min-height: 1.5rem; /* Reserve space even if no tags */
}

.product-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
    border-radius: 10px;
    color: white !important;
    font-weight: 500;
    white-space: nowrap;
}

/* Quote Badge - Compact */
.quote-badge {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    text-align: center;
    margin-bottom: 0.3rem;
}

.quote-badge i {
    margin-right: 0.2rem;
}

.pricing-section {
    display: none !important;
}


/* Product Category */
.product-category {
    font-size: 0.7rem;
    margin-bottom: 0.4rem;
    min-height: 1rem; /* Reserve space even if no category */
}

/* Add to Collection Button */
.add-to-collection-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-weight: 500;
    width: 100%;
}

/* Card Body - Optimized spacing */
.card-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    height: auto;
}

/* Mobile Specific Styles - 2 Columns */
@media (max-width: 767.98px) {
    /* Mobile: 2 products per row (col-6 = 50% width each) */
    .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* Square-ish cards for mobile */
    .product-image-container {
        padding-bottom: 70%; /* Slightly less square for mobile */
    }
    
    .product-title {
        font-size: 0.8rem;
        height: 2.2em;
        -webkit-line-clamp: 2;
    }
    
    .product-description {
        font-size: 0.7rem;
        height: 1.8em;
        -webkit-line-clamp: 2;
    }
    
    .product-tag {
        font-size: 0.6rem;
        padding: 0.1rem 0.25rem;
    }
    
    .quote-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.3rem;
    }
    
    .product-category {
        font-size: 0.65rem;
    }
    
    .add-to-collection-btn {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
    }
    
    .card-body {
        padding: 0.6rem;
    }
    
    /* Ensure cards don't get too tall */
    .product-card {
        max-height: 400px;
    }
}

/* Tablet Styles - 4 columns */
@media (min-width: 768px) and (max-width: 991.98px) {
    .product-image-container {
        padding-bottom: 75%;
    }
    
    .product-title {
        font-size: 0.85rem;
    }
    
    .product-description {
        font-size: 0.75rem;
    }
}

/* Desktop Styles - 6 columns */
@media (min-width: 992px) {
    .product-image-container {
        padding-bottom: 80%;
    }
    
    .product-title {
        font-size: 0.9rem;
    }
    
    .product-description {
        font-size: 0.8rem;
    }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
    .product-image-container {
        padding-bottom: 85%;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-description {
        font-size: 0.85rem;
    }
}

/* Ensure consistent card heights within rows */
.row {
    display: flex;
    flex-wrap: wrap;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Loading and hover states */
.product-image {
    background-color: #f8f9fa;
}

.product-image[src="assets/images/placeholder.jpg"] {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23f8f9fa"/><text x="50" y="50" text-anchor="middle" dy=".3em" fill="%236c757d" font-family="Arial" font-size="12">No Image</text></svg>');
    background-size: cover;
    background-position: center;
}

/* Compact layout optimizations */
.pricing-section {
    margin-bottom: 0.3rem;
}

/* Ensure all content fits without scrolling */
@media (max-width: 767.98px) {
    .card-body > * {
        flex-shrink: 0;
    }
    
    .card-body {
        justify-content: space-between;
    }
}

