/* ============================================
   Top Sobaka — светлый минимализм
   Сдержанная палитра, серифные заголовки,
   щедрые воздушные интервалы
   ============================================ */

:root {
    /* Палитра — тёплая, бумажная */
    --bg:         #faf9f6;
    --bg-2:       #ffffff;
    --bg-3:       #f1efe8;
    --bg-soft:    #f6f4ee;

    /* Границы */
    --border:     #e8e5dc;
    --border-2:   #d6d2c5;

    /* Текст */
    --text:       #16181a;
    --text-2:     #3a3d40;
    --text-mute:  #7a7873;

    /* Акцент — приглушённый зелёный, читаемый на белом */
    --accent:        #0fa056;
    --accent-2:      #0a8043;
    --accent-soft:   #e7f5ee;

    /* Прочее */
    --danger:     #c43c50;

    --radius:     6px;
    --radius-sm:  4px;
    --shadow-1:   0 1px 2px rgba(20,22,24,.04);
    --shadow-2:   0 8px 28px rgba(20,22,24,.07);
    --container:  1200px;

    --serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
    --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-feature-settings: "ss01", "cv01", "cv11";
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--text); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
    margin: 0 0 .6em;
    line-height: 1.15;
    font-weight: 500;
    letter-spacing: -.01em;
}
h1 { font-family: var(--serif); font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 500; letter-spacing: -.02em; }
h2 { font-family: var(--serif); font-size: clamp(1.6rem, 2.4vw, 2.2rem); font-weight: 500; letter-spacing: -.015em; }
h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.005em; }
h4 { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--text-mute); }

p { margin: 0 0 1em; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 28px;
}

.muted { color: var(--text-mute); }

/* ---------- Метка-капс ---------- */
.eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 18px;
}

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: var(--bg-3);
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    transition: all .18s ease;
    font-size: 14px;
    font-family: var(--sans);
    text-align: center;
    letter-spacing: .01em;
    line-height: 1;
}
.btn:hover { background: var(--bg-2); border-color: var(--border-2); color: var(--text); }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--text);
    color: #ffffff;
    border-color: var(--text);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn-accent {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--text); color: var(--text); }

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid #ebcfd4;
}
.btn-danger:hover { background: #fbf1f3; border-color: var(--danger); }

.btn-block { display: flex; width: 100%; }

/* ---------- Шапка ---------- */
.site-header {
    background: rgba(250,249,246,.88);
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 74px;
    gap: 28px;
}
.logo {
    display: flex;
    align-items: baseline;
    gap: 10px;
    color: var(--text);
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.45rem;
    letter-spacing: -.01em;
}
.logo:hover { color: var(--text); }
.logo-mark { font-family: var(--sans); font-size: 1.1rem; }
.logo-text { letter-spacing: 0; }

.main-nav {
    display: flex;
    gap: 32px;
    align-items: center;
}
.main-nav a {
    color: var(--text-2);
    font-weight: 400;
    font-size: 14px;
    padding: 6px 0;
    position: relative;
}
.main-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--text);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .22s ease;
}
.main-nav a:hover { color: var(--text); }
.main-nav a:hover::after { transform: scaleX(1); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-2);
    background: var(--bg-2);
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
    transition: all .18s ease;
}
.cart-link:hover { border-color: var(--text); color: var(--text); }
.cart-ico { font-size: 15px; }
.cart-count {
    background: var(--text);
    color: #ffffff;
    border-radius: 100px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    min-width: 22px;
    text-align: center;
    line-height: 1.4;
}

.burger {
    display: none;
    background: transparent;
    border: 0;
    width: 38px;
    height: 38px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
}
.burger span {
    display: block;
    height: 1.5px;
    background: var(--text);
    border-radius: 2px;
    transition: all .2s;
}

/* ---------- Hero ---------- */
.hero {
    padding: 100px 0 120px;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 80px;
    align-items: center;
}
.hero h1 {
    font-family: var(--serif);
    font-size: clamp(2.4rem, 5.2vw, 4.5rem);
    line-height: 1.04;
    margin-bottom: 28px;
    font-weight: 400;
    letter-spacing: -.025em;
}
.hero h1 .accent {
    font-style: italic;
    color: var(--accent);
}
.hero p.lead {
    font-size: 1.05rem;
    color: var(--text-2);
    margin-bottom: 36px;
    max-width: 480px;
    line-height: 1.7;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-art {
    aspect-ratio: 4/5;
    border-radius: 6px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-2);
    position: relative;
}
.hero-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 1.4s ease;
}
.hero-art:hover img { transform: scale(1.03); }

