/* --- 1. ШРИФТ MANROPE --- */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    /* ЦВЕТА */
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --primary-color: #00897b;   /* Teal */
    --primary-hover: #00695c;
    --text-main: #ffffff;
    --text-muted: #b0bec5;
    --border-color: #333333;
    --radius: 16px;
}

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    line-height: 1.5;
    display: flex; flex-direction: column; min-height: 100vh;
}

/* СБРОС ШРИФТОВ ДЛЯ КНОПОК */
button, input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; height: auto; display: block; }

/* --- HEADER --- */
header {
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 1000; padding: 15px 0;
}
.top-bar {
    max-width: 1280px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 30px;
}
.logo img { height: 35px; width: auto; filter: brightness(0) invert(1); opacity: 0.9; }

.search-bar { flex: 1; max-width: 600px; position: relative; }
.search-bar form { display: flex; }
.search-bar input {
    width: 100%; padding: 12px 20px; border-radius: 12px; 
    border: 1px solid var(--border-color); background: #252525; color: white;
}
.search-bar input:focus { border-color: var(--primary-color); outline: none; }
.search-bar button {
    position: absolute; right: 6px; top: 6px; bottom: 6px;
    width: 40px; border-radius: 8px; border: none; 
    background: var(--primary-color); color: white; cursor: pointer;
}

.user-menu { display: flex; gap: 25px; align-items: center; }
.user-menu a { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.user-menu i { font-size: 20px; margin-bottom: 5px; color: var(--text-main); }
.user-menu a:hover, .user-menu a:hover i { color: var(--primary-color); }
.cart-count {
    position: absolute; top: -5px; right: -8px;
    background: #ef5350; color: white; font-size: 10px; 
    width: 18px; height: 18px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center;
}

/* --- LAYOUT --- */
.main-container {
    max-width: 1280px; width: 100%; margin: 30px auto; padding: 0 20px;
    display: flex; gap: 30px; flex: 1; box-sizing: border-box;
}
.sidebar { width: 240px; flex-shrink: 0; }
.sidebar a { 
    display: flex; align-items: center; gap: 12px; 
    padding: 12px 15px; border-radius: 10px; font-size: 15px; 
    color: var(--text-muted); margin-bottom: 5px; font-weight: 500;
}
.sidebar a:hover { background: var(--bg-card); color: var(--text-main); }
.sidebar a.active { background: var(--primary-color); color: white; }

.content { flex: 1; min-width: 0; }

/* --- БАННЕР-КАРТИНКА --- */
.hero-banner-img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}
.hero-banner-img:hover { transform: scale(1.01); border-color: var(--primary-color); }
.hero-banner-img img { width: 100%; height: auto; object-fit: cover; }

/* --- КАРТОЧКИ (Здесь были изменения) --- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }

.card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 20px; 
    display: flex; flex-direction: column; position: relative;
    transition: transform 0.2s;
}
.card:hover { transform: translateY(-5px); border-color: var(--primary-color); }

.card-img-wrap {
    height: 180px;
    background: transparent; /* ИЗМЕНЕНО: Убран белый фон */
    border-radius: 12px;
    padding: 5px; /* ИЗМЕНЕНО: Отступ уменьшен с 15px до 5px */
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 15px; overflow: hidden;
}
.card-img-wrap img { max-height: 100%; max-width: 100%; object-fit: contain; transition: transform 0.3s; }
.card:hover .card-img-wrap img { transform: scale(1.05); }

.card h3 { font-size: 15px; margin: 0 0 10px 0; height: 44px; overflow: hidden; color: var(--text-main); font-weight: 600; }
.price { font-size: 20px; font-weight: 800; margin-bottom: 15px; color: var(--text-main); }

/* --- КНОПКИ --- */
.btn-buy {
    width: 100%; background: var(--primary-color); color: white;
    padding: 12px; border: none; border-radius: 10px; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: 0.2s;
}
.btn-buy:hover { background: var(--primary-hover); }

