:root {
    /* Amasya logosu renk tonları */
    --red: #d64550;
    --red-dark: #b8323d;
    --green: #5aa832;
    --green-dark: #3f8f2f;
    --green-light: #7cb342;

    --bg: #f4f6f2;
    --card: #ffffff;
    --text: #242a24;
    --muted: #737d72;
    --border: #e4e9e2;
    --shadow: 0 2px 10px rgba(0,0,0,.06);
    --radius: 12px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
.container { max-width: 1150px; margin: 0 auto; padding: 0 16px; }
a { color: var(--red-dark); }

/* ---------- Header ---------- */
.site-header {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: #fff;
    box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-logo { height: 52px; width: auto; background: #fff; border-radius: 50%; padding: 3px; }
.brand-text { font-size: 1.25rem; font-weight: 700; }
.header-nav { display: flex; gap: 6px; }
.header-nav a { color: #fff; text-decoration: none; opacity: .9; font-weight: 500; padding: 6px 14px; border-radius: 999px; }
.header-nav a:hover { opacity: 1; }
.header-nav a.active { background: rgba(255,255,255,.18); opacity: 1; }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* ---------- İletişim ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; margin-bottom: 30px; }
.contact-cards { display: flex; flex-direction: column; gap: 14px; }
.contact-card { display: flex; gap: 14px; align-items: flex-start; background: var(--card);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.contact-card .c-icon { font-size: 1.5rem; flex: none; }
.contact-card strong { display: block; margin-bottom: 2px; color: var(--red-dark); }
.contact-card p { margin: 0; color: var(--text); }
.contact-card a { color: var(--green-dark); text-decoration: none; font-weight: 600; }
.contact-map { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-height: 340px; }
.contact-map iframe { display: block; width: 100%; height: 100%; }

/* ---------- Page head + filters ---------- */
.page-head { margin: 24px 0 12px; }
.page-head h1 { margin: 0 0 4px; font-size: 1.7rem; color: var(--red-dark); }
.muted { color: var(--muted); font-size: .92rem; }
.hint { color: var(--muted); font-style: italic; font-size: .85rem; }

.filter-bar {
    display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap;
    background: var(--card); padding: 16px; border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 18px;
}
.filter-bar .field { display: flex; flex-direction: column; gap: 5px; }
.filter-bar label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.filter-bar input, .filter-bar select {
    padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: .95rem; background: #fff; min-width: 170px;
}
.btn {
    display: inline-block; cursor: pointer; border: none;
    background: var(--green); color: #fff; padding: 10px 22px;
    border-radius: 8px; font-size: .95rem; text-decoration: none; font-weight: 600;
}
.btn:hover { background: var(--green-dark); }
.btn-secondary { background: #e2e8e2; color: var(--text); }
.btn-danger { background: var(--red); }
.btn-sm { padding: 5px 12px; font-size: .85rem; }

/* ---------- Info box ---------- */
.info-box {
    display: flex; gap: 14px; align-items: flex-start;
    background: #fff8ec; border: 1px solid #f4dfb8; border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 20px;
}
.info-icon {
    flex: none; width: 26px; height: 26px; border-radius: 50%;
    background: var(--red); color: #fff; display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-style: italic;
}
.info-box strong { display: block; margin-bottom: 2px; }
.info-box p { margin: 0; font-size: .9rem; color: var(--muted); }

/* ---------- Price table ---------- */
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.price-table { width: 100%; border-collapse: collapse; }
.price-table th, .price-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.price-table thead th {
    background: var(--green); color: #fff; font-size: .8rem; text-transform: uppercase;
    letter-spacing: .03em; text-align: left; font-weight: 600;
}
.price-table tbody tr:hover { background: #f7faf5; }
.price-table .text-center { text-align: center; }
.thumb-cell { width: 56px; }
.thumb-cell img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; display: block; }
.thumb-emoji { font-size: 1.9rem; }
.thumb-emoji.big { font-size: 5rem; }
.name-cell { font-weight: 600; }
.price { font-weight: 700; color: var(--green-dark); white-space: nowrap; }

.badge { display: inline-block; font-size: .72rem; padding: 3px 9px; border-radius: 999px; color: #fff; font-weight: 600; }
.badge-sebze { background: var(--green); }
.badge-meyve { background: var(--red); }
.badge-ithal { background: #8e5cc0; }
.badge-balik { background: #2b8fb3; }

.trend { font-size: 1rem; font-weight: 700; }
.trend.up { color: var(--red); }
.trend.down { color: var(--green); }
.trend.same { color: var(--muted); }
.trend.new { color: var(--green-light); }

.chart-link {
    display: inline-block; font-size: .82rem; font-weight: 600; text-decoration: none;
    color: var(--red-dark); border: 1px solid var(--border); padding: 4px 12px; border-radius: 999px;
}
.chart-link:hover { background: var(--red); color: #fff; border-color: var(--red); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- Product detail + charts ---------- */
.back-link { display: inline-block; margin: 18px 0 8px; text-decoration: none; font-weight: 600; }
.product-hero {
    display: flex; gap: 20px; align-items: center; background: var(--card);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 22px;
}
.product-hero-img { flex: none; width: 120px; height: 120px; border-radius: 12px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; background: #eef2ee; }
.product-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.product-hero-info h1 { margin: 0 0 8px; color: var(--red-dark); }
.current-price { font-size: 1.5rem; font-weight: 800; color: var(--green-dark); margin: 10px 0 0; }
.current-price small { color: var(--muted); font-weight: 400; font-size: .85rem; }

.chart-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.chart-card h2 { margin: 0 0 14px; font-size: 1.15rem; color: var(--text); }
.chart-card h2 small { color: var(--muted); font-weight: 400; font-size: .8rem; }

/* ---------- Footer ---------- */
.site-footer { padding: 26px 0; color: var(--muted); font-size: .85rem; text-align: center; }

/* ---------- Admin ---------- */
.admin-body { background: var(--bg); }
.admin-nav { background: var(--red-dark); color: #fff; padding: 12px 0; }
.admin-nav .container { display: flex; align-items: center; justify-content: space-between; }
.admin-nav a { color: #fff; text-decoration: none; margin-left: 16px; opacity: .9; }
.admin-nav a:hover { opacity: 1; }
.admin-brand { font-weight: 700; display: inline-flex; align-items: center; gap: 10px; }
.admin-logo { height: 34px; width: auto; background: #fff; border-radius: 50%; padding: 2px; }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 24px 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: .8rem; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
td img.mini { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; }

.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: .9rem; margin-bottom: 5px; font-weight: 600; }
.form-row input, .form-row select {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border);
    border-radius: 8px; font-size: .95rem; background: #fff;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.actions { display: flex; gap: 10px; margin-top: 20px; }

.login-wrap { max-width: 360px; margin: 8vh auto; }
.login-wrap h1 { text-align: center; color: var(--red-dark); }

.flash { padding: 11px 15px; border-radius: 8px; margin: 14px 0; font-size: .92rem; }
.flash.success { background: #e6f4ea; color: var(--green-dark); }
.flash.error { background: #fdecea; color: #b71c1c; }

/* ---------- Admin responsive yardımcıları ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 900px) {
    .admin-nav .container { flex-direction: column; align-items: flex-start; gap: 8px; }
    .admin-nav a { margin-left: 0; margin-right: 16px; }
}

/* ---------- Genel mobil ---------- */
@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    .product-hero { flex-direction: column; text-align: center; }
    .product-hero-img { width: 140px; height: 140px; }
    .page-head h1 { font-size: 1.4rem; }
    .brand-text { font-size: 1.05rem; }
    .brand-logo { height: 42px; }

    /* Filtre çubuğu tam genişlik */
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .field { width: 100%; }
    .filter-bar input, .filter-bar select { min-width: 0; width: 100%; }
    .filter-bar .btn { width: 100%; }

    /* Fiyat tablosu -> kart görünümü */
    .table-wrap { background: transparent; box-shadow: none; }
    .price-table thead { display: none; }
    .price-table, .price-table tbody, .price-table tr, .price-table td { display: block; width: 100%; }
    .price-table tr {
        background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
        box-shadow: var(--shadow); margin-bottom: 14px; padding: 12px 14px;
    }
    .price-table td { border: none; padding: 6px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .price-table td::before {
        content: attr(data-label); font-weight: 600; color: var(--muted);
        font-size: .82rem; text-transform: uppercase; letter-spacing: .02em;
    }
    .price-table td.thumb-cell { justify-content: center; padding-bottom: 10px; }
    .price-table td.thumb-cell::before { display: none; }
    .price-table td.thumb-cell img { width: 96px; height: 96px; }
    .price-table td.thumb-emoji { justify-content: center; }
    .price-table td.name-cell { font-size: 1.15rem; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
    .price-table td.name-cell::before { display: none; }
    .price-table td.chart-cell { justify-content: center; padding-top: 10px; }
    .price-table td.chart-cell::before { display: none; }
    .chart-link { width: 100%; text-align: center; }

    /* Navbar mobil: aç/kapa */
    .header-inner { flex-wrap: wrap; }
    .nav-toggle { display: block; }
    .header-nav { display: none; flex-direction: column; width: 100%; gap: 4px; margin-top: 10px; }
    .header-nav.open { display: flex; }
    .header-nav a { padding: 10px 12px; }

    /* İletişim tek sütun */
    .contact-grid { grid-template-columns: 1fr; }
}