/* ---------- Секции ---------- */
.section {
    padding: 90px 0;
}
.section + .section { padding-top: 0; }
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 50px;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.section-head h2 { margin: 0; }
.section-head a {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-2);
    border-bottom: 1px solid var(--border-2);
    padding-bottom: 2px;
    transition: all .2s;
}
.section-head a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Категории (плитка) ---------- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.cat-card {
    background: var(--bg-2);
    padding: 32px 24px;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    transition: background .2s;
    min-height: 130px;
}
.cat-card:hover {
    background: var(--bg-soft);
    color: var(--text);
}
.cat-emoji {
    font-size: 1.6rem;
    filter: grayscale(.25);
}
.cat-name {
    font-weight: 500;
    font-size: 15px;
    letter-spacing: -.005em;
}

/* ---------- Сетка товаров ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 36px 28px;
}

.product-card {
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
}
.product-card:hover { transform: translateY(-3px); }
.product-card .img-wrap {
    aspect-ratio: 4/5;
    background: var(--bg-3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 18px;
    position: relative;
}
.product-card .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.product-card:hover .img-wrap img { transform: scale(1.04); }
.product-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.product-body .cat-tag {
    font-size: 11px;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-weight: 500;
}
.product-body h3 {
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 500;
    margin: 4px 0 8px;
    line-height: 1.25;
    letter-spacing: -.005em;
}
.product-body h3 a { color: var(--text); }
.product-body h3 a:hover { color: var(--accent); }
.product-body .price {
    color: var(--text);
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: -.005em;
    margin-top: 4px;
}
.product-body .buy-btn { margin-top: 14px; }

.added-flash {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--text);
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 14px;
    box-shadow: var(--shadow-2);
    z-index: 200;
    animation: flash-in .25s ease;
}
@keyframes flash-in {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Страница товара ---------- */
.product-page {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 70px;
    padding: 40px 0 100px;
}
.product-page .main-img {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    aspect-ratio: 4/5;
    overflow: hidden;
}
.product-page .main-img img {
    width: 100%; height: 100%; object-fit: cover;
}
.product-info h1 {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 500;
    margin-bottom: 12px;
}
.product-info .cat-tag {
    font-size: 11px;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: .16em;
    font-weight: 500;
    margin-bottom: 14px;
    display: inline-block;
}
.product-info .price {
    color: var(--text);
    font-weight: 500;
    font-size: 1.8rem;
    margin: 18px 0 30px;
    letter-spacing: -.01em;
}
.product-info .desc {
    color: var(--text-2);
    line-height: 1.75;
    font-size: 15px;
    margin: 36px 0;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.product-info .desc h3 {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 14px;
    color: var(--text);
}

/* ---------- Хлебные крошки ---------- */
.breadcrumbs {
    padding: 26px 0 6px;
    font-size: 13px;
    color: var(--text-mute);
    letter-spacing: .02em;
}
.breadcrumbs a { color: var(--text-mute); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs span { margin: 0 10px; opacity: .5; }

/* ---------- Каталог: фильтр категорий ---------- */
.cat-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0 50px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.cat-filter a {
    padding: 9px 18px;
    background: transparent;
    border: 1px solid var(--border-2);
    border-radius: 100px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    transition: all .18s;
}
.cat-filter a:hover { border-color: var(--text); color: var(--text); }
.cat-filter a.active {
    background: var(--text);
    color: #ffffff;
    border-color: var(--text);
}

/* ---------- Корзина ---------- */
.cart-table {
    width: 100%;
    border-collapse: collapse;
}
.cart-table th, .cart-table td {
    padding: 18px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.cart-table th {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-mute);
    letter-spacing: .12em;
    font-weight: 600;
    padding-top: 0;
}
.cart-table .ci-img {
    width: 76px;
    height: 76px;
    background: var(--bg-3);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.cart-table .ci-img img { width: 100%; height: 100%; object-fit: cover; }

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-2);
    border-radius: 100px;
    overflow: hidden;
    background: var(--bg-2);
}
.qty-control button {
    width: 34px; height: 34px;
    background: transparent;
    color: var(--text);
    border: 0;
    font-size: 16px;
    cursor: pointer;
    transition: background .15s;
}
.qty-control button:hover { background: var(--bg-3); }
.qty-control .qty {
    min-width: 40px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
}

.cart-summary {
    margin-top: 40px;
    padding: 32px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
}
.cart-summary .total {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -.01em;
}
.cart-summary .total .amount { color: var(--accent); }

.empty-cart {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-mute);
}
.empty-cart .ico { font-size: 3rem; margin-bottom: 18px; filter: grayscale(.3); }
.empty-cart h3 { color: var(--text); margin-bottom: 8px; }

/* ---------- Формы ---------- */
.form-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 720px;
}
.form-card h3 {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 4px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.form-row { margin-bottom: 22px; }
.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-2);
    letter-spacing: .005em;
}
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="number"],
.form-row input[type="password"],
.form-row input[type="file"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: all .18s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: 0;
    border-color: var(--text);
    background: var(--bg-2);
}
.form-row textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.form-row .hint { font-size: 12px; color: var(--text-mute); margin-top: 6px; }

