﻿/* =====================================================
     style.css
     Component and layout styles only.
     ===================================================== */

/* ---- Header ---- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header > .dashboard-header {
    max-width: 1400px;
    margin: 0 auto;
}

.header-inner {
    height: var(--header-h);
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo-icon { font-size: 22px; }

.logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .2px;
}

.header-search {
    position: relative;
    flex: 1;
    max-width: 560px;
}

.header-search input {
    width: 100%;
    height: 40px;
    padding: 0 40px 0 40px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--text);
    outline: none;
}

.btn-clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
}

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

.chat-bell-wrap {
    position: relative;
}

.chat-bell-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.chat-unread-badge {
    position: absolute;
    right: -4px;
    top: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 0 5px;
    display: grid;
    place-items: center;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

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

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 230px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 120;
    padding: 8px;
}

.dropdown-user-info {
    display: grid;
    gap: 2px;
    padding: 8px;
}

.dropdown-user-info strong {
    font-size: 13px;
    color: var(--text);
}
.dropdown-user-info span   { font-size: 12px; color: var(--text-muted); }

.dropdown-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 6px 0;
}

.dropdown-item {
    width: 100%;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    color: var(--text);
    font-size: 13px;
}

/* ---- Filter Bar ---- */
.filter-bar {
    position: fixed;
    top: calc(var(--header-h) + var(--dashboard-h) - 14px);
    left: 0;
    right: 0;
    height: var(--filter-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 90;
}

.filter-inner {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

@media (min-width: 769px) {
    .filter-bar {
        top: calc(var(--header-h) + var(--dashboard-h) + 1px);
    }

    .filter-inner {
        height: calc(var(--filter-h) - 1px);
    }
}

.filter-btn {
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

.filter-btn.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 72%;
    overflow: hidden;
    background: var(--bg);
    border-bottom: 1px solid rgba(15, 23, 42, .16);
    box-shadow: 0 10px 14px -12px rgba(15, 23, 42, .5);
}

.card-img-wrap img {
    position: absolute;
    inset: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    object-fit: contain;
    background: #f8fafc;
    cursor: zoom-in;
}

.card-image-gallery {
    position: absolute;
    inset: 0;
}

.card-image-gallery .main-image {
    position: absolute;
    inset: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    object-fit: contain;
    background: #f8fafc;
    cursor: zoom-in;
}

.gallery-thumbnails {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(15, 23, 42, .72);
    overflow-x: auto;
}

.gallery-thumbnails .thumbnail {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, .28);
    opacity: .92;
    flex-shrink: 0;
}

.card-img-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text-light);
    text-align: center;
    gap: 4px;
}

.card-img-placeholder span { font-size: 32px; }
.card-img-placeholder small { font-size: 12px; }

.badge-condition {
    position: absolute;
    left: 10px;
    top: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .35px;
}

.badge-neu        { background: #dcfce7; color: #166534; }
.badge-wie-neu    { background: #d1fae5; color: #065f46; }
.badge-gut        { background: #dbeafe; color: #1e40af; }
.badge-akzeptabel { background: #fef3c7; color: #92400e; }

.card-image-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
}

.card-owner-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
}

.card-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    backdrop-filter: blur(5px);
}

.btn-edit { background: rgba(37, 99, 235, .82); }
.btn-del  { background: rgba(239, 68, 68, .85); }

.btn-sold-toggle {
    width: auto;
    min-width: 86px;
    height: 32px;
    border-radius: 999px;
    padding: 0 10px;
    background: rgba(15, 23, 42, .82);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
}

.btn-sold-toggle.is-sold {
    background: rgba(34, 197, 94, .92);
    color: #052e16;
}

.card-sold-ribbon {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 170%;
    text-align: center;
    transform: translate(-50%, -50%) rotate(-26deg);
    background: rgba(239, 68, 68, .96);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    padding: 7px 0;
    box-shadow: 0 6px 14px rgba(127, 29, 29, .35);
    pointer-events: none;
    z-index: 2;
}

.card-body {
    padding: 14px;
    display: grid;
    gap: 8px;
}

.card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card-category {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.card-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    flex: 1;
}

.card-info-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.card-info-btn:hover {
    color: var(--primary, #3b82f6);
    background: color-mix(in srgb, var(--primary, #3b82f6) 12%, transparent);
}

.card-info-btn.active {
    color: #ef4444;
    background: color-mix(in srgb, #ef4444 12%, transparent);
}



/* ---- Email verification banner ---- */
.verification-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #92400e;
    flex-wrap: wrap;
}

.verification-banner.hidden { display: none; }

.resend-btn {
    margin-left: auto;
    padding: 6px 14px;
    border: 1.5px solid #d97706;
    background: transparent;
    color: #d97706;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.resend-btn:hover:not(:disabled) { background: #d97706; color: #fff; }
.resend-btn:disabled { opacity: 0.5; cursor: default; }

/* ---- */

.card-wear-notes {
    font-size: 12px;
    color: #7c2d12;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 6px 8px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.card-handover {
    font-size: 12px;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 7px 10px;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.card-handover-status {
    font-weight: 700;
}

.card-handover-details {
    margin-top: 2px;
}

.card-handover.is-pickup {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.card-handover.is-delivery {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}

.card-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.card-price-free { color: var(--success); }

.card-footer {
    padding: 0 14px 14px;
    display: block;
}

.btn-contact-disabled {
    background: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
    pointer-events: none;
}

.card-seller {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 8px;
    row-gap: 4px;
    align-items: center;
}

.card-seller-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #334155;
    flex-shrink: 0;
    grid-column: 1;
    grid-row: 1 / span 2;
}

.card-seller-name {
    grid-column: 2;
    grid-row: 1;
    font-size: 12px;
    color: var(--text-muted);
    white-space: normal;
    overflow-wrap: anywhere;
}

.card-contact-actions {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-contact-actions .btn-contact,
.card-contact-actions .btn-chat {
    height: 30px;
}

.btn-chat {
    height: 30px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: #ecfeff;
    color: #155e75;
    border: 1px solid #a5f3fc;
}

/* Modal/forms/upload/zoom are split to components.css */
