/* ═══════════════════════════════════════════════════════════════
   STYLES — Mehmet İnce Gayrimenkul
   styles.css — Complete redesign
═══════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─────────────────────────────────── */
:root {
    --primary:        #1a3a6b;
    --primary-hover:  #163264;
    --primary-light:  #2756a8;
    --accent:         #f59e0b;
    --accent-hover:   #d97706;
    --bg:             #f4f6f9;
    --surface:        #ffffff;
    --surface-alt:    #f8fafc;
    --text:           #1a202c;
    --text-muted:     #64748b;
    --border:         #e2e8f0;
    --border-focus:   #2756a8;
    --success:        #16a34a;
    --success-bg:     #f0fdf4;
    --error:          #dc2626;
    --error-bg:       #fef2f2;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
    --shadow:         0 4px 16px rgba(0,0,0,0.10);
    --shadow-hover:   0 8px 32px rgba(0,0,0,0.14);
    --radius-sm:      8px;
    --radius:         12px;
    --radius-lg:      20px;
    --transition:     all 0.22s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img,
video,
svg {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

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

ul,
ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
}

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════════ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Logo */
.header-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.header-logo span {
    color: var(--accent);
}

/* Search bar */
.header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 auto;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    transition: var(--transition);
}

.search-form:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(39, 86, 168, 0.12);
    background: var(--surface);
}

.search-input {
    flex: 1;
    padding: 0.55rem 1.25rem;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text);
    outline: none;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    width: 40px;
    height: 40px;
    margin: 2px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--primary-hover);
}

.search-btn svg {
    width: 16px;
    height: 16px;
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.header-auth-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
}

.header-auth-link:hover {
    color: var(--primary);
    background: rgba(26, 58, 107, 0.06);
}

.header-auth-link.register {
    background: var(--primary);
    color: white;
    padding: 0.4rem 1rem;
}

.header-auth-link.register:hover {
    background: var(--primary-hover);
}

/* Icon-only buttons (used on mobile) */
.header-icon-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.header-icon-btn:hover {
    background: var(--bg);
    color: var(--primary);
}

/* Hamburger */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex-shrink: 0;
}

.hamburger-btn:hover {
    background: var(--bg);
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* ─── Mobile Menu Overlay ────────────────────────────────────── */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.mobile-menu-overlay.open {
    display: block;
    animation: fadeIn 0.22s ease;
}

.mobile-menu-panel {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    animation: slideInLeft 0.25s ease;
    overflow-y: auto;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    height: 64px;
    flex-shrink: 0;
}

.mobile-menu-logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

.mobile-menu-logo span {
    color: var(--accent);
}

.mobile-menu-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
}

.mobile-menu-close:hover {
    background: var(--border);
    color: var(--text);
}

.mobile-menu-nav {
    padding: 1rem 0;
    flex: 1;
}

.mobile-menu-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    border-left: 3px solid transparent;
    transition: var(--transition);
    text-decoration: none;
}

.mobile-menu-nav a:hover,
.mobile-menu-nav a.active {
    color: var(--primary);
    background: rgba(26, 58, 107, 0.06);
    border-left-color: var(--primary);
}

.mobile-menu-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu-footer .btn-outline,
.mobile-menu-footer .btn-primary {
    display: block;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN LAYOUT
═══════════════════════════════════════════════════════════════ */
.main-container {
    display: flex;
    flex-direction: row;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
    align-items: flex-start;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════════ */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: sticky;
    top: 80px;
}

.sidebar-section {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-heading {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 1rem 0.5rem;
}

/* Category items */
.category-item {
    overflow: hidden;
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
    gap: 0.5rem;
}

.category-link:hover {
    background: rgba(26, 58, 107, 0.05);
    color: var(--primary);
}

.category-link.active {
    color: var(--primary);
    background: rgba(26, 58, 107, 0.08);
}

.category-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 500;
    flex: 1;
    min-width: 0;
}

.cat-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.category-count {
    flex-shrink: 0;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    min-width: 24px;
    text-align: center;
}

.category-arrow {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform 0.22s ease;
}

.category-item.open .category-arrow {
    transform: rotate(90deg);
}

/* Subcategory */
.subcategory-list {
    display: none;
    flex-direction: column;
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
}

.category-item.open .subcategory-list {
    display: flex;
}

.subcategory-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    border-left: 2px solid transparent;
}

