/* Shop Parts Page Styles - uses CSS variables from indexStyles.css */

/* Page Layout */
.shop-parts-page {
    min-height: 100vh;
    padding: 100px 0 80px;
    background: rgba(0, 0, 0, 0.27);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

.page-header h1 {
    font-family: var(--font-primary);
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--pure-white);
}

.page-header p {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--medium-gray);
    max-width: 700px;
    margin: 0 auto;
}

/* Search Section */
.search-section {
    max-width: 800px;
    margin: 0 auto 4rem;
    position: relative;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--secondary-black);
    border-radius: 50px;
    padding: 8px 8px 8px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--dark-gray);
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--accent-red);
    box-shadow: 0 10px 40px rgba(229, 0, 0, 0.2);
}

.search-icon {
    width: 24px;
    height: 24px;
    color: var(--medium-gray);
    margin-right: 12px;
    flex-shrink: 0;
}

#product-search {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--pure-white);
    font-size: 1.1rem;
    font-family: var(--font-secondary);
    padding: 12px 0;
}

#product-search::placeholder {
    color: var(--medium-gray);
}

.search-btn {
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 40px;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-secondary);
    flex-shrink: 0;
}

.search-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(229, 0, 0, 0.4);
}

/* Search Results */
.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--secondary-black);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    max-height: 500px;
    overflow-y: auto;
    z-index: 100;
    border: 2px solid var(--dark-gray);
}

.search-results.hidden {
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--dark-gray);
}

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

.search-result-item:hover {
    background: var(--primary-black);
}

.search-result-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.search-result-info {
    flex: 1;
}

.search-result-info h4 {
    color: var(--pure-white);
    font-size: 1rem;
    margin-bottom: 5px;
}

.search-result-price {
    color: var(--accent-red);
    font-weight: bold;
    font-size: 1.1rem;
}

.search-loading,
.no-results,
.search-error {
    padding: 30px;
    text-align: center;
    color: var(--medium-gray);
}

.spinner-small {
    border: 3px solid rgba(229, 0, 0, 0.2);
    border-radius: 50%;
    border-top: 3px solid var(--accent-red);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* All Collections List Section */
.all-collections-section {
    margin-bottom: 6rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--dark-gray);
}

/* Collections Dropdown */
.collections-dropdown {
    position: relative;
    max-width: 400px;
    margin: 2rem auto;
}

.dropdown-btn {
    width: 100%;
    background: var(--secondary-black);
    border: 2px solid var(--accent-red);
    border-radius: 12px;
    padding: 16px 20px;
    color: var(--pure-white);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.dropdown-btn:hover {
    background: rgba(229, 0, 0, 0.1);
    border-color: #cc0000;
}

.dropdown-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.dropdown-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--secondary-black);
    border: 2px solid var(--dark-gray);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.dropdown-menu.hidden {
    display: none;
}

.collections-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    padding: 8px;
    margin: 0;
}

.collections-list.hidden {
    display: none;
}

.collections-list li {
    position: relative;
    padding: 0;
    line-height: 1.2;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.collections-list li:hover {
    background: rgba(229, 0, 0, 0.1);
}

.collections-list li::before {
    display: none;
}

.collections-list li a {
    color: var(--pure-white);
    text-decoration: none;
    font-size: 1rem;
    font-family: var(--font-secondary);
    transition: all 0.3s ease;
    display: block;
    padding: 12px 16px;
    border-radius: 6px;
}

.collections-list li a:hover {
    color: var(--accent-red);
    background: rgba(229, 0, 0, 0.1);
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--pure-white);
}

.section-header p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--medium-gray);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-state.hidden {
    display: none;
}

.spinner {
    border: 4px solid rgba(229, 0, 0, 0.2);
    border-radius: 50%;
    border-top: 4px solid var(--accent-red);
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.loading-state p {
    color: var(--medium-gray);
    font-size: 1.1rem;
}

/* Products Section */
.products-section {
    margin-bottom: 4rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.products-grid.hidden {
    display: none;
}

.product-card {
    background: var(--secondary-black);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(229, 0, 0, 0.2);
    border-color: var(--accent-red);
}

.product-image {
    position: relative;
    height: 280px;
    background: var(--primary-black);
    overflow: hidden;
}

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

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

.sold-out-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--pure-white);
    line-height: 1.4;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-red);
    margin-bottom: 1rem;
}

.btn-view-product {
    width: 100%;
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-secondary);
}

.btn-view-product:hover:not(:disabled) {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(229, 0, 0, 0.4);
}

.btn-view-product:disabled {
    background: var(--dark-gray);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Load More Section */
.load-more-section {
    text-align: center;
}

.load-more-section.hidden {
    display: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-red), #dc143c);
    color: white;
    border: none;
    padding: 16px 48px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-secondary);
    box-shadow: 0 10px 30px rgba(229, 0, 0, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #dc143c, var(--accent-red));
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(229, 0, 0, 0.4);
}

/* Utility Classes */
.text-accent {
    color: var(--accent-red);
}

.hidden {
    display: none !important;
}

/* Responsive Design */

/* Desktop Large (1400px+) */
@media (min-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .collections-list {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Desktop Medium (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .collections-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet Landscape (1024px - 1200px) */
@media (min-width: 1024px) and (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .collections-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    .shop-parts-page {
        padding: 80px 0 60px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .collections-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem 1.5rem;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    .page-header {
        margin-bottom: 2rem;
        padding-top: 1rem;
    }

    .search-section {
        margin-bottom: 3rem;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        border-radius: 20px;
    }

    #product-search {
        margin-bottom: 10px;
        padding: 10px 0;
    }

    .search-btn {
        width: 100%;
        padding: 14px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .product-image {
        height: 240px;
    }

    .collections-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem 1rem;
    }

    .collections-list li a {
        font-size: 1rem;
    }

    .all-collections-section {
        margin-bottom: 4rem;
        padding-bottom: 3rem;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .search-icon {
        width: 20px;
        height: 20px;
    }

    #product-search {
        font-size: 1rem;
    }

    .product-image {
        height: 220px;
    }

    .product-info {
        padding: 1.25rem;
    }

    .btn-primary {
        padding: 14px 36px;
        font-size: 1rem;
    }

    .collections-list {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}