/* Car Parts Page Styles */

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 25%, #3b82f6 75%, #60a5fa 100%);
    padding: 8rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(245, 158, 11, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: headerPulse 15s ease-in-out infinite;
}

@keyframes headerPulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.page-header-content {
    position: relative;
    z-index: 2;
    color: white;
}

.page-header h1 {
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
    margin-bottom: 1rem;
}

.page-header .lead {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    font-size: 1.2rem;
}

/* Search and Filter */
.search-filter-container {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: -3rem;
    position: relative;
    z-index: 3;
}

.search-box {
    position: relative;
}

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

.search-box .form-control {
    padding-left: 3rem;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.search-box .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.form-select {
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* Part Cards */
.part-card-wrapper {
    margin-bottom: 2rem;
}

.part-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(59, 130, 246, 0.1);
    position: relative;
    height: 100%;
}

.part-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.part-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #f8fafc;
}

.part-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.part-card:hover .part-image img {
    transform: scale(1.1);
}

.part-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
}

.part-badge .badge {
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    background: linear-gradient(135deg, #10b981, #059669);
}

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

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

.quick-view-btn {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.part-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: calc(100% - 180px);
}

.part-category {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.part-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.part-description {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.part-price {
    display: flex;
    align-items: baseline;
    color: #1e40af;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.price-currency {
    font-size: 1rem;
    margin-right: 0.25rem;
}

.price-amount {
    font-size: 1.5rem;
    line-height: 1;
}

.part-stock {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.part-actions {
    margin-top: auto;
}

.quantity-selector {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem;
    font-weight: 600;
}

.quantity-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.add-to-cart-btn {
    width: 100%;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    border-radius: 20px 20px 0 0;
    border: none;
    padding: 1.5rem 2rem;
}

.modal-title {
    font-weight: 600;
    margin: 0;
}

.btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 2rem;
}

.part-image-large {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.part-image-large img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.part-details {
    padding-left: 1rem;
}

.part-price-large {
    display: flex;
    align-items: baseline;
    color: #1e40af;
    font-weight: 700;
    margin: 1rem 0;
}

.part-price-large .price-currency {
    font-size: 1.5rem;
    margin-right: 0.25rem;
}

.part-price-large .price-amount {
    font-size: 2.5rem;
    line-height: 1;
}

.part-stock-info {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.part-actions-modal {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.part-actions-modal .quantity-selector {
    justify-content: center;
    margin-bottom: 0;
}

.part-actions-modal .add-to-cart-modal-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* No Results */
.no-results {
    padding: 4rem 2rem;
    text-align: center;
}

.no-results i {
    color: #d1d5db;
    margin-bottom: 1rem;
}

.no-results h4 {
    color: #374151;
    margin-bottom: 0.5rem;
}

.no-results p {
    margin-bottom: 2rem;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .page-header {
        padding: 6rem 0 3rem;
    }
    
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    .search-filter-container {
        padding: 1.5rem;
        margin-top: -2rem;
    }
    
    .part-content {
        padding: 1rem;
    }
    
    .part-title {
        font-size: 1rem;
    }
    
    .price-amount {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .part-details {
        padding-left: 0;
        margin-top: 1rem;
    }
    
    .part-image-large img {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .search-filter-container {
        padding: 1rem;
    }
    
    .part-content {
        padding: 0.75rem;
    }
    
    .part-title {
        font-size: 0.95rem;
    }
    
    .price-amount {
        font-size: 1.1rem;
    }
    
    .quantity-selector {
        justify-content: center;
    }
    
    .add-to-cart-btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.8s ease-in;
}

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

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* Card Stagger Animation */
.part-card-wrapper {
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.part-card-wrapper:nth-child(1) { animation-delay: 0.1s; }
.part-card-wrapper:nth-child(2) { animation-delay: 0.2s; }
.part-card-wrapper:nth-child(3) { animation-delay: 0.3s; }
.part-card-wrapper:nth-child(4) { animation-delay: 0.4s; }
.part-card-wrapper:nth-child(5) { animation-delay: 0.5s; }
.part-card-wrapper:nth-child(6) { animation-delay: 0.6s; }
.part-card-wrapper:nth-child(7) { animation-delay: 0.7s; }
.part-card-wrapper:nth-child(8) { animation-delay: 0.8s; }

/* Cart Animation */
@keyframes cartBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.cart-bounce {
    animation: cartBounce 0.6s ease-in-out;
}