.subcategory-link:hover {
    color: var(--primary);
    background: rgba(26, 58, 107, 0.05);
    border-left-color: var(--primary);
}

.subcategory-link.active {
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}

/* Sidebar mobile toggle */
.sidebar-overlay-btn {
    display: none;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 700;
}

.sidebar-backdrop.open {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   SHOWCASE / GALLERY
═══════════════════════════════════════════════════════════════ */
.showcase {
    flex-grow: 1;
    min-width: 0;
}

.showcase-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.showcase-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.showcase-subtitle {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.showcase-see-all {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    transition: var(--transition);
    flex-shrink: 0;
}

.showcase-see-all:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.2rem;
}

@media (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ═════════════════════════════════════════════════════════════���═
   AD CARDS
═══════════���════════��══════════════════════════════════════════ */
.ad-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.ad-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(26, 58, 107, 0.15);
}

.ad-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--border);
    flex-shrink: 0;
}

.ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ad-card:hover .ad-image {
    transform: scale(1.04);
}

/* Badges */
.ad-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    z-index: 1;
}

.badge-yeni {
    background: var(--accent);
    color: #1a202c;
}

.badge-acil {
    background: var(--error);
    color: white;
}

.badge-kiralik {
    background: #0891b2;
    color: white;
}

.badge-satilik {
    background: var(--primary);
    color: white;
}

.badge-indirim {
    background: #7c3aed;
    color: white;
}

/* Card content */
.ad-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ad-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
}

.ad-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.ad-price .price-suffix {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.ad-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 0.5rem;
    flex-wrap: wrap;
}

.ad-location {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ad-location::before {
    content: '📍';
    font-size: 0.75rem;
}

.ad-date {
    margin-left: auto;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.ad-category-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(26, 58, 107, 0.08);
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 600;
    border-radius: 999px;
}

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════════════════ */
body.auth-page {
    background: var(--bg);
    min-height: 100vh;
}

.auth-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.auth-header-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.auth-header-logo span {
    color: var(--accent);
}

.auth-wrapper {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    max-width: 900px;
    width: 100%;
    padding: 0 1rem;
}

.auth-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    animation: fadeInUp 0.35s ease;
}

.auth-left {
    padding: 2.5rem;
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.4rem;
    letter-spacing: -0.4px;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: var(--transition);
}

.auth-input::placeholder {
    color: #a0aec0;
}

.auth-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(39, 86, 168, 0.12);
}

.auth-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-error-msg {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.15rem;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    gap: 0.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
}

.remember-me input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
}

.forgot-pass {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.forgot-pass:hover {
    text-decoration: underline;
}

.auth-submit-btn {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.02em;
}

.auth-submit-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(26, 58, 107, 0.3);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-divider {
    width: 1px;
    background: var(--border);
    margin: 2rem 0;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-divider::before {
    content: 'veya';
    position: absolute;
    background: var(--surface);
    padding: 0.5rem 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    writing-mode: vertical-lr;
    text-orientation: mixed;
}

.auth-right {
    padding: 2.5rem;
    background: var(--surface-alt);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.social-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 500;
}

.social-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    color: var(--text);
    justify-content: center;
}

.social-btn:hover {
    background: var(--surface-alt);
    border-color: var(--primary);
    color: var(--primary);
}

.social-btn svg,
.social-btn img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.auth-signup-link {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.auth-signup-link a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.auth-signup-link a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   DETAIL PAGE
═══════════════════════════════════════════════════════════════ */
.detail-page-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
    overflow-x: hidden;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.83rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--text);
}

.breadcrumb-sep {
    color: var(--border);
    font-size: 0.75rem;
}

