
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root { --primary: #2563eb; --primary-hover: #1d4ed8; --text-main: #1f2937; --text-muted: #6b7280; --bg-light: #f9fafb; --bg-white: #ffffff; --border: #e5e7eb; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; color: var(--text-main); background-color: var(--bg-light); display: flex; flex-direction: column; min-height: 100vh; }
a { text-decoration: none; color: var(--primary); transition: color 0.2s; }
a:hover { color: var(--primary-hover); }
ul { list-style: none; }
.container { max-width: 1300px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }

/* Header & Nav */
header { background-color: var(--bg-white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 75px; }
.logo-area { display: flex; align-items: center; gap: 1.5rem; }
.logo { font-size: 1.6rem; font-weight: 700; color: var(--primary); letter-spacing: -0.5px; }
.nav-wrapper { display: flex; align-items: center; gap: 2.5rem; }
.nav-menu { display: flex; gap: 1.5rem; align-items: center; }
.nav-menu a { color: var(--text-main); font-weight: 500; }
.nav-menu a:hover { color: var(--primary); }
.header-actions { display: flex; gap: 1.2rem; align-items: center; border-left: 1px solid var(--border); padding-left: 1.2rem; }
.icon-link { font-weight: 500; color: var(--text-main); display: flex; gap: 0.3rem; align-items: center; }

/* Dropdown Menu */
.dropdown { position: relative; }
.dropdown-content { display: none; position: absolute; top: 100%; left: 0; background-color: var(--bg-white); min-width: 260px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); border-radius: 8px; border: 1px solid var(--border); max-height: 400px; overflow-y: auto; z-index: 1000; padding: 0.5rem 0;}
.dropdown:hover .dropdown-content { display: block; }
.dropdown-content a { display: block; padding: 0.6rem 1.2rem; color: var(--text-main); font-size: 0.95rem; }
.dropdown-content a:hover { background-color: var(--bg-light); color: var(--primary); }

/* Mobile Menu */
.menu-toggle, .hamburger, .menu-backdrop { display: none; }
.hamburger { font-size: 1.8rem; cursor: pointer; user-select: none; line-height: 1; color: var(--text-main); }

/* Page Layout (Sidebar + Main Content) */
.page-layout { display: flex; gap: 2rem; padding-top: 2.5rem; padding-bottom: 5rem; align-items: flex-start; }
.sidebar { flex: 0 0 280px; background: var(--bg-white); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 4px; }
.sidebar-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-main); border-bottom: 2px solid var(--bg-light); padding-bottom: 0.8rem;}
.sidebar-menu li { margin-bottom: 0.3rem; }
.sidebar-menu a { display: flex; justify-content: space-between; align-items: center; color: var(--text-main); font-size: 0.95rem; padding: 0.6rem 0.8rem; border-radius: 6px; transition: background 0.2s; }
.sidebar-menu a:hover { background: var(--bg-light); color: var(--primary); font-weight: 500;}
.sidebar-menu .count { color: var(--text-muted); font-size: 0.8rem; background: var(--bg-light); padding: 0.2rem 0.6rem; border-radius: 20px; }
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Breadcrumbs */
.breadcrumbs { display: flex; gap: 0.5rem; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; flex-wrap: wrap; }
.breadcrumbs a { color: var(--primary); }
.breadcrumbs .separator { margin: 0 0.2rem; }

/* Main Content Styles */
.page-title { font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-main); }
.info-box { background: var(--bg-white); padding: 2.5rem; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid var(--border); }

/* Grid & Product Card */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.product-card { background-color: var(--bg-white); border: 1px solid var(--border); border-radius: 12px; padding: 1.2rem; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s; position: relative;}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px -8px rgba(0,0,0,0.15); border-color: #cbd5e1; z-index: 2;}
.product-img-wrap { height: 200px; display: flex; align-items: center; justify-content: center; margin-bottom: 1.2rem; }
.product-img-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-title-card { font-size: 0.95rem; font-weight: 600; color: var(--text-main); line-height: 1.4; margin-bottom: 0.8rem; }
.product-meta-card { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.4;}
.product-price-wrap { margin-top: auto; display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap;}
.price { font-size: 1.4rem; font-weight: 700; color: var(--text-main); }
.old-price { font-size: 0.9rem; color: var(--text-muted); text-decoration: line-through; }
.btn { display: inline-block; padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 600; text-align: center; cursor: pointer; border: none; transition: background 0.2s; font-size: 1rem; }
.btn-primary { background-color: var(--primary); color: white; width: 100%; margin-top: 1rem; }
.btn-primary:hover { background-color: var(--primary-hover); color: white; }

/* Product Page Setup */
.product-details { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; background: var(--bg-white); padding: 3rem; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid var(--border);}
.product-details-img { display: flex; justify-content: center; align-items: flex-start; position: sticky; top: 100px; }
.product-details-img img { max-width: 100%; max-height: 450px; object-fit: contain; }
.product-details h1 { font-size: 2rem; margin-bottom: 1rem; line-height: 1.3; }
.availability { color: #16a34a; font-weight: 600; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem;}

/* Pagination - FIXED MARGINS */
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin-top: 3rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-link { display: flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 0.5rem; border-radius: 8px; background: var(--bg-white); border: 1px solid var(--border); color: var(--text-main); font-weight: 500; transition: all 0.2s; }
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background-color: var(--primary); color: white; border-color: var(--primary); }
.page-link.disabled { background: transparent; border: none; cursor: default; }

/* Footer */
footer { background-color: #111827; color: #d1d5db; padding: 4rem 0 2rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2.5rem; margin-bottom: 3rem; }
.footer-col h3 { color: #ffffff; font-size: 1.2rem; margin-bottom: 1.2rem; }
.footer-col a { color: #9ca3af; display: block; margin-bottom: 0.8rem; }
.footer-col a:hover { color: #ffffff; text-decoration: underline; }
.footer-bottom { text-align: center; padding-top: 2rem; border-top: 1px solid #374151; font-size: 0.9rem; color: #6b7280; }

/* Mobile Adaptability */
@media (max-width: 1024px) {
    .product-details { grid-template-columns: 1fr; gap: 2rem; padding: 1.5rem; }
    .product-details-img { position: static; }
}
@media (max-width: 900px) {
    .page-layout { flex-direction: column; padding-top: 1.5rem; }
    .sidebar { display: none; } /* Скрываем боковое меню на мобильных, так как есть кнопка сверху */
}
@media (max-width: 768px) {
    .hamburger { display: block; }
    .nav-wrapper { display: none; }
    
    .menu-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 998; display: none; }
    #menu-toggle:checked ~ .menu-backdrop { display: block; }
    #menu-toggle:checked ~ .nav-wrapper {
        display: flex; flex-direction: column; position: fixed; top: 0; left: 0; width: 280px; height: 100vh;
        background: var(--bg-white); z-index: 999; padding: 2rem 1.5rem; box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        align-items: flex-start; overflow-y: auto; gap: 2rem;
    }
    .nav-menu { flex-direction: column; align-items: flex-start; width: 100%; gap: 0; }
    .nav-menu > a, .dropdown { width: 100%; padding: 1rem 0; border-bottom: 1px solid var(--border); }
    .dropdown-content { position: static; box-shadow: none; border: none; border-left: 2px solid var(--border); border-radius: 0; padding: 0.5rem 0 0 1rem; display: block; }
    .header-actions { flex-direction: column; align-items: flex-start; width: 100%; gap: 1rem; padding-top: 1rem; border-left: none; padding-left: 0;}
}
