/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #212529;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   TOP BAR (BLACK) - NEW DESIGN
   ========================================================================== */
.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 5%;
    background: #111;
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 54px;
    width: 100%;
    margin: 0;
}

.logo_area {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    padding: 0;
    text-align: left;
}

.logo_area a {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: none;
}

.logo_area a:hover {
    transform: none;
}

/* Perfect circular logo */
.logo_image1,
img.logo_image1 {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    min-height: 32px;
    object-fit: cover !important;
    border-radius: 50% !important;
    border: 1.5px solid #fff;
    background: #fff;
    display: block;
}

.brand-name {
    font-size: 1.12rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.4px;
    margin: 0;
    white-space: nowrap;
}

.nav_center {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
    justify-content: center;
}

.nav_center a {
    color: #ccc;
    text-decoration: none;
    padding: 4px 8px;
    transition: color 0.2s;
}

.nav_center a:hover {
    color: #fff;
}

.nav_center a.active {
    color: #fff;
    border-bottom: 2px solid #fff;
}

.nav_center .sep {
    color: #555;
    font-weight: 400;
}

.login-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    flex-shrink: 0;
}

.login-icon:hover {
    background: #fff;
    color: #111;
}

/* ==========================================================================
   WELCOME BAR
   ========================================================================== */
.welcome-bar {
    background: #1a1a1a;
    color: #fff;
    padding: 8px 5%;
    font-size: 0.9rem;
}

.welcome-bar .logout-btn {
    border-color: #fff !important;
    color: #fff !important;
    font-size: 0.8rem;
    padding: 2px 10px;
}

.welcome-bar .logout-btn:hover {
    background: #fff !important;
    color: #111 !important;
}

/* ==========================================================================
   FILTERS
   ========================================================================== */
.filter-box {
    max-width: 720px;
    margin: 20px auto 8px;
    padding: 0 14px;
    width: 100%;
}

.filter-box select,
.filter-box .form-select {
    height: 46px;
    font-size: 0.95rem;
    border-radius: 10px;
    border: 1.5px solid #ddd;
    background: #fff;
}

/* ==========================================================================
   PARTS GRID & CARDS
   ========================================================================== */
.parts-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 12px 30px;
    width: 100%;
    flex: 1;
}

