/* Parts Page Specific Styles */
.Parts-page {
    padding-top: 80px;
    min-height: 100vh;
    background: var(--wealthy-white);
}

/* Parts Header */
.Parts-header {
    background-color: var(--wealthy-white);
    background-position: center;
    background-size: cover;
    display: flex;
    position: fixed;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 80px;
    top: 0;
    left: 0;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Hero Section */
.parts-hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("images/steering wheel.jpg");
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    text-align: center;
    padding: 150px 20px;
    color: var(--white);
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.parts-hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 1s ease-out;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out;
}

/* Search and Filter Section */
.search-filter-section {
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-radius: 14px;
    padding: 2rem 2.5rem 1.5rem 2.5rem;
    margin: 2rem auto 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1400px;
}

.search-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem 2.5rem;
    align-items: flex-end;
    justify-content: center;
}

.make-filter,
.model-filter,
.part-type-filter,
.condition-filter {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.make-filter label,
.model-filter label,
.part-type-filter label,
.condition-filter label {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #222;
}

.make-filter select,
.make-filter input,
.model-filter input,
.part-type-filter select,
.condition-filter select {
    padding: 0.5rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: #fafafa;
    transition: border-color 0.2s;
}

.make-filter select:focus,
.make-filter input:focus,
.model-filter input:focus,
.part-type-filter select:focus,
.condition-filter select:focus {
    border-color: var(--primary-yellow, #ffd600);
    outline: none;
}

.search-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-width: 220px;
}

.search-box input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: #fafafa;
    transition: border-color 0.2s;
}

.search-box input[type="text"]:focus {
    border-color: var(--primary-yellow, #ffd600);
    outline: none;
}

.search-button {
    background: var(--primary-yellow, #ffd600);
    color: #222;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background: #ffe066;
}

.reset-filters {
    background: var(--primary-yellow, #ffd600);
    color: #222;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1.4rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1.2rem;
    transition: background 0.2s;
    align-self: flex-end;
}

.reset-filters:hover {
    background: #ffe066;
}

/* Parts Listing Section */
.parts-listing {
    padding: 2rem 0;
    background: var(--wealthy-white);
}

.parts-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.part-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.part-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.part-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.part-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

/* Placeholder image box when no image is available */
.part-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f4f4f4, #ffffff);
    color: #999;
}

.no-image-icon {
    font-size: 2.25rem;
    opacity: 0.85;
}

.part-card:hover .part-image img {
    transform: scale(1.05);
}

.part-price {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-yellow);
    color: var(--black);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1.1rem;
}

.part-info {
    padding: 1.5rem;
}

    

.part-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.spec {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray);
    font-size: 0.9rem;
}

.spec i {
    color: var(--primary-yellow);
}

.part-details {
    margin-bottom: 1.5rem;
}

.part-details p {
    margin: 0.5rem 0;
    color: var(--dark-gray);
    font-size: 0.9rem;
}

.part-actions {
    display: flex;
    gap: 0.5rem;
}

/* Make the WhatsApp enquire button span the full width of the card
   and stack actions vertically so the Enquire action is a full-width line */
.parts-grid .part-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.parts-grid .part-actions .view-details {
    width: 100%;
}

.parts-grid .part-actions .enquire-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem;
    border-radius: 6px;
    text-decoration: none;
}

.add-to-cart,
.enquire-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 0.9rem;
}

.add-to-cart {
    background: var(--primary-yellow);
    color: var(--black);
}

.add-to-cart:hover {
    background: var(--dark-yellow);
    transform: translateY(-2px);
}

.enquire-btn {
    background: var(--dark-gray);
    color: var(--white);
}

.enquire-btn:hover {
    background: var(--black);
    transform: translateY(-2px);
}

/* Request Part Section */
.request-part-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.request-part-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-yellow), var(--dark-yellow));
}

.request-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.request-container h2 {
    font-size: 2.5rem;
    color: var(--black);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.request-container h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--primary-yellow);
    border-radius: 2px;
}

.request-container p {
    font-size: 1.2rem;
    color: var(--dark-gray);
    margin-bottom: 3rem;
    line-height: 1.6;
}

