/* TechVault — Main Stylesheet */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #f59e0b;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
    --error: #ef4444;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

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

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px 0; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.logo:hover { text-decoration: none; color: var(--primary); }
.main-nav ul { display: flex; list-style: none; gap: 24px; }
.main-nav a { color: var(--text); font-weight: 500; }
.main-nav a:hover { color: var(--primary); text-decoration: none; }
.header-actions { display: flex; gap: 16px; align-items: center; }
.btn-cart, .btn-search { font-size: 1.1rem; color: var(--text); }
#cart-count { background: var(--primary); color: #fff; border-radius: 50%; padding: 1px 6px; font-size: .75rem; }

/* Hero */
.hero { background: linear-gradient(135deg, #1e3a5f, #2563eb); color: #fff; padding: 80px 0; text-align: center; border-radius: var(--radius); margin: 24px 0; }
.hero h1 { font-size: 2.5rem; margin-bottom: 16px; }
.hero p { font-size: 1.2rem; opacity: .9; margin-bottom: 24px; }

/* Buttons */
.btn { display: inline-block; padding: 10px 24px; border: none; border-radius: var(--radius); font-weight: 600; cursor: pointer; transition: .2s; text-align: center; font-size: .95rem; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--accent); color: #000; }
.btn-outline { border: 2px solid var(--border); background: transparent; color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-cart-add { width: 100%; background: var(--primary); color: #fff; padding: 8px; border: none; border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.btn-cart-add:hover { background: var(--primary-hover); }

/* Sections */
.section { margin: 40px 0; }
.section-title { font-size: 1.5rem; margin-bottom: 24px; text-align: center; }

/* Categories */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.category-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: .2s; text-align: center; }
.category-card:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.category-icon { font-size: 2rem; }
.category-name { font-weight: 600; color: var(--text); }
.category-count { color: var(--text-muted); font-size: .85rem; }

/* Products Grid */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: .2s; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-image { position: relative; background: #f1f5f9; padding: 20px; text-align: center; }
.product-image img { width: 200px; height: 200px; object-fit: contain; }
.badge { position: absolute; top: 10px; padding: 4px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.badge-sale { left: 10px; background: var(--error); color: #fff; }
.badge-low { right: 10px; background: var(--accent); color: #000; }
.product-info { padding: 16px; }
.product-info h3 { font-size: 1rem; margin-bottom: 8px; }
.product-info h3 a { color: var(--text); }
.product-rating { margin-bottom: 8px; }
.stars { color: var(--accent); }
.review-count { color: var(--text-muted); font-size: .85rem; }
.product-price { margin-bottom: 12px; }
.current-price { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.old-price { text-decoration: line-through; color: var(--text-muted); font-size: .9rem; margin-left: 8px; }

/* Promo */
.promo-banner { background: linear-gradient(135deg, #fbbf24, #f59e0b); padding: 48px; border-radius: var(--radius); text-align: center; margin: 40px 0; }
.promo-banner h2 { font-size: 1.8rem; margin-bottom: 12px; }

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.blog-card, .blog-card-full { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.blog-meta { display: flex; gap: 16px; color: var(--text-muted); font-size: .85rem; margin-bottom: 12px; }
.blog-card h3, .blog-card-full h2 { margin-bottom: 12px; }
.read-more { font-weight: 600; color: var(--primary); }

/* Newsletter */
.newsletter { background: var(--surface); padding: 48px; text-align: center; border-radius: var(--radius); border: 1px solid var(--border); margin: 40px 0; }
.newsletter h2 { margin-bottom: 8px; }
.newsletter p { color: var(--text-muted); margin-bottom: 20px; }
.newsletter-form { display: flex; gap: 12px; justify-content: center; max-width: 500px; margin: 0 auto; }
.newsletter-form input { flex: 1; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; }

/* Footer */
.site-footer { background: #1e293b; color: #cbd5e1; padding: 48px 0 24px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-col h4 { color: #fff; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { color: #94a3b8; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 16px; text-align: center; font-size: .85rem; }

/* Catalog Layout */
.catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
.catalog-sidebar h3 { margin: 20px 0 10px; font-size: 1rem; }
.catalog-sidebar h3:first-child { margin-top: 0; }
.filter-list { list-style: none; }
.filter-list li { margin-bottom: 4px; }
.filter-list a { color: var(--text-muted); display: block; padding: 4px 8px; border-radius: 4px; }
.filter-list a:hover, .filter-list a.active { background: var(--primary); color: #fff; text-decoration: none; }
.catalog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.price-filter { display: flex; gap: 8px; }
.price-filter input { width: 80px; padding: 6px; border: 1px solid var(--border); border-radius: 4px; }

/* Product Detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 24px 0; }
.main-image { background: #f1f5f9; padding: 20px; border-radius: var(--radius); text-align: center; }
.thumb-list { display: flex; gap: 8px; margin-top: 12px; }
.thumb { border: 2px solid var(--border); border-radius: 4px; cursor: pointer; padding: 4px; }
.thumb:hover { border-color: var(--primary); }
.product-main-info h1 { font-size: 1.8rem; margin-bottom: 12px; }
.product-meta { display: flex; gap: 16px; margin-bottom: 16px; color: var(--text-muted); font-size: .9rem; }
.price-block { margin-bottom: 16px; }
.price-block .current-price { font-size: 2rem; }
.price-block .discount { color: var(--success); font-weight: 600; display: block; margin-top: 4px; }
.stock-info { padding: 8px 12px; border-radius: 4px; margin-bottom: 16px; }
.stock-info.ok { background: #f0fdf4; }
.stock-info.low { background: #fef3c7; }
.quantity-selector { display: flex; align-items: center; gap: 0; margin-bottom: 16px; }
.quantity-selector button { width: 40px; height: 40px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 1.2rem; }
.quantity-selector input { width: 60px; height: 40px; text-align: center; border: 1px solid var(--border); border-left: 0; border-right: 0; font-size: 1rem; }
.product-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.delivery-info { border-top: 1px solid var(--border); padding-top: 16px; }
.delivery-option { padding: 6px 0; }

/* Tabs */
.product-tabs { margin: 40px 0; }
.tab-nav { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn { padding: 12px 24px; background: none; border: none; cursor: pointer; font-weight: 600; color: var(--text-muted); }
.tab-btn.active { color: var(--primary); border-bottom: 2px solid var(--primary); margin-bottom: -2px; }
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table td { padding: 10px; border-bottom: 1px solid var(--border); }
.specs-table td:first-child { font-weight: 600; width: 200px; }
.review { border-bottom: 1px solid var(--border); padding: 16px 0; }
.review-header { display: flex; gap: 16px; margin-bottom: 8px; align-items: center; }

/* About */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 32px 0; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.stat-number { display: block; font-size: 2rem; font-weight: 800; color: var(--primary); }
.advantages-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.advantage { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.advantage-icon { font-size: 2rem; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.team-card { text-align: center; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.team-avatar { width: 60px; height: 60px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 1.5rem; font-weight: 700; }
.team-role { color: var(--primary); font-weight: 600; }
.team-bio { color: var(--text-muted); font-size: .9rem; }

/* Contact */
.contact-layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; }
.form-group textarea { resize: vertical; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.alert { padding: 16px; border-radius: var(--radius); margin-bottom: 20px; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* Search */
.search-form { display: flex; gap: 12px; margin: 20px 0; }
.search-input { flex: 1; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 1.1rem; }
.search-input:focus { border-color: var(--primary); outline: none; }

/* Cart */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 16px; text-align: left; border-bottom: 1px solid var(--border); }
.cart-summary { margin-top: 24px; text-align: right; }
.total-price { font-size: 1.5rem; font-weight: 800; }
.cart-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 12px; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.page-link { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Breadcrumbs */
.breadcrumbs { padding: 12px 0; color: var(--text-muted); font-size: .85rem; }
.breadcrumbs a { color: var(--text-muted); }

/* Info pages */
.info-page { max-width: 800px; }
.info-page h2 { margin-top: 24px; margin-bottom: 12px; }
.info-page p { margin-bottom: 12px; }
.info-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.info-table td { padding: 12px; border-bottom: 1px solid var(--border); }

/* Blog article */
.blog-article { max-width: 800px; }
.article-header { margin-bottom: 24px; }
.article-header h1 { font-size: 2rem; margin-bottom: 12px; }
.article-meta { color: var(--text-muted); display: flex; gap: 20px; }
.article-body { line-height: 1.8; }
.article-body h3 { margin: 24px 0 12px; }
.article-body p { margin-bottom: 16px; }
.article-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }
.share-buttons { display: flex; gap: 16px; align-items: center; }

/* Error page */
.error-page { text-align: center; padding: 80px 0; }
.error-page h1 { font-size: 5rem; color: var(--primary); }
.empty-state { text-align: center; padding: 60px 0; color: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; }
    .main-nav ul { gap: 12px; }
    .hero h1 { font-size: 1.8rem; }
    .catalog-layout { grid-template-columns: 1fr; }
    .product-detail { grid-template-columns: 1fr; }
    .contact-layout { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
