/* ============================================================
   Wildmarkt – Stylesheet
   ============================================================ */

:root {
    --green: #2f4a34;
    --green-dark: #1e3024;
    --green-light: #4a6b52;
    --accent: #c8752f;
    --accent-dark: #a85f22;
    --cream: #f7f3ec;
    --card-bg: #ffffff;
    --text: #24302a;
    --text-muted: #6b7669;
    --border: #e2ddd0;
    --danger: #b3372c;
    --ok: #2f7d4f;
    --warn: #c8752f;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(30, 48, 36, 0.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--cream);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

a { color: inherit; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.6em; color: var(--green-dark); }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

.wm-icon { display: inline-block; vertical-align: -4px; }

/* ---------------------------------------------------------------
   Header
   --------------------------------------------------------------- */

.site-header {
    background: var(--green);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: var(--shadow);
}

.site-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.icon-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
}
.icon-link:hover { background: rgba(255,255,255,0.12); }

.badge-dot {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--green);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.nav-label { display: inline; }

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: none;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: #c9c2b3; cursor: not-allowed; }

.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.55); }
.btn-outline:hover { background: rgba(255,255,255,0.12); }

.btn-ghost { background: transparent; color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

.btn-secondary { background: #eee7d9; color: var(--green-dark); }
.btn-secondary:hover { background: #e2d8c2; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f2b22; }

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
}
.icon-btn:hover { background: var(--cream); }
.icon-btn.danger { color: var(--danger); border-color: #eccac5; }

/* ---------------------------------------------------------------
   Layout containers
   --------------------------------------------------------------- */

.site-main { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

.site-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 2rem 1.25rem 2.5rem;
}

/* ---------------------------------------------------------------
   Hero + Suche
   --------------------------------------------------------------- */

.hero {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    margin-bottom: 1.75rem;
}
.hero h1 { color: #fff; margin-bottom: 0.4rem; }
.hero p { color: rgba(255,255,255,0.85); max-width: 46em; }

.search-form {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.3rem;
    max-width: 480px;
    flex-wrap: wrap;
}
.search-form input[type="text"] {
    flex: 1;
    min-width: 180px;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    border: none;
    font-size: 0.95rem;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0 1.5rem;
}
.chip {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}
.chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.chip:hover:not(.active) { border-color: var(--green-light); }

/* ---------------------------------------------------------------
   Angebots-Grid & Karten
   --------------------------------------------------------------- */

.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.15rem;
}

.listing-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.listing-card-image {
    aspect-ratio: 4 / 3;
    background: #e9e4d6 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23b7ae98" stroke-width="1.4"><circle cx="12" cy="12" r="9"/></svg>') center/40% no-repeat;
    background-size: cover;
    background-position: center;
    position: relative;
}

.listing-card-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
}
.badge-verfuegbar { background: var(--ok); }
.badge-angefragt { background: var(--warn); }
.badge-reserviert { background: var(--warn); }
.badge-nicht-verfuegbar { background: #8a8378; }

.fav-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
}
.fav-btn.active { color: var(--danger); }
.fav-btn svg { fill: none; stroke: currentColor; }
.fav-btn.active svg { fill: currentColor; }

.listing-card-body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.listing-card-title { font-weight: 700; font-size: 1.02rem; color: var(--green-dark); }
.listing-card-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; }
.listing-card-seller { font-size: 0.8rem; color: var(--text-muted); }
.listing-card-price { font-weight: 700; color: var(--accent-dark); font-size: 1.05rem; margin-top: 0.2rem; }
.listing-card-weight { font-size: 0.82rem; color: var(--text-muted); }
.listing-card-footer { margin-top: 0.7rem; }

.new-listing-tile {
    border: 2px dashed var(--green-light);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    text-decoration: none;
    color: var(--green);
    gap: 0.5rem;
    font-weight: 700;
}
.new-listing-tile:hover { background: rgba(74,107,82,0.06); }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
}

/* ---------------------------------------------------------------
   Formulare
   --------------------------------------------------------------- */

.form-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    max-width: 520px;
}

.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.92rem; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="file"], select, textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--green-light);
}

.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; font-weight: 500; }

.form-actions { display: flex; gap: 0.6rem; margin-top: 1.4rem; }

.alert {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.1rem;
    font-size: 0.92rem;
}
.alert-error { background: #fbe9e7; color: var(--danger); border: 1px solid #f3c9c2; }
.alert-success { background: #e6f3ea; color: var(--ok); border: 1px solid #bfe2cb; }
.alert-info { background: #eef2ec; color: var(--green-dark); border: 1px solid #d6ddd0; }

/* ---------------------------------------------------------------
   Reservierungs-Dialog
   --------------------------------------------------------------- */

dialog.reserve-dialog {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    width: min(440px, 92vw);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
dialog.reserve-dialog::backdrop { background: rgba(20, 28, 22, 0.55); }
.dialog-inner { padding: 1.6rem; }
.dialog-close { position: absolute; top: 0.9rem; right: 1rem; background: none; border: none; cursor: pointer; color: var(--text-muted); }
.reserve-summary {
    background: var(--cream);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}
.reserve-summary strong { display: block; font-size: 1rem; margin-bottom: 0.25rem; color: var(--green-dark); }

/* ---------------------------------------------------------------
   Dashboard
   --------------------------------------------------------------- */

.dash-section { margin-bottom: 2.2rem; }
.dash-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }

.request-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.request-info strong { display: block; color: var(--green-dark); }
.request-meta { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.15rem; }
.request-contact { font-size: 0.85rem; margin-top: 0.4rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.request-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.status-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: var(--warn);
}

.mine-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.mine-table th, .mine-table td {
    padding: 0.75rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.mine-table th { background: var(--cream); color: var(--green-dark); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; }
.mine-table tr:last-child td { border-bottom: none; }
.mine-table .row-actions { display: flex; gap: 0.4rem; }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */

@media (max-width: 640px) {
    .nav-label { display: none; }
    .hero { padding: 1.75rem 1.25rem; }
    .site-header-inner { padding: 0.7rem 1rem; }
    .form-card { padding: 1.25rem; }
    .request-card { flex-direction: column; align-items: flex-start; }
    .mine-table { display: block; overflow-x: auto; white-space: nowrap; }
}