.part-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #eee;
    height: 100%;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.part-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.part-img {
    height: 150px;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.part-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.no-img {
    font-size: 2.4rem;
    color: #ddd;
}

.part-body {
    padding: 12px 13px 14px;
}

.part-model {
    font-size: 0.72rem;
    color: #888;
    margin-bottom: 2px;
}

.part-name {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 0 0 7px;
    line-height: 1.3;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.part-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e91e63;
}

.stock-badge {
    position: absolute;
    top: 9px;
    right: 9px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    z-index: 2;
}

.stock-badge.available {
    background: #e8f5e9;
    color: #2e7d32;
}

.stock-badge.out {
    background: #ffebee;
    color: #c62828;
}

/* ==========================================================================
   SOCIAL BAR (just above footer)
   ========================================================================== */
.social-bar {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 28px;
    padding: 14px 12px;
    background: #1a1a1a;
    border-top: 1px solid #333;
}

.social-bar a {
    color: #fff;
    font-size: 1.35rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    text-decoration: none;
}

.social-bar a:hover {
    background: #fff;
    color: #111;
    transform: translateY(-3px);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.page-footer {
    flex-shrink: 0;
    background: #111;
    color: #ccc;
    padding: 14px 12px 18px;
    text-align: center;
    margin-top: 0;
}

.page-footer h4 {
    font-size: 0.9rem;
    margin: 0 0 4px;
    color: #eee;
    font-weight: 500;
}

.page-footer h6 {
    font-size: 0.78rem;
    color: #888;
    margin: 0;
}

/* Old footer class (for other pages) */
.footer {
    background: #111;
    color: white;
    text-align: center;
    padding: 1.2rem 1rem;
    font-size: 0.88rem;
    line-height: 1.35;
}
.footer h4 { margin: 0.35em 0; font-size: 0.9rem; }
.footer h6 { margin: 0.4em 0 0; font-size: 0.7rem; color: #aaa; }

/* ==========================================================================
   OLD SOCIAL ICONS (kept for compatibility)
   ========================================================================== */
.social-icons-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    padding: 18px 10px 12px;
    background: rgba(255,255,255,0.97);
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
    flex-wrap: nowrap;
}

.social-icons-footer a {
    font-size: 32px;
    color: #555;
    transition: all 0.25s ease;
    padding: 5px;
    flex-shrink: 0;
}

.social-icons-footer a:hover {
    transform: scale(1.22);
}

.social-icons-footer a[href*="tel:"] { color: #007bff; }
.social-icons-footer a[href*="instagram"] { color: #e4405f; }
.social-icons-footer a[href*="youtube"] { color: #ff0000; }
.social-icons-footer a[href*="maps"] { color: #34a853; }

/* ==========================================================================
   SALE BADGE
   ========================================================================== */
.sale-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #28a745, #34c759);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 10;
}

.badge-sold {
    background: linear-gradient(135deg, #dc3545, #ff4d4f) !important;
}

.badge-booked {
    background: linear-gradient(135deg, #ffc107, #ffdb4d) !important;
    color: #212529 !important;
}

/* ==========================================================================
   SLIDER & SALE CARDS (for other pages)
   ========================================================================== */
.slider-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: 340px;
    margin: 5px auto;
    overflow: hidden;
    border-radius: 10px;
    background: white;
    box-shadow: 0 4px 5px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e8ecef;
}

.slider-wrapper {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.slider-image, .slider-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #f8f9fa;
    padding: 8px;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.65);
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 1.4rem;
}
.prev { left: 12px; }
.next { right: 12px; }

.sale-card, .result_card, .repair-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.1);
    padding: 1.25rem 1rem 1.4rem;
    margin: 1.8rem auto !important;
    max-width: 480px;
    width: 100%;
    text-align: center;
    border: 1px solid #e8ecef;
    transition: all 0.22s ease;
    position: relative;
}

.sale-card:hover, .result_card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

/* ==========================================================================
   RESPONSIVE - MOBILE
   ========================================================================== */
@media (max-width: 576px) {
    .top {
        padding: 8px 12px;
        min-height: 50px;
    }

    .logo_image1,
    img.logo_image1 {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px;
        min-height: 28px;
    }

    .brand-name {
        font-size: 1rem;
    }

    .nav_center {
        font-size: 0.82rem;
        gap: 4px;
    }

    .nav_center a {
        padding: 3px 5px;
    }

    .login-icon {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    .welcome-bar {
        padding: 8px 12px;
    }

    .filter-box {
        margin: 14px auto 6px;
        padding: 0 10px;
    }

    .filter-box select,
    .filter-box .form-select {
        height: 44px;
        font-size: 0.9rem;
    }

    .part-img {
        height: 130px;
    }

    .part-name {
        font-size: 0.88rem;
    }

    .part-price {
        font-size: 1.05rem;
    }

    .parts-grid {
        padding: 6px 8px 24px;
    }

    .social-bar {
        gap: 22px;
        padding: 12px 10px;
    }

    .social-bar a {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .page-footer {
        padding: 12px 10px 16px;
    }

    .page-footer h4 {
        font-size: 0.85rem;
    }

    .sale-card, .result_card, .repair-card {
        margin: 1.3rem auto !important;
    }

    .slider-container {
        max-width: 85%;
        max-height: 290px;
        margin: 12px auto;
    }

    .social-icons-footer {
        gap: 20px;
        padding: 20px 10px 12px;
    }

    .social-icons-footer a {
        font-size: 28px;
    }
}