@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Outfit:wght@600;700&display=swap');

:root {
    --ink: #102a36;
    --muted: #5c717d;
    --line: #d9e4e8;
    --surface: #ffffff;
    --canvas: #f4f8f7;
    --teal: #006d77;
    --teal-dark: #00525a;
    --sun: #ffbd30;
    --sun-dark: #e9a70b;
    --coral: #e95f4d;
    --shadow: 0 8px 24px rgba(16, 42, 54, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: "DM Sans", Arial, sans-serif;
    line-height: 1.5;
}

button, input, select { font: inherit; }

a { color: inherit; }

.skip-link {
    position: absolute;
    left: 16px;
    top: -48px;
    z-index: 10;
    padding: 10px 14px;
    color: var(--ink);
    background: var(--sun);
    border-radius: 6px;
}

.skip-link:focus { top: 16px; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid rgba(16, 42, 54, 0.1);
    background: rgba(255, 255, 255, 0.96);
}

.header-inner, .container, .footer-inner {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
}

.header-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-family: Outfit, Arial, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    text-decoration: none;
}

.brand-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: var(--sun);
    border-radius: 7px;
    font-size: 0.88rem;
    letter-spacing: 0;
}
.brand-logo { width: 148px; height: auto; display: block; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.system-banner { padding: 12px 20px; color: #513a00; background: #fff3c9; border-bottom: 1px solid #e9c857; text-align: center; font-weight: 600; }
.offline-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.offline-page .detail-notice { max-width: 620px; margin: 14px auto; }

.button, .icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.button:hover, .icon-button:hover { transform: translateY(-1px); }
.button:focus-visible, .icon-button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(0, 109, 119, 0.3); outline-offset: 2px; }

.button-primary { padding: 10px 16px; color: var(--ink); background: var(--sun); box-shadow: 0 3px 0 var(--sun-dark); }
.button-primary:hover { background: #ffc94c; }
.button-secondary { padding: 10px 16px; color: #fff; background: var(--teal); }
.button-secondary:hover { background: var(--teal-dark); }
.button-telegram { padding: 10px 16px; color: var(--ink); background: #fff; }
.button[hidden] { display: none; }

.hero { padding: 58px 0 46px; background: var(--teal); color: #fff; }
.hero-content { max-width: 720px; }
.eyebrow { margin: 0 0 12px; color: #ffe19a; font-size: 0.82rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Outfit, Arial, sans-serif; letter-spacing: 0; }
h1 { max-width: 760px; margin-bottom: 14px; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.05; }
.hero-copy { max-width: 620px; margin-bottom: 26px; color: #d4f1ed; font-size: 1.08rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.content { padding: 34px 0 56px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 1.55rem; }
.offer-count { margin: 0; color: var(--muted); font-size: 0.92rem; }

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(150px, 1fr));
    gap: 12px;
    padding: 16px;
    margin-bottom: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(16, 42, 54, 0.04);
}

.field { display: grid; gap: 6px; }
.field label { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.field input, .field select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #b9c9cf;
    border-radius: 6px;
}

.offer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.offer-card {
    min-width: 0;
    min-height: 360px;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.offer-media { width: 100%; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; background: #e7f4f1; }
.offer-media img { width: 100%; height: 100%; display: block; object-fit: contain; background: #fff; }
.image-fallback { color: var(--teal-dark); font-family: Outfit, Arial, sans-serif; font-size: 1rem; font-weight: 700; }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 18px 13px; }
.marketplace { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.marketplace::before { width: 18px; height: 18px; display: grid; place-items: center; content: "ML"; color: var(--ink); background: var(--sun); border-radius: 50%; font-size: 0.58rem; }
.tag { max-width: 58%; overflow: hidden; padding: 3px 7px; color: var(--teal-dark); background: #dff3f0; border-radius: 4px; font-size: 0.72rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.offer-card h3 { margin: 0 18px 12px; font-size: 1.05rem; line-height: 1.3; }
.updated { margin: 0 18px 15px; color: var(--muted); font-size: 0.78rem; }
.price-label { margin: auto 18px 2px; color: var(--muted); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; }
.price { margin: 0 18px 15px; color: var(--teal-dark); font-family: Outfit, Arial, sans-serif; font-size: 1.65rem; font-weight: 700; line-height: 1.1; }
.price-history { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: -4px 18px 15px; color: var(--muted); font-size: 0.76rem; }
.price-history strong { color: var(--ink); font-size: 0.82rem; }
.variation-down { color: #087443; font-weight: 700; }
.variation-up { color: #b53d31; font-weight: 700; }
.variation-stable { color: var(--muted); font-weight: 700; }
.record-badge { display: inline-flex; width: fit-content; margin: -3px 18px 12px; padding: 4px 7px; color: #075a43; background: #dff3e8; border-radius: 4px; font-size: 0.72rem; font-weight: 700; }
.offer-card .button { width: calc(100% - 36px); margin: 0 18px 18px; }
.details-link { margin: -8px 18px 16px; color: var(--teal-dark); font-size: 0.86rem; font-weight: 700; text-align: center; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 52px; margin-top: 28px; }
.pagination button:disabled { cursor: not-allowed; opacity: 0.45; transform: none; }
.page-indicator { min-width: 112px; text-align: center; color: var(--muted); font-size: 0.9rem; font-weight: 700; }

.detail-page { padding: 34px 0 56px; }
.breadcrumb { display: inline-block; margin-bottom: 22px; color: var(--teal-dark); font-weight: 700; text-decoration: none; }
.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr); gap: 34px; align-items: start; }
.product-image { aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; background: #e7f4f1; border-radius: 8px; }
.product-image img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.product-info h1 { margin-bottom: 14px; font-size: 2rem; line-height: 1.12; }
.product-category { display: inline-flex; margin-bottom: 16px; padding: 4px 8px; color: var(--teal-dark); background: #dff3f0; border-radius: 4px; font-size: 0.8rem; font-weight: 700; }
.product-price { margin-bottom: 18px; color: var(--teal-dark); font-family: Outfit, Arial, sans-serif; font-size: 2.25rem; font-weight: 700; }
.detail-updated { color: var(--muted); font-size: 0.85rem; }
.price-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.price-summary div { padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.price-summary span { display: block; color: var(--muted); font-size: 0.74rem; font-weight: 700; }
.price-summary strong { display: block; margin-top: 4px; font-size: 0.96rem; }
.detail-notice { color: var(--muted); font-size: 0.84rem; }
.history-section { margin-top: 42px; }
.history-section h2 { margin-bottom: 12px; font-size: 1.35rem; }
.history-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
.history-table th, .history-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.history-table th { color: var(--muted); font-size: 0.78rem; }
.history-table tr:last-child td { border-bottom: 0; }

.feedback {
    grid-column: 1 / -1;
    padding: 34px 24px;
    text-align: center;
    background: var(--surface);
    border: 1px dashed #a9bec5;
    border-radius: 8px;
}
.feedback h3 { margin-bottom: 6px; font-size: 1.1rem; }
.feedback p { max-width: 480px; margin: 0 auto; color: var(--muted); }

.disclosure { padding: 28px 0; background: #e7f4f1; }
.disclosure-inner { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.disclosure-badge { width: 42px; height: 42px; display: grid; place-items: center; color: var(--teal-dark); background: #fff; border-radius: 8px; font-weight: 700; }
.disclosure h2 { margin-bottom: 4px; font-size: 1.1rem; }
.disclosure p { margin-bottom: 0; color: var(--muted); }

.site-footer { padding: 30px 0; color: #cfdfdc; background: var(--ink); }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.footer-brand { margin-bottom: 5px; color: #fff; font-family: Outfit, Arial, sans-serif; font-size: 1.1rem; font-weight: 700; }
.footer-note { max-width: 680px; margin: 0; font-size: 0.85rem; }
.footer-link { color: #fff; font-size: 0.9rem; font-weight: 700; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; max-width: 420px; }
.footer-updated { margin-top: 10px; font-size: 0.78rem; color: #9fb9b5; }

@media (max-width: 820px) {
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field:first-child { grid-column: 1 / -1; }
    .offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-detail { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .header-inner, .container, .footer-inner { width: min(100% - 28px, 1160px); }
    .header-inner { min-height: 62px; }
    .brand { font-size: 1.2rem; }
    .brand-logo { width: 132px; }
    .header-actions .button { width: 42px; min-width: 42px; padding: 0; font-size: 0; }
    .header-actions .button::after { content: "↻"; font-size: 1.25rem; }
    .hero { padding: 42px 0 36px; }
    h1 { font-size: 2.25rem; }
    .hero-actions .button { width: 100%; }
    .section-heading { display: block; }
    .offer-count { margin-top: 4px; }
    .filters, .offer-grid { grid-template-columns: 1fr; }
    .field:first-child { grid-column: auto; }
    .offer-card { min-height: 230px; }
    .price-summary { grid-template-columns: 1fr; }
    .footer-inner { display: block; }
    .footer-links { justify-content: flex-start; margin-top: 16px; }
}
