/**
 * Products Page Styles
 * HabibPrint.com
 */

/* Products Header */
.products-header {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

.products-stats .stat-item {
    text-align: center;
}

.products-stats .stat-number {
    font-weight: 700;
    display: block;
    line-height: 1;
}

.products-stats .stat-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filters Section */
.filters-section {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-form .input-group {
    max-width: 400px;
}

.sort-options select {
    min-width: 160px;
}

/* Search Suggestions */
.search-form {
    position: relative;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
}

.search-suggestions-dropdown {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

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

.suggestion-item i {
    width: 16px;
    text-align: center;
    color: #6c757d;
}

.suggestion-item small {
    margin-left: auto;
    text-transform: capitalize;
}

/* Filter Groups */
.filter-group {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.filter-group::-webkit-scrollbar {
    width: 6px;
}

.filter-group::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-group::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.filter-group::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.view-toggle .btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Category Cards */
.category-card {
    display: block;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    text-decoration: none;
}

.category-card-inner {
    overflow: hidden;
    transition: all 0.3s ease;
}

.category-card:hover .category-card-inner {
    box-shadow: 0 1rem 2rem rgba(0,0,0,0.15) !important;
}

.category-card .card-img-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.category-card .card-img-top {
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover .card-img-top {
    transform: scale(1.05);
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover .category-overlay {
    opacity: 1;
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 2rem rgba(0,0,0,0.15) !important;
}

.product-card .card-img-wrapper {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.product-card .card-img-top {
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.1);
}

/* Product Badges */
.popular-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--accent);
    color: var(--dark);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.price-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary);
    color: var(--light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

/* Card Overlay */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.product-card:hover .card-overlay {
    opacity: 1;
}

.overlay-buttons {
    text-align: center;
}

.overlay-buttons .btn {
    margin: 0.25rem;
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
}

/* Product Features */
.product-features .badge {
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    border: 1px solid var(--gray-300);
}

/* Price Info */
.price-from {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price {
    font-weight: 700;
}

/* Product Actions */
.product-actions .btn {
    width: 35px;
    height: 35px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
    border-radius: 50%;
}

/* Comparison Feature */
.compare-btn {
    position: relative;
}

.compare-btn.active {
    background-color: #198754;
    border-color: #198754;
    color: white;
}

.compare-products-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.compare-products-btn .btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* List View */
.list-view .product-item {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
}

.list-view .product-card {
    flex-direction: row;
}

.list-view .card-img-wrapper {
    width: 300px;
    height: 200px;
    flex-shrink: 0;
}

.list-view .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.list-view .product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* No Products */
.no-products {
    color: var(--gray-600);
}

.no-products .fa-search {
    color: var(--gray-400);
}

/* Load More Button */
#loadMoreBtn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-header .stat-item {
        display: block !important;
        margin-bottom: 1rem;
    }
    
    .filters-section .row > div {
        margin-bottom: 1rem;
    }
    
    .filters-section .d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .sort-options {
        margin-bottom: 1rem !important;
        margin-right: 0 !important;
    }
    
    .view-toggle {
        align-self: center;
    }
    
    .category-card .card-img-wrapper {
        height: 150px;
    }
    
    .product-card .card-img-wrapper {
        height: 200px;
    }
    
    .list-view .product-card {
        flex-direction: column;
    }
    
    .list-view .card-img-wrapper {
        width: 100%;
        height: 200px;
    }
    
    .overlay-buttons .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .product-actions .btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .popular-badge,
    .price-badge {
        font-size: 0.65rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Animation for loading */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-item {
    animation: fadeInUp 0.6s ease-out;
}

.product-item:nth-child(odd) {
    animation-delay: 0.1s;
}

.product-item:nth-child(even) {
    animation-delay: 0.2s;
}

/* Hover effects for better UX */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-card .btn:hover {
    transform: translateY(-1px);
}

/* Focus states for accessibility */
.category-card:focus,
.product-card:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Quick View Modal Styles - Scoped to product pages only */
.products-page .modal-dialog,
.product-quickview .modal-dialog {
    max-width: 900px;
}

.product-images .main-image {
    height: 300px;
    overflow: hidden;
    border-radius: 0.375rem;
}

.product-images .main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-thumbnails img {
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.image-thumbnails img:hover {
    opacity: 0.8;
}

.product-details h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.product-details .price-info {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.specifications .row > div {
    padding: 0.25rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.product-options .option-group {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
}

.related-products .card-sm {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.related-products .card-sm:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.actions .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.cursor-pointer {
    cursor: pointer;
}

/* Responsive modal */
@media (max-width: 768px) {
    .products-page .modal-dialog,
    .product-quickview .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .product-images .main-image {
        height: 200px;
    }
    
    .image-thumbnails img {
        height: 50px;
    }
    
    .actions .d-flex {
        flex-direction: column;
    }
    
    .actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .related-products .col-md-3 {
        width: 50%;
        flex: 0 0 50%;
    }
}

/* Print styles */
@media print {
    .filters-section,
    .card-overlay,
    .product-actions,
    .overlay-buttons {
        display: none !important;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* How We Work Section Styles */
.how-we-work-section {
    position: relative;
}

.how-we-work-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(var(--primary-rgb), 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(var(--secondary-rgb), 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.process-step {
    background: white;
    border-radius: 20px;
    padding: 2rem 1.5rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.process-step:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.process-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.process-step:hover::before {
    opacity: 1;
}

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.step-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--secondary-rgb), 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem auto 1.5rem;
    font-size: 2rem;
    color: var(--primary);
    transition: all 0.3s ease;
}

.process-step:hover .step-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    transform: scale(1.1);
}

.step-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
}

.step-description {
    color: var(--gray-600);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Why Choose Section Styles */
.why-choose-section.bg-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    position: relative;
    overflow: hidden;
}

.why-choose-section::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 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><circle cx="1" cy="1" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

.feature-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #ffd700);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
}

.feature-description {
    color: var(--gray-600);
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.feature-highlight {
    display: flex;
    align-items: center;
    background: rgba(var(--success-rgb), 0.1);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
    border: 1px solid rgba(var(--success-rgb), 0.2);
}

.stats-row {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item-white {
    text-align: center;
    padding: 1rem 0;
}

.stat-number-white {
    font-size: 2.5rem;
    font-weight: 900;
    color: white;
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.stat-label-white {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin: 0;
}

/* Additional responsive styles for new sections */
@media (max-width: 768px) {
    .process-step,
    .feature-card {
        padding: 1.5rem;
    }
    
    .step-icon,
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .step-title,
    .feature-title {
        font-size: 1.1rem;
    }
    
    .step-description,
    .feature-description {
        font-size: 0.9rem;
    }
    
    .stat-number-white {
        font-size: 2rem;
    }
    
    .stat-label-white {
        font-size: 0.8rem;
    }
    
    .stats-row {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .step-icon,
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-number-white {
        font-size: 1.8rem;
    }
}