/* ============================================================
   Pelargo — глобальные стили
   Палитра: кремовый, кофе с молоком, белый
   Шрифт: Montserrat
   ============================================================ */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(https://pelargo.ru/assets/fonts/montserrat.woff) format('woff');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://pelargo.ru/assets/fonts/montserrat.woff) format('woff');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(https://pelargo.ru/assets/fonts/montserrat.woff) format('woff');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(https://pelargo.ru/assets/fonts/montserrat.woff) format('woff');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://pelargo.ru/assets/fonts/montserrat.woff) format('woff');
}

:root {
    --color-cream: #FFF8F0;
    --color-cream-dark: #F5EDE3;
    --color-coffee: #C4A882;
    --color-coffee-dark: #A08060;
    --color-coffee-light: #E8D5C0;
    --color-white: #FFFFFF;
    --color-text: #3D3229;
    --color-text-light: #7A6B5D;
    --color-border: #E8D5C0;
    --color-danger: #C0392B;
    --color-success: #27AE60;
    --shadow-sm: 0 2px 8px rgba(160, 128, 96, 0.08);
    --shadow-md: 0 4px 16px rgba(160, 128, 96, 0.12);
    --shadow-lg: 0 8px 32px rgba(160, 128, 96, 0.16);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 0.3s ease;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    color: var(--color-text);
    background-color: var(--color-cream);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--color-text);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-coffee);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

h2 {
    padding: 20px 0 0 0;
}

/* ============ Шапка ============ */

.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text);
}

.logo-icon {
    font-size: 1.5rem;
}

.main-nav {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--color-text-light);
    transition: color var(--transition);
}

.nav-link:hover {
    color: var(--color-coffee-dark);
}

/* ============ Hero ============ */

.hero {
    padding: 80px 0 60px;
    text-align: center;
    background: linear-gradient(180deg, var(--color-white) 0%, var(--color-cream) 100%);
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-light);
    max-width: 560px;
    margin: 0 auto;
    font-weight: 300;
}

/* ============ Секции ============ */

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 32px;
    color: var(--color-text);
}

.varieties-section {
    padding: 60px 0;
}

.care-section {
    padding: 60px 0 80px;
    background: var(--color-cream-dark);
}

/* ============ Карточки сортов ============ */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.variety-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    display: block;
}

.variety-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-photo {
    height: 300px; /* Увеличена высота для квадратных фото */
    overflow: hidden;
    background: var(--color-cream-dark);
}

.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.variety-card:hover .card-photo img {
    transform: scale(1.05);
}

.card-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: var(--color-cream-dark);
}

.card-body {
    padding: 20px;
}

.card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-cta {
    font-size: 0.85rem;
    color: var(--color-coffee-dark);
    font-weight: 500;
}

/* ============ Пустое состояние ============ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-light);
    font-size: 1.05rem;
}

.empty-state a {
    color: var(--color-coffee-dark);
    font-weight: 500;
}

/* ============ Уход ============ */

.care-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.care-item {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.care-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 12px;
}

.care-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.care-item p {
    font-size: 0.88rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* ============ Страница сорта ============ */

.variety-detail {
    padding: 40px 0 80px;
}

.back-link {
    display: inline-block;
    margin-bottom: 32px;
    font-weight: 500;
    font-size: 0.9rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.detail-photo {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.detail-photo img {
    width: 100%;
    height: auto;
}

.detail-photo-placeholder {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background: var(--color-cream-dark);
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.detail-description {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text);
}

/* ============ Подвал ============ */

.site-footer {
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: 32px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    font-weight: 500;
    font-size: 0.9rem;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

/* ============ Админ-панель ============ */

.admin-body {
    background: var(--color-cream);
    min-height: 100vh;
}

.admin-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.admin-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* --- Кнопки --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--color-coffee);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-coffee-dark);
    color: var(--color-white);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--color-coffee);
    color: var(--color-coffee-dark);
}

.btn-outline:hover {
    background: var(--color-coffee-light);
    color: var(--color-text);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-light);
}

.btn-ghost:hover {
    color: var(--color-text);
}

.btn-danger {
    background: transparent;
    border: 1.5px solid var(--color-danger);
    color: var(--color-danger);
}

.btn-danger:hover {
    background: var(--color-danger);
    color: var(--color-white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* --- Формы --- */

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--color-white);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.admin-form-wide {
    max-width: 640px;
}

.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-form label span {
    font-weight: 500;
    font-size: 0.9rem;
}

.admin-form label span em {
    color: var(--color-danger);
    font-style: normal;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="file"],
.admin-form textarea {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-cream);
    color: var(--color-text);
    transition: border-color var(--transition);
    resize: vertical;
}

.admin-form input:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: var(--color-coffee);
    box-shadow: 0 0 0 3px rgba(196, 168, 130, 0.15);
}

.form-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 8px 0;
}

.form-section-label {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-light);
}

.form-errors {
    background: #FDEDEC;
    border: 1px solid #F5C6CB;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    color: var(--color-danger);
    font-size: 0.9rem;
}

.form-error {
    color: var(--color-danger);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.checkbox-label {
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-coffee);
}

/* --- Таблица --- */

.admin-table-section {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.admin-table-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table th {
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--color-text-light);
    border-bottom: 2px solid var(--color-border);
}

.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-cream-dark);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: var(--color-cream);
}

td-photo img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
}

td-actions {
    white-space: nowrap;
}

td-actions .btn {
    margin-right: 6px;
    margin-bottom: 4px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background: #D4EDDA;
    color: #155724;
}

.badge-inactive {
    background: #F5C6CB;
    color: #721C24;
}

/* --- Логин --- */

.admin-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.admin-login-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.admin-login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

.admin-login-hint {
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--color-text-light);
    text-align: center;
}

/* --- Фото в форме --- */

.photo-field {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.photo-preview {
    display: flex;
    align-items: center;
    gap: 16px;
}

.photo-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--color-border);
}

.photo-remove {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 0.85rem !important;
    color: var(--color-danger) !important;
    cursor: pointer;
}

.photo-remove input {
    accent-color: var(--color-danger);
}

/* ============ Адаптивность ============ */

@media (max-width: 768px) {
    .hero {
        padding: 50px 0 40px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-table {
        font-size: 0.8rem;
    }
}