.request-form {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Ensure the request form and its inputs sit above any decorative overlays and accept pointer events */
.request-form {
    z-index: 5; /* raise above hero/overlays */
}

.form-group textarea {
    position: relative;
    z-index: 6;
    pointer-events: auto;
}

.request-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.form-group label {
    font-weight: 600;
    color: var(--black);
    font-size: 1rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-yellow);
    outline: none;
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-request-btn {
    background: linear-gradient(45deg, var(--primary-yellow), var(--dark-yellow));
    color: var(--black);
    padding: 1rem 2rem;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.submit-request-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.submit-request-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.submit-request-btn:hover::before {
    left: 100%;
}

/* Responsive Design */
@media (max-width: 1100px) {
    .search-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1.2rem;
    }
    
    .search-container > div {
        min-width: 100%;
    }
    
    .reset-filters {
        width: 100%;
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .parts-hero {
        padding: 100px 20px;
        /* ensure smooth mobile scrolling */
        background-attachment: scroll;
    }
    
    .search-filter-section {
        padding: 1rem;
        margin: 1rem;
    }
    
    .parts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .request-form {
        padding: 2rem 1.5rem;
    }
    
    .request-container h2 {
        font-size: 2rem;
    }
    
    .request-container p {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .parts-hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .parts-content {
        padding: 0 1rem;
    }
    
    .request-form {
        padding: 1.5rem 1rem;
    }
    
    .submit-request-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

/* Animation keyframes */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--dark-gray);
    font-size: 1.1rem;
}

.loading i {
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* No results state */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--dark-gray);
}

.no-results i {
    font-size: 3rem;
    color: var(--primary-yellow);
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.no-results p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Part gallery modal styles */
.part-gallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1200;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.part-gallery-modal.active { display: flex; opacity: 1; }
.part-gallery-content { position: relative; width: 100%; height: 100%; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.part-gallery-main { position: relative; width: 100%; height: calc(100% - 80px); display:flex; align-items:center; justify-content:center; }
.part-gallery-image-container { width: 100%; height: 100%; display:flex; align-items:center; justify-content:center; }
.part-gallery-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.part-gallery-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; z-index: 1300; }
.part-gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.08); border: none; color: #fff; width: 50px; height: 50px; display:flex; align-items:center; justify-content:center; cursor:pointer; border-radius:50%; z-index:1300; }
.part-gallery-nav.prev { left: 1.5rem; }
.part-gallery-nav.next { right: 1.5rem; }
.part-gallery-info { position: absolute; bottom: 1rem; color: #fff; z-index: 1300; }

/* Copy of cars page gallery styles so parts gallery matches exactly */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1200;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gallery-modal.active {
    display: flex;
    opacity: 1;
}
.gallery-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.gallery-main {
    position: relative;
    width: 100%;
    height: calc(100% - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.06);
    border: none;
    color: white;
    font-size: 2.2rem;
    cursor: pointer;
    padding: 0.6rem 0.8rem;
    transition: transform 0.15s ease, background 0.15s ease;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 1300; /* make sure the button itself is on top */
    opacity: 0.95;
}
.gallery-prev { left: 1rem; }
.gallery-next { right: 1rem; }
.gallery-nav:hover { transform: scale(1.03); background: rgba(255,255,255,0.12); }
.gallery-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1400;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.gallery-close:hover { background: rgba(255,255,255,0.1); }
.gallery-info { color: white; text-align: center; margin: 1rem 0; font-size: 1.1rem; }
.gallery-thumbnails {
    /* hide thumbnails strip per request and keep layout centered */
    display: none; /* thumbnails removed */
}
.gallery-thumbnail { width:60px; height:60px; object-fit:cover; cursor:pointer; border:2px solid transparent; transition:all .3s; border-radius:4px; }
.gallery-thumbnail:hover { transform: scale(1.1); }
.gallery-thumbnail.active { border-color: #007bff; transform: scale(1.1); }

@media (max-width:768px) {
    .gallery-nav { font-size:1.5rem; }
    .gallery-thumbnail { width:40px; height:40px; }
}