.detail-header-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.3;
    letter-spacing: -0.3px;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Detail layout */
.detail-container {
    display: grid;
    grid-template-columns: 1fr 300px 280px;
    gap: 1.5rem;
    align-items: start;
}

/* Grid çocukları min-width:0 ile taşmasın */
.detail-container > * {
    min-width: 0;
}

.detail-main-left {
    min-width: 0;
}

.detail-middle-col {
    min-width: 0;
}

.detail-right-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* iframe taşmasın */
.detail-page-wrapper iframe {
    max-width: 100%;
    width: 100%;
}

/* Gallery */
.detail-gallery {
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-width: 100%;
}

.detail-gallery-main {
    position: relative;
    height: 420px;
    overflow: hidden;
    background: var(--border);
}

.detail-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.expand-icon {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    font-weight: 500;
}

.expand-icon:hover {
    background: rgba(0, 0, 0, 0.7);
}

.detail-gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 8px;
    overflow-x: auto;
    background: var(--surface);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.detail-gallery-thumbs::-webkit-scrollbar {
    height: 4px;
}

.detail-gallery-thumbs::-webkit-scrollbar-track {
    background: transparent;
}

.detail-gallery-thumbs::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.detail-gallery-thumbs img {
    width: 80px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    border: 2px solid transparent;
    transition: var(--transition);
    flex-shrink: 0;
}

.detail-gallery-thumbs img:hover {
    opacity: 0.9;
}

.detail-gallery-thumbs img.active {
    opacity: 1;
    border-color: var(--primary);
}

/* Tabs */
.detail-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-top: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.detail-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    padding: 1.5rem 0;
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.25s ease;
}

.detail-description-content p {
    line-height: 1.8;
    color: #374151;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.detail-description-content p:last-child {
    margin-bottom: 0;
}

/* Equipment grid */
.equipment-grid {
    margin-top: 1.5rem;
}

.equipment-grid h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem;
}

.equipment-grid h4:first-child {
    margin-top: 0;
}

.equipment-grid span {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.83rem;
    margin: 3px;
    color: var(--text);
    transition: var(--transition);
}

.equipment-grid span:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(26, 58, 107, 0.05);
}

