/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue: #1c72f1;
    --blue-dark: #1459c0;
    --red: #ff0745;
    --bg: #f9f9f9;
    --text: #232323;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --white: #ffffff;
    --dark: #111111;
    --card-bg: #ffffff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.1), 0 12px 40px rgba(0,0,0,0.06);
    --transition: 200ms ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Roboto', -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-dark); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* === Header === */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.92);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo-link { display: flex; align-items: center; }
.logo { height: 36px; width: auto; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.main-nav > a {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: var(--text);
    transition: color var(--transition);
}
.main-nav > a:hover { color: var(--blue); }

.lang-switch {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border-radius: 8px;
    padding: 4px;
}
.lang-switch a {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-light);
    transition: all var(--transition);
}
.lang-switch a.active,
.lang-switch a:hover {
    background: var(--white);
    color: var(--blue);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* === Catalog === */
.site-main { padding: 48px 0 80px; flex: 1; }

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 16px;
}

.catalog-header h1 {
    font-size: 32px;
    font-weight: 700;
}

.filters { display: flex; gap: 8px; }

.filter-btn {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 100px;
    background: var(--white);
    color: var(--text-light);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.filter-btn:hover,
.filter-btn.active {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}

/* === Listing Cards === */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.listing-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    color: var(--text);
}
.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f0f0f0;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms ease;
}
.listing-card:hover .card-image img { transform: scale(1.04); }

.sold-badge, .type-badge {
    position: absolute;
    top: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sold-badge {
    right: 12px;
    background: var(--red);
    color: white;
}
.type-badge.part {
    left: 12px;
    background: rgba(0,0,0,0.7);
    color: white;
}

.listing-card.sold { opacity: 0.7; }
.listing-card.sold .card-image img { filter: grayscale(50%); }

.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }

.card-brand {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--blue);
    margin-bottom: 4px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-specs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}
.card-specs span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-specs span::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--border);
}
.card-specs span:first-child::before { display: none; }

.card-price {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* === Detail Page === */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 24px;
}
.back-link:hover { color: var(--blue); }

.detail-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 48px;
    margin-bottom: 40px;
}

.detail-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery-image {
    border-radius: var(--radius);
    overflow: hidden;
    background: #f0f0f0;
    cursor: pointer;
    position: relative;
}
.gallery-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 300ms ease;
}
.gallery-image:hover img {
    transform: scale(1.02);
}
.gallery-image.no-image {
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}
.gallery-image.no-image img {
    width: 120px;
    height: auto;
    opacity: 0.3;
}

.gallery-zoom-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.5);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}
.gallery-image:hover .gallery-zoom-hint {
    opacity: 1;
}

.detail-info {
    position: sticky;
    top: 96px;
    align-self: start;
}

.detail-brand {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--blue);
    margin-bottom: 4px;
}

.detail-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.detail-price {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
}

.sold-badge-detail {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 8px;
    background: var(--red);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}
.specs-table tr { border-bottom: 1px solid var(--border); }
.specs-table th, .specs-table td { padding: 12px 0; }
.specs-table th {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    text-align: left;
    width: 40%;
}
.specs-table td {
    font-weight: 500;
    text-align: right;
}

/* === Description (in right panel) === */
.detail-description {
    margin-top: 8px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.detail-description h3 {
    font-size: 18px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.description-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
}
.description-content p { margin-bottom: 8px; }
.description-content p:last-child { margin-bottom: 0; }
.description-content strong { font-weight: 600; }
.description-content ul { padding-left: 20px; margin-bottom: 8px; }
.description-content li { margin-bottom: 2px; line-height: 1.5; }
.description-content br + br { display: none; }

/* === Inquiry Form (full width) === */
.inquiry-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    margin-bottom: 32px;
}

.inquiry-section h2 {
    font-size: 24px;
    margin-bottom: 24px;
}

.inquiry-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.inquiry-form .form-row.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(28,114,241,0.12);
}

.form-group textarea { resize: vertical; }

/* === Lightbox === */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 300ms ease, visibility 300ms ease;
}
.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition);
    z-index: 10;
    line-height: 1;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all var(--transition);
    z-index: 10;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
}

.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}
.btn-primary:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-outline:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    color: var(--text-light);
    border: none;
    padding: 10px 16px;
}
.btn-ghost:hover { color: var(--text); }

.btn-danger {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}
.btn-danger:hover { opacity: 0.9; color: var(--white); }

.btn-full { width: 100%; }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }

/* === Alerts === */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
    font-size: 16px;
}

/* === Footer === */
.site-footer {
    background: var(--dark);
    color: var(--white);
    padding: 48px 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-logo { height: 28px; width: auto; margin-bottom: 12px; }

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.footer-contact a {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: color var(--transition);
}
.footer-contact a:hover { color: var(--white); }

.footer-right { text-align: right; }

.footer-social {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    justify-content: flex-end;
}
.footer-social a {
    color: rgba(255,255,255,0.6);
    transition: color var(--transition);
}
.footer-social a:hover { color: var(--white); }

.footer-copy {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.page-link:hover {
    background: var(--bg);
    border-color: var(--blue);
    color: var(--blue);
}
.page-link.active {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}

/* === Responsive === */
@media (max-width: 768px) {
    .header-inner { height: 60px; }
    .logo { height: 28px; }
    .main-nav { display: none; }
    .main-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 20px 24px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        gap: 16px;
    }
    .mobile-toggle { display: flex; }

    .catalog-header { flex-direction: column; align-items: flex-start; }
    .catalog-header h1 { font-size: 24px; }

    .listings-grid { grid-template-columns: 1fr; }

    .detail-layout { grid-template-columns: 1fr; gap: 24px; }
    .detail-info { position: static; }
    .detail-title { font-size: 24px; }
    .detail-price { font-size: 22px; }

    .inquiry-form .form-row,
    .inquiry-form .form-row.form-row-3 { grid-template-columns: 1fr; }
    .inquiry-section { padding: 24px; }
    .detail-description { margin-top: 16px; padding-top: 16px; }

    .footer-inner { flex-direction: column; text-align: center; }
    .footer-right { text-align: center; }
    .footer-social { justify-content: center; }

    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

@media (max-width: 480px) {
    .listings-grid { grid-template-columns: 1fr; gap: 16px; }
    .card-title { font-size: 16px; }
    .card-price { font-size: 18px; }
}

/* === Login === */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo { height: 40px; margin: 0 auto 24px; }
.login-card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 28px;
    color: var(--text);
}
.login-card .form-group { text-align: left; }
