/* public-catalog.css - Modern storefront styling */

/* 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: linear-gradient(135deg, #98A869 0%, #abbc76 100%);
    color: white;
    padding: 1rem 0;
    /* Add safe area support */
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-left: env(safe-area-inset-left);
    padding-right: 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); }
}

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

.brand-logo {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

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

.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 Bar */
.filter-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.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);
}

.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: #667eea;
}

/* Main Content */
.catalog-main {
    max-width: 90%;
    margin: 0 auto;
    padding: 2rem;
}

.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(280px, 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;
}

.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-low-stock {
    background: rgba(255, 107, 107, 0.9);
    color: white;
}

.product-info {
    padding: 1.5rem;
}

.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;
}

.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;
}

.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: 800px;
    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.8rem;
    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;
    /* Remove margin-top and add fixed positioning */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    border-top: 1px solid rgb(255, 255, 255);
}

.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;
}

/* Responsive Design */
@media (max-width: 768px) {
    .brand-title {
        font-size: 2rem;
    }
    
/********************************************************************************** Responsive Design */
@media (max-width: 768px) {
    .catalog-header {
        padding: 1rem 0;
    }

    .catalog-footer {
        position: relative;
    }

    .badge-low-stock {
        display: none;
    }

    .modal-image-section {
        flex: 0 0 250px; /* Fixed width for mobile */
        max-width: 250px;
        min-height: 200px;
        max-height: 300px;
        overflow: hidden;
    }
    
    .modal-image-section img {
        width: 100%;
        height: 100%;
        object-fit: contain; /* Show full image without cropping */
        max-width: 100%;
        max-height: 100%;
    }
    
    .modal-image-placeholder {
        width: 100%;
        height: 100%;
        min-height: 200px;
        max-height: 300px;
    }

    /* 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;
    }
    
    .brand-logo .logo-image {
        max-height: 100px;
        max-width: 300px;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem;
    }
    
    .search-container {
        min-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;
    }
    
    .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;
    }
}
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .modal-content {
        flex-direction: column;
    }
    
    .modal-image-section {
        min-height: 250px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .product-grid.list-view .product-card {
        flex-direction: column;
        height: auto;
    }
    
    .product-grid.list-view .product-image-container {
        width: 100%;
        height: 200px;
    }

    /* Modal Scroll Indicators */

/* 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;
}
}

@media (max-width: 480px) {
    .catalog-main {
        padding: 1rem;
    }
    
    .category-products {
        grid-template-columns: 1fr;
    }
    
    .modal-info-section {
        padding: 1rem;
    }
    
    .category-title {
        padding: 0 0.5rem;
        gap: 0.5rem;
    }
    
    .category-title i {
        font-size: 1.2rem;
        padding: 0.5rem;
    }
    
    .category-title h2 {
        font-size: 1.3rem;
    }
}