/*
Theme Name: Apple Minimal Theme
Theme URI: https://otlichny-semestr.ru
Author: Отличный Семестр
Description: Минималистичная тема в стиле Apple.com
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: apple-minimal
Tags: minimal, clean, apple-style
*/

:root {
    --apple-font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    --apple-bg: #ffffff;
    --apple-bg-soft: #f5f5f7;
    --apple-text: #1d1d1f;
    --apple-text-soft: #86868b;
    --apple-accent: #0066cc;
    --apple-mint: #14b8a6;
    --apple-border: #d2d2d7;
    --apple-radius: 12px;
    --apple-shadow: 0 2px 12px rgba(0,0,0,0.06);
    --apple-nav-bg: rgba(255,255,255,0.85);
}

* { box-sizing: border-box; }

body {
    font-family: var(--apple-font);
    color: var(--apple-text);
    background: var(--apple-bg);
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    padding-top: 56px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    color: var(--apple-text);
}

h1 { font-size: 48px; line-height: 1.1; }
h2 { font-size: 36px; line-height: 1.2; }
h3 { font-size: 28px; line-height: 1.3; }

p { margin: 0 0 16px; line-height: 1.6; }

a {
    color: var(--apple-accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover { color: #0077ed; }

img { max-width: 100%; height: auto; }

.site-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
}

/* ШАПКА */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--apple-nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    z-index: 9999;
}

.site-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--apple-text);
    transition: opacity 0.2s;
}

.site-logo:hover { opacity: 0.7; color: var(--apple-text); }
.site-logo-icon { font-size: 20px; }

.site-logo-text {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.site-logo-text em {
    font-style: italic;
    font-weight: 400;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 2px;
}

.header-tools {
    display: flex;
    gap: 4px;
    align-items: center;
}

.header-tool {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--apple-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.75;
}

.header-tool:hover {
    opacity: 1;
    background: var(--apple-bg-soft);
    transform: translateY(-1px);
    color: var(--apple-text);
}

.header-tool:active { transform: scale(0.94); }

.header-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(20,184,166,0.4);
}

/* ПОИСК */
.search-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
}

.search-overlay.active { opacity: 1; pointer-events: auto; }

.search-box {
    width: 100%;
    max-width: 620px;
    padding: 0 20px;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--apple-border);
    border-radius: 100px;
    padding: 14px 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-field:focus-within {
    border-color: var(--apple-mint);
    box-shadow: 0 20px 60px rgba(20,184,166,0.12);
}

.search-field svg { color: var(--apple-text-soft); flex-shrink: 0; }

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--apple-text);
    font-size: 17px;
    font-family: var(--apple-font);
}

.search-input::placeholder { color: var(--apple-text-soft); }

.search-close {
    background: transparent;
    border: none;
    color: var(--apple-text-soft);
    font-size: 28px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}

.search-close:hover { color: var(--apple-text); background: var(--apple-bg-soft); }

.search-results { margin-top: 10px; max-height: 400px; overflow-y: auto; }

.search-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    text-decoration: none;
    color: var(--apple-text);
    margin-bottom: 8px;
    transition: all 0.2s;
}

.search-result:hover {
    border-color: var(--apple-mint);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    color: var(--apple-text);
}

.search-result-img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--apple-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    overflow: hidden;
}

.search-result-img img { width: 100%; height: 100%; object-fit: cover; }
.search-result-info { flex: 1; min-width: 0; }

.search-result-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--apple-mint);
}

.search-empty {
    padding: 24px;
    text-align: center;
    color: var(--apple-text-soft);
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e5e5;
}

.search-hints {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    margin-top: 10px;
    padding: 16px 18px;
}

.search-hints-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--apple-text-soft);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.search-hint {
    display: inline-block;
    padding: 6px 14px;
    margin: 2px 4px 2px 0;
    background: var(--apple-bg-soft);
    color: var(--apple-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 100px;
    transition: all 0.2s;
}

.search-hint:hover { background: var(--apple-text); color: #fff; }

/* FOOTER */
.site-footer {
    background: var(--apple-bg-soft);
    padding: 40px 24px 20px;
    margin-top: 80px;
    border-top: 1px solid var(--apple-border);
    font-size: 12px;
    color: #6e6e73;
}

.footer-inner { max-width: 1200px; margin: 0 auto; }

.footer-columns {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 40px;
    padding-bottom: 20px;
}

.footer-col-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--apple-text);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: default;
}

.footer-plus { display: none; }

.footer-col-list { list-style: none; padding: 0; margin: 0; }
.footer-col-list li { margin-bottom: 8px; }

.footer-col-list a {
    color: #6e6e73;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

.footer-col-list a:hover { color: var(--apple-text); text-decoration: underline; }

.footer-divider { height: 1px; background: var(--apple-border); margin: 20px 0; }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-copyright { font-size: 12px; color: #6e6e73; margin-bottom: 10px; }

.footer-legal { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

.footer-legal a { color: #6e6e73; text-decoration: none; font-size: 12px; }
.footer-legal a:hover { color: var(--apple-text); text-decoration: underline; }

.footer-legal-sep { color: var(--apple-border); margin: 0 6px; }
.footer-region { font-size: 12px; color: #6e6e73; }

/* АДАПТИВНОСТЬ */
@media (max-width: 734px) {
    body { padding-top: 52px; }
    .site-header { height: 52px; }
    .site-header-inner { padding: 0 16px; }
    .site-logo-text { font-size: 14px; }
    .header-tool { width: 38px; height: 38px; }
    .search-overlay { padding-top: 70px; }
    .search-input { font-size: 16px; }
    
    .footer-columns { grid-template-columns: 1fr; gap: 0; }
    .footer-col { border-bottom: 1px solid var(--apple-border); }
    .footer-col:first-child { border-top: 1px solid var(--apple-border); }
    .footer-col-title { padding: 16px 0; margin: 0; cursor: pointer; font-size: 13px; }
    .footer-plus { display: block; font-size: 20px; font-weight: 300; color: var(--apple-text-soft); transition: transform 0.3s ease; }
    .footer-col-title.active .footer-plus { transform: rotate(45deg); }
    .footer-col-list { max-height: 0; overflow: hidden; transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1); padding: 0; }
    .footer-col-list.active { max-height: 500px; padding: 0 0 16px; }
    .footer-bottom { flex-direction: column; gap: 16px; }
}

@media (max-width: 480px) {
    .site-logo-text { display: none; }
}

/* ТЁМНАЯ ТЕМА */
@media (prefers-color-scheme: dark) {
    :root {
        --apple-bg: #000;
        --apple-bg-soft: #1d1d1f;
        --apple-text: #f5f5f7;
        --apple-text-soft: #a1a1a6;
        --apple-border: #424245;
        --apple-nav-bg: rgba(0,0,0,0.72);
    }
    .header-badge { border-color: #1d1d1f; }
    .search-overlay { background: rgba(0,0,0,0.6); }
    .search-field, .search-result, .search-hints, .search-empty { background: #1d1d1f; border-color: #2d2d2f; color: #f5f5f7; }
    .search-input { color: #f5f5f7; }
    .search-input::placeholder { color: #86868b; }
    .search-result:hover { background: #2d2d2f; color: #f5f5f7; }
    .search-result-img { background: #2d2d2f; }
    .search-hint { background: #2d2d2f; color: #f5f5f7; }
    .search-hint:hover { background: #f5f5f7; color: #1d1d1f; }
}