/* --- СЕРДЕЧКО ВНИЗУ --- */
.wishlist-btn-bottom {
    margin-top: 10px; width: 100%;
    background: transparent; border: 1px solid var(--border-color);
    color: var(--text-muted); border-radius: 10px; padding: 10px;
    cursor: pointer; transition: 0.2s; font-size: 14px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.wishlist-btn-bottom:hover { border-color: var(--text-muted); color: white; }
.wishlist-btn-bottom.active { border-color: #ef5350; color: #ef5350; background: rgba(239, 83, 80, 0.1); }

/* --- PRODUCT PAGE (Здесь были изменения) --- */
.product-wrapper {
    display: flex; gap: 40px; background: var(--bg-card); padding: 40px; 
    border-radius: var(--radius); border: 1px solid var(--border-color);
}
.product-image-box {
    flex: 1;
    background: transparent; /* ИЗМЕНЕНО: Убран белый фон */
    border-radius: var(--radius);
    padding: 5px; /* ИЗМЕНЕНО: Отступ уменьшен с 30px до 5px */
    display: flex; align-items: center; justify-content: center; min-height: 400px;
}
.product-image-box img { max-height: 350px; width: auto; object-fit: contain; }
.product-info { flex: 1; }
.specs-table td { padding: 10px 0; border-bottom: 1px solid var(--border-color); color: var(--text-muted); }
.specs-table td:last-child { color: white; text-align: right; }

/* --- КОРЗИНА --- */
.cart-item {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 20px; margin-bottom: 15px;
    display: flex; align-items: center; gap: 20px;
}
.cart-img-box {
    width: 90px; height: 90px; flex-shrink: 0; 
    background: white; /* В корзине оставим белый фон, там иконки мелкие */
    border-radius: 10px;
    padding: 5px; display: flex; align-items: center; justify-content: center;
}
.cart-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cart-info { flex: 1; }
.qty-box { display: flex; align-items: center; background: #2c2c2c; border-radius: 8px; padding: 2px; }
.qty-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: white; font-weight: bold; }
.qty-num { width: 30px; text-align: center; font-weight: bold; font-size: 14px; }
.cart-price { font-size: 18px; font-weight: 700; min-width: 100px; text-align: right; }
.cart-summary { background: var(--bg-card); padding: 25px; border-radius: var(--radius); text-align: right; border: 1px solid var(--border-color); margin-top: 30px; }

/* --- FOOTER --- */
.site-footer { background: var(--bg-body); border-top: 1px solid var(--border-color); padding: 50px 0 30px; margin-top: auto; color: var(--text-muted); font-size: 14px; }
.footer-container { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; padding: 0 20px; flex-wrap: wrap; gap: 30px; }
.footer-col h3 { color: var(--text-main); margin-bottom: 20px; font-size: 16px; font-weight: 700; }
.footer-col a:hover { color: var(--primary-color); }

/* --- COOKIES & TOAST --- */
#toast-notification {
    visibility: hidden; min-width: 300px; background-color: #252525; color: #fff; text-align: center;
    border-radius: 50px; padding: 14px 24px; position: fixed; z-index: 9999;
    left: 50%; bottom: 30px; transform: translateX(-50%);
    font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid var(--primary-color);
    opacity: 0; transition: all 0.3s; font-weight: 600;
}
#toast-notification.show { visibility: visible; opacity: 1; bottom: 50px; }
.cookie-banner {
    position: fixed; bottom: -200px; left: 0; width: 100%; background: #1e1e1e; border-top: 1px solid var(--primary-color);
    padding: 20px; z-index: 10000; display: flex; align-items: center; justify-content: center; gap: 20px;
    transition: bottom 0.5s ease; box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
}
.cookie-banner.show { bottom: 0; }
.btn-cookie { background: var(--primary-color); color: white; padding: 10px 25px; border-radius: 99px; border: none; font-weight: bold; cursor: pointer; }

@media (max-width: 768px) {
    .main-container { flex-direction: column; margin-top: 20px; }
    .product-wrapper { flex-direction: column; padding: 20px; }
    .product-image-box { min-height: 250px; }
    .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card { padding: 10px; }
    .card-img-wrap { height: 140px; padding: 5px; }
    .sidebar { width: 100%; overflow-x: auto; white-space: nowrap; padding-bottom: 10px; }
    .sidebar a { display: inline-flex; margin-right: 10px; border: 1px solid var(--border-color); }
    .cart-item { flex-direction: column; align-items: flex-start; }
    .cart-controls { width: 100%; justify-content: space-between; margin-top: 15px; }
    .cart-price { text-align: left; }
}
/* --- СТИЛИ ДЛЯ АДМИН ПАНЕЛИ (DARK MODE) --- */
.admin-layout { max-width: 1400px; margin: 30px auto; padding: 0 20px; }

/* Шапка админки */
.admin-header {
    background: var(--bg-card); border-radius: 16px; padding: 20px 30px;
    display: flex; justify-content: space-between; align-items: center;
    border: 1px solid var(--border-color); margin-bottom: 30px;
    flex-wrap: wrap; gap: 20px;
}
.admin-nav a {
    color: var(--text-muted); font-weight: 600; text-decoration: none;
    margin-left: 25px; transition: 0.2s; font-size: 15px;
}
.admin-nav a:hover, .admin-nav a.active { color: var(--primary-color); }

/* Карточки статистики */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card {
    background: var(--bg-card); padding: 25px; border-radius: 16px;
    border: 1px solid var(--border-color); display: flex; flex-direction: column;
}
.stat-val { font-size: 28px; font-weight: 800; color: var(--text-main); margin-bottom: 5px; }
.stat-label { font-size: 14px; color: var(--text-muted); }
.stat-icon { font-size: 24px; color: var(--primary-color); margin-bottom: 10px; }

/* Таблицы */
.admin-table-wrap { overflow-x: auto; background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border-color); padding: 5px; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.admin-table th { text-align: left; padding: 15px 20px; color: var(--text-muted); font-size: 13px; text-transform: uppercase; border-bottom: 1px solid var(--border-color); }
.admin-table td { padding: 15px 20px; border-bottom: 1px solid #333; color: var(--text-main); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }

/* Формы в админке */
.admin-input, .admin-select, .admin-textarea {
    width: 100%; background: #2c2c2c; border: 1px solid var(--border-color);
    color: white; padding: 10px 15px; border-radius: 8px; box-sizing: border-box; font-family: 'Manrope', sans-serif;
}
.admin-input:focus { border-color: var(--primary-color); outline: none; }

/* Статусы (Неоновые) */
.badge { padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.st-new { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.st-proc { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.st-done { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.st-canc { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Кнопки действий */
.action-btn { background: #333; color: white; width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; transition: 0.2s; margin-right: 5px; }
.action-btn:hover { background: var(--primary-color); }
.action-btn.del:hover { background: #ef4444; }

/* Живой поиск */
.live-search {
    width: 100%; max-width: 300px; padding: 12px 15px 12px 40px; 
    background: #2c2c2c url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="gray" viewBox="0 0 24 24"><path d="M21.71 20.29l-5.01-5.01C17.54 13.68 18 11.91 18 10c0-4.41-3.59-8-8-8S2 5.59 2 10s3.59 8 8 8c1.91 0 3.68-.46 5.28-1.3l5.01 5.01c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41zM4 10c0-3.31 2.69-6 6-6s6 2.69 6 6-2.69 6-6 6-6-2.69-6-6z"/></svg>') no-repeat 10px center;
    background-size: 20px; border: 1px solid var(--border-color); border-radius: 99px; color: white;
}
/* --- НОВЫЕ СТИЛИ (Кнопка удаления и Оформление заказа) --- */

/* Кнопка "Удалить" (Красная обводка) */
.btn-remove {
    width: 100%;
    margin-top: 10px;
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 14px;
}
.btn-remove:hover { background: #ef4444; color: white; }

/* Оформление заказа (Checkout) */
.checkout-wrapper {
    max-width: 600px;
    margin: 40px auto;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.checkout-title { font-size: 24px; font-weight: 800; margin-bottom: 30px; text-align: center; color: var(--text-main); }

.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 14px; font-weight: 600; }

/* Красивые темные поля ввода */
.form-input {
    width: 100%;
    background: #2c2c2c;
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Manrope', sans-serif;
    box-sizing: border-box;
    transition: 0.2s;
}
.form-input:focus { border-color: var(--primary-color); outline: none; background: #333; }
.form-input::placeholder { color: #555; }

/* Сообщение об успехе */
.success-box { text-align: center; padding: 40px 20px; }
.success-icon { font-size: 60px; color: var(--primary-color); margin-bottom: 20px; }
.success-title { font-size: 28px; font-weight: 800; color: var(--text-main); margin-bottom: 10px; }
.success-text { color: var(--text-muted); margin-bottom: 30px; }