* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header */
.header {
    background: #fcfcfc;
    color: hsl(0, 0%, 100%);
    padding: 15px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left .logo {
    width: 120px;
    height: 100px;
    object-fit: contain;
}

.header-left .company-name {
    font-size: 40px;
    font-weight: 700;
    color: #e94560;
    font-family: "Bungee", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-right .menu-bar {
    display: flex;
    gap: 20px;
}

.header-right .menu-bar a {
    color: #111429;
    font-size: 15px;
    transition: color 0.3s;
}

.header-right .menu-bar a:hover {
    color: #e94560;
}

.header-right .auth-links {
    display: flex;
    gap: 10px;
}

.header-right .auth-links a {
    padding: 8px 18px;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.header-right .auth-links .login-link {
    color: #111429;
    border: 1px solid #e94560;
}

.header-right .auth-links .login-link:hover {
    background: #e94560;
}

.header-right .auth-links .register-link {
    background: #e94560;
    color: #fff;
}

.header-right .auth-links .register-link:hover {
    background: #d63851;
}

.header-right .auth-links .logout-link {
    color: #ccc;
    border: 1px solid #666;
}

.header-right .auth-links .logout-link:hover {
    border-color: #e94560;
    color: #e94560;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
    font-size: 14px;
}

.user-info a {
    color: #e94560;
}

.unread-badge {
    background: #e94560;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

/* Advertisements */
.ads-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 30px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.ads-section .ad-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    height: 200px;
    position: relative;
}

.ads-section .ad-item:hover {
    transform: translateY(-3px);
}

.ads-section .ad-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ads-section .ad-item .ad-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    padding: 15px;
}

.ads-section .ad-item .ad-overlay h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.ads-section .ad-item .ad-overlay p {
    font-size: 13px;
    opacity: 0.9;
}

/* Parts Grid */
.parts-section {
    padding: 20px 40px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.parts-section h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #1a1a2e;
    border-bottom: 3px solid #e94560;
    padding-bottom: 10px;
    display: inline-block;
}

.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-bar select, .filter-bar input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
}

.filter-bar select:focus, .filter-bar input:focus {
    border-color: #e94560;
}

.filter-bar button {
    padding: 10px 25px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.filter-bar button:hover {
    background: #e94560;
}

.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.part-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.part-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.part-card .part-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.part-card .part-info {
    padding: 15px;
}

.part-card .part-info h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #1a1a2e;
}

.part-card .part-info .part-price {
    font-size: 20px;
    font-weight: 700;
    color: #e94560;
    margin-bottom: 8px;
}

.part-card .part-info .part-meta {
    font-size: 13px;
    color: #777;
    margin-bottom: 5px;
}

.part-card .part-info .part-meta span {
    margin-right: 15px;
}

.part-card .sold-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e94560;
    color: #fff;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    z-index: 2;
}

.part-card .sold-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.part-card .sold-overlay span {
    color: #fff;
    font-size: 32px;
    font-weight: 900;
    transform: rotate(-20deg);
    border: 4px solid #fff;
    padding: 10px 30px;
    border-radius: 5px;
}

/* Part Detail Page */
.detail-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.detail-gallery {
    position: relative;
}

.detail-gallery .main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
}

.detail-gallery .thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.detail-gallery .thumbnails img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.detail-gallery .thumbnails img.active,
.detail-gallery .thumbnails img:hover {
    border-color: #e94560;
}

.detail-info h1 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #1a1a2e;
}

.detail-info .detail-price {
    font-size: 32px;
    font-weight: 700;
    color: #e94560;
    margin-bottom: 15px;
}

.detail-info .detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.detail-info .detail-meta .meta-item {
    font-size: 14px;
}

.detail-info .detail-meta .meta-item strong {
    color: #555;
}

.detail-info .detail-description {
    margin-bottom: 25px;
    line-height: 1.8;
    color: #555;
}

.detail-info .sold-status {
    display: inline-block;
    background: #e94560;
    color: #fff;
    padding: 8px 25px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 20px;
}

/* Message Section */
.message-section {
    margin-top: 30px;
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.message-section h3 {
    margin-bottom: 15px;
    color: #1a1a2e;
}

.message-section .message-form textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
}

.message-section .message-form textarea:focus {
    border-color: #e94560;
    outline: none;
}

.message-section .message-form button {
    padding: 12px 30px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.3s;
}

.message-section .message-form button:hover {
    background: #d63851;
}

.message-section .messages-list {
    margin-top: 20px;
}

.message-section .messages-list .msg-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid #e94560;
}

.message-section .messages-list .msg-item .msg-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #888;
}

.message-section .messages-list .msg-item .msg-text {
    font-size: 14px;
    line-height: 1.6;
}

.message-section .messages-list .msg-item .msg-reply {
    margin-top: 12px;
    padding: 12px;
    background: #e8f4e8;
    border-radius: 5px;
    border-left: 3px solid #28a745;
}

.message-section .messages-list .msg-item .msg-reply .reply-label {
    font-weight: 600;
    color: #28a745;
    font-size: 13px;
    margin-bottom: 5px;
}

.login-msg {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
    text-align: center;
}

.login-msg a {
    color: #e94560;
    font-weight: 600;
}

/* Auth Forms */
.auth-container {
    max-width: 450px;
    margin: 60px auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #1a1a2e;
}

.auth-container .form-group {
    margin-bottom: 18px;
}

.auth-container .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #555;
}

.auth-container .form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.auth-container .form-group input:focus {
    border-color: #e94560;
}

.auth-container button {
    width: 100%;
    padding: 13px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-container button:hover {
    background: #d63851;
}

.auth-container .auth-link {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: #777;
}

.auth-container .auth-link a {
    color: #e94560;
    font-weight: 600;
}

.auth-container .error-msg {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

.auth-container .success-msg {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Footer */
.footer {
    background: #1a1a2e;
    color: #ccc;
    text-align: center;
    padding: 25px;
    margin-top: 50px;
    font-size: 14px;
    position: fixed;
    bottom: 0;
    left: 0;
     width: 100%;

}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    .header-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    .ads-section {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    .parts-section {
        padding: 20px;
    }
    .parts-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    .detail-container {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }
    .filter-bar {
        flex-direction: column;
    }
}

/* My Messages Page */
.messages-page {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 40px;
}

.messages-page h2 {
    margin-bottom: 25px;
    color: #1a1a2e;
    border-bottom: 3px solid #e94560;
    padding-bottom: 10px;
    display: inline-block;
}

.msg-conversation {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.msg-conversation .conv-header {
    padding: 15px 20px;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.msg-conversation .conv-header .conv-part {
    font-weight: 600;
}

.msg-conversation .conv-header .conv-part a {
    color: #e94560;
}

.msg-conversation .conv-body {
    padding: 20px;
}

.msg-conversation .conv-body .conv-msg {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    background: #f5f5f5;
}

.msg-conversation .conv-body .conv-msg.customer {
    border-left: 3px solid #e94560;
}

.msg-conversation .conv-body .conv-msg.admin {
    border-left: 3px solid #28a745;
    background: #e8f4e8;
}

.msg-conversation .conv-body .conv-msg .conv-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.msg-conversation .conv-body .conv-msg .conv-text {
    font-size: 14px;
    line-height: 1.6;
}

.msg-unread {
    background: #fff3cd !important;
}