.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border: 1px solid;
    font-size: 14px;
}
.alert-success {
    background: var(--accent-soft);
    border-color: #bce4cd;
    color: var(--accent-2);
}
.alert-error {
    background: #fbf1f3;
    border-color: #ebcfd4;
    color: var(--danger);
}

/* ---------- Информационные страницы ---------- */
.page-content {
    padding: 50px 0 90px;
    max-width: 760px;
    margin: 0 auto;
}
.page-content h1 {
    font-family: var(--serif);
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 500;
    margin-bottom: 28px;
    letter-spacing: -.02em;
}
.page-content h2 {
    font-family: var(--serif);
    margin-top: 44px;
    font-size: 1.4rem;
    font-weight: 500;
}
.page-content p { color: var(--text-2); font-size: 16px; line-height: 1.75; }
.page-content ul { padding-left: 22px; color: var(--text-2); }
.page-content li { margin-bottom: 8px; line-height: 1.7; }

/* ---------- Подвал ---------- */
.site-footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 70px 0 30px;
    margin-top: 90px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.4fr;
    gap: 50px;
}
.footer-col h4 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text);
    letter-spacing: .16em;
    margin-bottom: 18px;
    font-weight: 600;
}
.footer-col p { font-size: 14px; color: var(--text-mute); line-height: 1.7; }
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col a {
    color: var(--text-2);
    font-size: 14px;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
    border-top: 1px solid var(--border);
    margin-top: 50px;
    padding-top: 24px;
    font-size: 12px;
    color: var(--text-mute);
    letter-spacing: .02em;
}

/* ============================================
   Админ-панель
   ============================================ */
.admin-body {
    background: var(--bg);
}
.admin-header {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
}
.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-header h1 {
    font-family: var(--serif);
    font-size: 1.2rem;
    margin: 0;
    font-weight: 500;
}
.admin-header a.exit { color: var(--text-mute); font-size: 13px; }
.admin-header a.exit:hover { color: var(--danger); }
.admin-content { padding: 40px 0 60px; }

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}
.admin-toolbar h2 {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 500;
}

.admin-table {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table th {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-mute);
    font-weight: 600;
    letter-spacing: .12em;
    background: var(--bg-soft);
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .row-img {
    width: 52px; height: 52px;
    background: var(--bg-3);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.admin-table .row-img img { width: 100%; height: 100%; object-fit: cover; }
.admin-table .actions {
    display: flex;
    gap: 8px;
}
.admin-table .actions a, .admin-table .actions button {
    padding: 7px 14px;
    font-size: 12px;
}

.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 60%),
        var(--bg);
}
.admin-login-wrap .form-card h2 {
    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 6px;
}

/* ============================================
   Адаптив
   ============================================ */
@media (max-width: 980px) {
    .hero { padding: 70px 0 80px; }
    .hero-inner { grid-template-columns: 1fr; gap: 50px; }
    .hero-art { max-width: 400px; margin: 0 auto; aspect-ratio: 1/1; }
    .product-page { grid-template-columns: 1fr; gap: 40px; padding: 30px 0 70px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
    .section { padding: 70px 0; }
}

@media (max-width: 760px) {
    .container { padding: 0 20px; }
    .main-nav {
        display: none;
        position: absolute;
        top: 74px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-2);
        border-bottom: 1px solid var(--border);
        padding: 22px 24px;
        gap: 18px;
        box-shadow: var(--shadow-2);
    }
    .main-nav.open { display: flex; }
    .burger { display: flex; }
    .section { padding: 50px 0; }
    .section-head { margin-bottom: 30px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
    .product-body h3 { font-size: 1.05rem; }
    .product-body .buy-btn { padding: 10px 16px; font-size: 13px; }
    .form-card { padding: 26px 22px; }
    .cart-table thead { display: none; }
    .cart-table tr {
        display: grid;
        grid-template-columns: 80px 1fr;
        gap: 14px;
        padding: 18px 0;
        border-bottom: 1px solid var(--border);
    }
    .cart-table td {
        border: 0;
        padding: 4px 0;
    }
    .cart-table td.ci-img-cell { grid-row: span 4; }
    .cart-summary { flex-direction: column; align-items: stretch; text-align: center; padding: 24px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2.3rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .logo-text { display: none; }
    .logo-mark { display: none; }
    .logo::before {
        content: "Top Sobaka";
        font-family: var(--serif);
        font-size: 1.25rem;
    }
    .product-card .img-wrap { margin-bottom: 14px; }
    .cart-link { padding: 8px 12px; font-size: 13px; }
}
