/* Medical Product Grid Styles */
.medical-product-grid-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
}

/* Category Filter Section */
.category-filter-section {
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-radius: 12px;
    overflow: hidden;
}

.category-header {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    padding: 25px;
    position: relative;
}

.category-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 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.category-title {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.category-subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.category-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 2px solid transparent;
}

.category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.15);
    border-color: #4A90E2;
}

.category-image {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.category-name {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.product-count {
    font-size: 13px;
    color: #4A90E2;
    font-weight: 500;
    background: rgba(74, 144, 226, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
}

/* Product Grid Header */
.product-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 2px solid #f0f0f0;
}

.section-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #333;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #4A90E2, #357ABD);
    border-radius: 2px;
}

.product-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.product-sort {
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.product-sort:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Product Content Layout */
.product-content-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* Sidebar Filters */
.product-filters-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.filter-section {
    background: white;
    border-radius: 12px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.filter-title {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    margin: 0;
    padding: 18px 20px;
    font-size: 16px;
    font-weight: 600;
    position: relative;
}

.filter-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.2);
}

.price-filter-options,
.brand-filter-options {
    padding: 20px;
}

.price-filter-options label,
.brand-filter-options label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.3s ease;
    position: relative;
}

.price-filter-options label:hover,
.brand-filter-options label:hover {
    color: #4A90E2;
}

.price-filter-options input,
.brand-filter-options input {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    accent-color: #4A90E2;
}

/* Products Grid */
.products-container {
    flex: 1;
    min-width: 0;
}

.products-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
    grid-template-columns: repeat(4, 1fr); /* Default 4 columns */
}

/* Grid columns based on container data attribute */
.products-container[data-columns="2"] .products-grid { grid-template-columns: repeat(2, 1fr); }
.products-container[data-columns="3"] .products-grid { grid-template-columns: repeat(3, 1fr); }
.products-container[data-columns="4"] .products-grid { grid-template-columns: repeat(4, 1fr); }
.products-container[data-columns="5"] .products-grid { grid-template-columns: repeat(5, 1fr); }

/* Product Cards */
.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border-color: #4A90E2;
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image-wrapper img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.08);
}

.wishlist-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    z-index: 2;
}

.wishlist-btn:hover {
    background: #ff4757;
    color: white;
    transform: scale(1.1);
}

.wishlist-btn.active {
    background: #ff4757;
    color: white;
}

.heart-icon {
    font-size: 18px;
    transition: all 0.3s ease;
}

.product-info {
    padding: 20px;
}

.product-title {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #4A90E2;
}

.stock-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-status.in-stock {
    background: linear-gradient(135deg, #2ed573 0%, #17c0eb 100%);
    color: white;
}

.stock-status.out-of-stock {
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
    color: white;
}

.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4A90E2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .medical-product-grid-wrapper {
        padding: 15px;
    }

    .product-content-wrapper {
        gap: 25px;
    }

    .product-filters-sidebar {
        width: 250px;
    }

    .products-grid[data-columns="5"] {
        grid-template-columns: repeat(4, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .product-content-wrapper {
        flex-direction: column;
        gap: 30px;
    }

    .product-filters-sidebar {
        width: 100%;
        order: 2;
    }

    .products-container {
        order: 1;
    }

    .products-grid[data-columns="4"],
    .products-grid[data-columns="5"] {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-grid[data-columns="3"] {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product-grid-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .section-title {
        font-size: 24px;
        text-align: center;
    }

    .product-controls {
        justify-content: center;
    }

    .category-header {
        padding: 20px;
        text-align: center;
    }

    .category-title {
        font-size: 18px;
    }

    .filter-section {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .medical-product-grid-wrapper {
        padding: 10px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }

    .category-item {
        padding: 15px;
    }

    .category-image {
        width: 60px;
        height: 60px;
    }

    .product-card {
        border-radius: 12px;
    }

    .product-image-wrapper img {
        height: 200px;
    }

    .product-info {
        padding: 15px;
    }

    .section-title {
        font-size: 20px;
    }

    .category-title {
        font-size: 16px;
    }

    .category-subtitle {
        font-size: 13px;
    }

    .sort-controls {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .product-sort {
        width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .medical-product-grid-wrapper {
        background: #1a1a1a;
        color: #fff;
    }

    .category-item,
    .product-card,
    .filter-section {
        background: #2d2d2d;
        border-color: #404040;
    }

    .category-name,
    .product-title a {
        color: #fff;
    }

    .product-sort {
        background: #2d2d2d;
        border-color: #404040;
        color: #fff;
    }

    .no-products {
        background: #2d2d2d;
        color: #ccc;
    }
}

/* Notification Styles */
.medical-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.medical-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.medical-notification-success {
    background: linear-gradient(135deg, #2ed573 0%, #17c0eb 100%);
}

.medical-notification-error {
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
}

.medical-notification-info {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
}

/* Print styles */
@media print {
    .wishlist-btn,
    .product-filters-sidebar,
    .product-controls,
    .medical-notification {
        display: none !important;
    }

    .product-content-wrapper {
        flex-direction: column;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
