/* ULTRA STORE - Main Theme (Dark Mode) */
:root {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --bg-input: #252525;
    --text-main: #e0e0e0;
    --text-muted: #aaaaaa;
    --primary: #4dabf7; /* Синий акцент */
    --accent: #2ecc71;  /* Зеленый для кнопок купить */
    --danger: #ff6b6b;  /* Красный для ошибок/скидок */
    --border: #333333;
    --radius: 12px;
}

/* --- Base --- */
* { box-sizing: border-box; outline: none; }
body {
    margin: 0; padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex; flex-direction: column;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; display: block; }

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
    padding: 30px 0;
}

/* --- Header --- */
.site-header {
    background: #1a1a1a;
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky; top: 0; z-index: 100;
}
.header-inner {
    display: flex; justify-content: space-between; align-items: center; gap: 20px;
}
.logo {
    font-size: 22px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: 1px;
}
.logo span { color: var(--primary); }

.search-bar {
    flex: 1; max-width: 500px; position: relative;
}
.search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 10px 15px;
    border-radius: 50px;
    color: #fff;
}
.search-input:focus { border-color: var(--primary); }

.nav-icons { display: flex; gap: 20px; align-items: center; }
.nav-icon { position: relative; font-size: 20px; color: var(--text-muted); }
.nav-icon:hover { color: #fff; }
.badge-count {
    position: absolute; top: -5px; right: -8px;
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: bold;
    padding: 2px 5px; border-radius: 10px;
}

/* --- Grid System (Товары) --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column;
    position: relative;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: #555;
}

.prod-img {
    height: 220px;
    background: #151515;
    display: flex; align-items: center; justify-content: center;
    padding: 10px;
}
.prod-img img { max-height: 100%; object-fit: contain; }

.prod-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 5px; }
.badge { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; color: #fff; }
.badge.hot { background: #f1c40f; color: #000; }
.badge.sale { background: var(--danger); }

.prod-info { padding: 15px; flex: 1; display: flex; flex-direction: column; }
.prod-cat { font-size: 12px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 5px; }
.prod-title { font-weight: 600; font-size: 16px; margin-bottom: 10px; line-height: 1.3; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.prod-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.price-box { display: flex; flex-direction: column; }
.old-price { font-size: 13px; text-decoration: line-through; color: #666; }
.current-price { font-size: 18px; font-weight: 700; color: #fff; }

.btn-add {
    background: var(--bg-input); color: #fff;
    width: 40px; height: 40px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); cursor: pointer; transition: 0.2s;
}
.btn-add:hover { background: var(--accent); border-color: var(--accent); }

/* --- Category Tiles --- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px; margin-bottom: 40px;
}
.cat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: 0.2s;
    height: 140px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.cat-card:hover { background: #252525; border-color: var(--primary); }
.cat-icon { font-size: 32px; margin-bottom: 10px; color: var(--primary); }
.cat-name { font-weight: 500; font-size: 14px; }

/* --- UI Components --- */
.btn {
    display: inline-block; padding: 10px 20px;
    background: var(--primary); color: #fff;
    border-radius: 8px; font-weight: 600; border: none;
    cursor: pointer; text-align: center;
}
.btn:hover { opacity: 0.9; }
.btn-block { width: 100%; }

.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 13px; }
.form-control {
    width: 100%; padding: 12px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 8px; color: #fff;
}
.form-control:focus { border-color: var(--primary); }

.alert { padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid transparent; }
.alert-error { background: rgba(255, 107, 107, 0.1); border-color: var(--danger); color: var(--danger); }
.alert-success { background: rgba(46, 204, 113, 0.1); border-color: var(--accent); color: var(--accent); }

/* --- Mobile --- */
@media (max-width: 768px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .header-inner { flex-wrap: wrap; }
    .search-bar { order: 3; width: 100%; max-width: 100%; margin-top: 10px; }
}