/* Price box */
.detail-price-box {
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.detail-price-label {
    font-size: 0.78rem;
    opacity: 0.75;
    font-weight: 500;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-price-main {
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.detail-price-sub {
    font-size: 0.82rem;
    opacity: 0.7;
    margin-top: 0.3rem;
}

/* Spec table */
.detail-spec-table {
    list-style: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.detail-spec-table li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    gap: 1rem;
}

.detail-spec-table li:last-child {
    border-bottom: none;
}

.detail-spec-table li:nth-child(odd) {
    background: var(--surface-alt);
}

.spec-label {
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.spec-value {
    color: var(--text);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
    min-width: 0;
}

.spec-value.highlight {
    color: var(--primary);
    font-weight: 700;
}

/* Seller card */
.seller-profile-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.seller-name-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.seller-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.seller-info {
    flex: 1;
    min-width: 0;
}

.seller-name {
    font-weight: 700;
    color: var(--text);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seller-stat {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.seller-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
}

.seller-phone-btn {
    width: 100%;
    background: var(--accent);
    color: #1a202c;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.seller-phone-btn:hover {
    background: var(--accent-hover);
}

.seller-msg-btn {
    width: 100%;
    background: var(--surface);
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.seller-msg-btn:hover {
    background: var(--primary);
    color: white;
}

/* Trust card */
.trust-card {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-size: 0.83rem;
    color: #92400e;
    line-height: 1.6;
}

.trust-card strong {
    display: block;
    margin-bottom: 0.3rem;
    color: #78350f;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════ */
.footer {
    background: var(--primary);
    color: white;
    padding: 3rem 1.5rem 1.5rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 2.5rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
}

.footer-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.3px;
}

.footer-logo span {
    color: var(--accent);
}

.footer-desc {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.75rem;
    line-height: 1.7;
    max-width: 300px;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.footer-social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.85rem;
}

.footer-social-link:hover {
    background: var(--accent);
    color: #1a202c;
}

.footer-col h4 {
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: white;
    letter-spacing: 0.02em;
}

.footer-col a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.83rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY / BUTTONS
═══════════════════════════════════════════════════════════════ */
.post-ad-btn,
.btn-primary {
    background: var(--accent);
    color: #1a202c;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}

.post-ad-btn:hover,
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

/* ─── Misc helpers ───────────────────────────────────────────── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-primary  { color: var(--primary); }
.text-accent   { color: var(--accent); }
.text-muted    { color: var(--text-muted); }
.text-success  { color: var(--success); }
.text-error    { color: var(--error); }
.font-bold      { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-center   { text-align: center; }

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

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--surface-alt) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
═══════════════════════════════════════════════════════════════ */

/* ─── 1100px: detail page 2-col ─────────────────────────────── */
@media (max-width: 1100px) {
    .detail-container {
        grid-template-columns: 1fr 300px;
    }

    .detail-right-col {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

/* ─── 900px: sidebar collapse ────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 64px;
        bottom: 0;
        z-index: 800;
        width: 260px;
        border-radius: 0;
        border: none;
        border-right: 1px solid var(--border);
        box-shadow: var(--shadow-hover);
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay-btn {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.9rem;
        background: var(--surface);
        border: 1.5px solid var(--border);
        border-radius: var(--radius-sm);
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-muted);
        cursor: pointer;
        transition: var(--transition);
        margin-bottom: 1rem;
    }

    .sidebar-overlay-btn:hover {
        color: var(--primary);
        border-color: var(--primary);
    }
}

/* ─── 768px: mobile header + auth single column ─────────────── */
@media (max-width: 768px) {
    .header-actions {
        display: none;
    }

    .header-icon-btn {
        display: flex;
    }

    .hamburger-btn {
        display: flex;
    }

    .header-inner {
        height: 56px;
        gap: 0.75rem;
        overflow: visible;
    }

    .header-logo {
        font-size: 1rem;
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-header {
        height: auto;
        overflow: visible;
    }

    .header-search {
        display: none;
    }

    .header-search.mobile-visible {
        display: block;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        padding: 0.75rem 1rem;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        z-index: 850;
    }

    .header-search.mobile-visible .search-form {
        max-width: 100%;
        width: 100%;
    }

    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-divider {
        width: auto;
        height: 1px;
        margin: 0 2rem;
        flex-direction: row;
    }

    .auth-divider::before {
        writing-mode: horizontal-tb;
        padding: 0 0.5rem;
    }

    .auth-right {
        background: var(--surface);
        border-top: 1px solid var(--border);
    }

    .detail-container {
        grid-template-columns: 1fr;
    }

    .detail-right-col {
        grid-column: 1;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .detail-page-wrapper {
        padding: 1rem;
    }

    .detail-header-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .detail-gallery-main {
        height: 260px;
    }

    .detail-spec-table li {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .spec-value {
        text-align: left;
    }


    .footer-container {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* ─── 640px: showcase grid ───────────────────────────────────── */
@media (max-width: 640px) {
    .main-container {
        padding: 1rem;
    }

    .showcase-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-gallery-main {
        height: 280px;
    }

    .detail-header-title {
        font-size: 1.2rem;
    }
}

/* ─── 480px: single column ───────────────────────────────────── */
@media (max-width: 480px) {
    .header-logo {
        font-size: 0.9rem;
    }

    .header-inner {
        padding: 0 1rem;
    }

    .showcase-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .auth-left,
    .auth-right {
        padding: 1.5rem;
    }

    .auth-title {
        font-size: 1.3rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }

    .detail-price-main {
        font-size: 1.4rem;
    }

    .detail-gallery-main {
        height: 220px;
    }

    .detail-page-wrapper {
        padding: 0.75rem;
    }

    .equipment-grid span {
        font-size: 0.78rem;
        padding: 3px 8px;
    }
}

/* ═══════════════════════════════════════════════════════════
   COMPATIBILITY ALIASES — detail/auth pages use these names
   ═══════════════════════════════════════════════════════════ */

/* Header aliases */
.header { background: #fff; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.header-container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; height: 64px; display: flex; align-items: center; gap: 1rem; }
.logo { font-weight: 800; font-size: 1.2rem; color: var(--primary); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.logo span { color: var(--accent); margin-left: 4px; }
.search-container { flex: 1; max-width: 520px; position: relative; }
.search-container .search-input { width: 100%; padding: 0.6rem 3rem 0.6rem 1.1rem; border: 1.5px solid var(--border); border-radius: 50px; font-size: 0.9rem; background: var(--bg); outline: none; transition: var(--transition); font-family: inherit; }
.search-container .search-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(26,58,107,0.1); }
.search-icon { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: var(--text-muted); pointer-events: none; }

/* Auth header aliases */
.auth-header .header-container { justify-content: center; }

/* Detail page utilities */
.detail-price-location { font-size: 0.85rem; color: rgba(255,255,255,0.8); margin-top: 0.35rem; font-weight: 500; }
.detail-price-location a { color: rgba(255,255,255,0.9); text-decoration: underline; }
.detail-price-location a:hover { color: #fff; }

.action-link { display: flex; align-items: center; gap: 8px; padding: 0.65rem 0.9rem; font-size: 0.9rem; font-weight: 600; color: var(--text); text-decoration: none; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; transition: var(--transition); margin-top: 0.5rem; }
.action-link:hover { border-color: var(--primary); color: var(--primary); background: rgba(26,58,107,0.04); }

/* Footer contact */
.footer-contact { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.75rem; font-size: 0.85rem; color: rgba(255,255,255,0.75); }
.footer-contact span { display: flex; align-items: center; gap: 0.45rem; }
.footer-contact svg { flex-shrink: 0; opacity: 0.8; }

/* Filter sidebar (vitrin page) */
.sidebar-filters { padding: 1rem 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.filter-group { margin-bottom: 1rem; }
.filter-group label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--primary); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.04em; }
.filter-select, .filter-input { width: 100%; padding: 0.55rem 0.8rem; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.875rem; background: #fff; outline: none; font-family: inherit; color: var(--text); }
.filter-select:focus, .filter-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,107,0.1); }
.filter-price-range { display: flex; gap: 0.5rem; align-items: center; }
.filter-price-range span { color: var(--text-muted); font-size: 0.85rem; }
.filter-price-range .filter-input { width: calc(50% - 0.75rem); }
/* ═══════════════════════════════════════════════════════════
   USER DROPDOWN MENU (injected by auth.js)
   ═══════════════════════════════════════════════════════════ */

.user-menu { position: relative; }

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    transition: var(--transition);
    white-space: nowrap;
}

.user-menu-trigger:hover {
    border-color: var(--primary);
    background: rgba(26,58,107,0.04);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-display-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.user-menu-caret { color: var(--text-muted); flex-shrink: 0; transition: transform 0.2s; }
.user-menu-trigger[aria-expanded="true"] .user-menu-caret { transform: rotate(180deg); }

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    z-index: 500;
    overflow: hidden;
    animation: dropdownIn 0.18s ease;
}

.user-dropdown.open { display: block; }

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: var(--surface-alt, #f8fafc);
}

.user-dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-dropdown-name  { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.user-dropdown-email { font-size: 0.78rem; color: var(--text-muted); }
.user-dropdown-divider { height: 1px; background: var(--border); }

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    text-align: left;
}

.user-dropdown-item:hover { background: var(--bg); color: var(--primary); }
.user-dropdown-item svg   { color: var(--text-muted); flex-shrink: 0; }
.user-dropdown-item:hover svg { color: var(--primary); }

.user-dropdown-logout:hover { background: #fff5f5; color: #dc2626; }
.user-dropdown-logout:hover svg { color: #dc2626; }
