/* ============================================
   lan-computers.bg — Основен CSS
   Цветова схема: Синьо #016fb7, Червено #e20a17
   ============================================ */

:root {
  --primary: #016fb7;
  --primary-light: #016fb720;
  --primary-hover: #0158a0;
  --danger: #e20a17;
  --danger-hover: #c5000d;
  --dark: #1a1a2e;
  --gray: #4d4d4d;
  --gray-light: #e8e8e8;
  --success: #638f00;
  --gold: #ca9038;
  --white: #ffffff;
  --font-main: 'Open Sans', sans-serif;
  --font-heading: 'Montserrat', sans-serif;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 6px;
}

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

body {
  font-family: var(--font-main);
  color: var(--gray);
  background: #f5f5f5;
  font-size: 14px;
}

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

img { max-width: 100%; }

/* ============================================
   TOP BAR
   ============================================ */
#top-bar {
  background: var(--dark);
  color: #ccc;
  font-size: 12px;
  padding: 6px 0;
}

#top-bar a { color: #ccc; }
#top-bar a:hover { color: #fff; }
#top-bar .top-bar-info { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
#top-bar .top-bar-right { display: flex; gap: 15px; align-items: center; }

/* ============================================
   HEADER
   ============================================ */
#main-header {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
}

#site-logo {
  flex-shrink: 0;
}

#site-logo img {
  height: 50px;
  width: auto;
}

#site-logo .logo-text {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

#site-logo .logo-text span {
  color: var(--danger);
}

#site-logo .logo-slogan {
  font-size: 10px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#header-search {
  flex: 1;
}

#header-search form {
  display: flex;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  overflow: hidden;
}

#header-search input {
  flex: 1;
  border: none;
  padding: 10px 15px;
  font-size: 14px;
  outline: none;
}

#header-search button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}

#header-search button:hover { background: var(--primary-hover); }

#header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.header-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--gray);
  font-size: 11px;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: all 0.2s;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.header-action-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.header-action-btn i { font-size: 20px; }

.cart-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   NAVIGATION
   ============================================ */
#main-nav {
  background: var(--primary);
}

#main-nav .nav-inner {
  display: flex;
  align-items: center;
}

#main-nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

#main-nav ul li {
  position: relative;
}

#main-nav ul li a {
  display: block;
  color: #fff;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-heading);
  transition: background 0.2s;
  white-space: nowrap;
}

#main-nav ul li a:hover,
#main-nav ul li.active a {
  background: var(--primary-hover);
  color: #fff;
}

/* Dropdown */
#main-nav ul li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
  min-width: 220px;
  z-index: 999;
  flex-direction: column;
  border-top: 3px solid var(--primary);
}

#main-nav ul li:hover > ul { display: flex; }

#main-nav ul li ul li a {
  color: var(--gray);
  padding: 10px 16px;
  font-size: 13px;
}

#main-nav ul li ul li a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Mobile hamburger */
#nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 10px 15px;
}

/* ============================================
   HERO / SLIDER
   ============================================ */
#hero-slider {
  position: relative;
  overflow: hidden;
  background: var(--dark);
}

.slide {
  display: none;
  position: relative;
}

.slide.active { display: block; }

.slide img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.slide-content {
  position: absolute;
  top: 50%;
  left: 8%;
  transform: translateY(-50%);
  color: #fff;
  max-width: 500px;
}

.slide-content h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

.slide-content p {
  font-size: 16px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.slide-nav {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.slide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.slide-dot.active { background: #fff; }

.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.slide-arrow:hover { background: rgba(0,0,0,0.7); }
.slide-arrow.prev { left: 15px; }
.slide-arrow.next { right: 15px; }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary-custom {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-block;
  text-align: center;
}

.btn-primary-custom:hover { background: var(--primary-hover); color: #fff; }

.btn-danger-custom {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-block;
  text-align: center;
}

.btn-danger-custom:hover { background: var(--danger-hover); color: #fff; }

.btn-outline-custom {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 9px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
  text-align: center;
}

.btn-outline-custom:hover {
  background: var(--primary);
  color: #fff;
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.product-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.product-card-image {
  position: relative;
  background: #f9f9f9;
  padding: 15px;
  text-align: center;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-image img {
  max-height: 150px;
  width: auto;
  object-fit: contain;
}

.product-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}

.product-card-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
  flex: 1;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-title a { color: var(--dark); }
.product-card-title a:hover { color: var(--primary); }

.product-card-price {
  margin-bottom: 10px;
}

.price-current {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.price-old {
  font-size: 12px;
  color: #999;
  text-decoration: line-through;
  margin-left: 6px;
}

.price-save {
  font-size: 11px;
  color: var(--success);
  font-weight: 600;
}

.product-card-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--gray-light);
  display: flex;
  gap: 8px;
}

.product-card-footer .btn-primary-custom {
  flex: 1;
  font-size: 12px;
  padding: 8px;
}

.stock-badge {
  font-size: 11px;
  font-weight: 600;
}

.in-stock { color: var(--success); }
.out-of-stock { color: #999; }

/* ============================================
   SECTIONS
   ============================================ */
.section-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  padding-bottom: 10px;
  border-bottom: 3px solid var(--primary);
  display: inline-block;
  margin-bottom: 20px;
}

.section-wrapper {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 25px;
}

/* ============================================
   CATEGORY ICONS
   ============================================ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.category-card {
  background: #fff;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius);
  padding: 20px 10px;
  text-align: center;
  transition: all 0.2s;
  color: var(--gray);
}

.category-card:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.category-card i { font-size: 32px; display: block; margin-bottom: 8px; }
.category-card span { font-size: 12px; font-weight: 600; }

/* ============================================
   FOOTER
   ============================================ */
#main-footer {
  background: var(--dark);
  color: #aaa;
  margin-top: 40px;
}

.footer-top {
  padding: 40px 0 30px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
}

.footer-col h5 {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.footer-col p, .footer-col a {
  font-size: 13px;
  color: #aaa;
  line-height: 2;
  display: block;
}

.footer-col a:hover { color: #fff; }

.footer-info-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
}

.footer-info-item i { color: var(--primary); font-size: 16px; flex-shrink: 0; margin-top: 2px; }

.footer-social { display: flex; gap: 10px; margin-top: 15px; }

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  transition: background 0.2s;
}

.footer-social a:hover { background: var(--primary); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 15px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

/* ============================================
   CART SIDEBAR
   ============================================ */
#cart-sidebar {
  position: fixed;
  right: -380px;
  top: 0;
  width: 380px;
  height: 100%;
  background: #fff;
  z-index: 9999;
  box-shadow: -5px 0 30px rgba(0,0,0,0.2);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

#cart-sidebar.open { right: 0; }

.cart-sidebar-header {
  background: var(--primary);
  color: #fff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-sidebar-header h5 { margin: 0; font-family: var(--font-heading); }

#cart-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.cart-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-light);
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border: 1px solid var(--gray-light);
  border-radius: 4px;
  padding: 4px;
}

.cart-item-info { flex: 1; }
.cart-item-name { font-size: 12px; font-weight: 600; color: var(--dark); margin-bottom: 5px; }
.cart-item-price { font-size: 14px; font-weight: 700; color: var(--primary); }

.cart-sidebar-footer {
  padding: 15px 20px;
  border-top: 2px solid var(--gray-light);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--dark);
}

.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
}

.cart-overlay.open { display: block; }

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb-wrapper {
  background: #fff;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-light);
  margin-bottom: 20px;
}

.breadcrumb { margin: 0; }
.breadcrumb-item a { color: var(--primary); font-size: 13px; }
.breadcrumb-item.active { color: var(--gray); font-size: 13px; }

/* ============================================
   SIDEBAR / FILTERS
   ============================================ */
.filter-sidebar {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.filter-section {
  border-bottom: 1px solid var(--gray-light);
  padding: 15px;
}

.filter-section:last-child { border-bottom: none; }

.filter-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--dark);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

/* ============================================
   PRODUCT DETAIL
   ============================================ */
.product-detail-image {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.product-detail-main-img {
  max-height: 350px;
  object-fit: contain;
  margin-bottom: 15px;
}

.product-thumbnails {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.product-thumbnail {
  width: 65px;
  height: 65px;
  object-fit: contain;
  border: 2px solid var(--gray-light);
  border-radius: 4px;
  padding: 4px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.product-thumbnail:hover, .product-thumbnail.active {
  border-color: var(--primary);
}

.product-detail-info {
  background: #fff;
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
}

.product-detail-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 15px;
  line-height: 1.4;
}

.product-detail-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
}

.product-detail-price .old-price {
  font-size: 16px;
  color: #999;
  text-decoration: line-through;
  margin-left: 10px;
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 991px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .header-inner {
    flex-wrap: wrap;
  }
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 767px) {
  #top-bar { display: none; }

  .header-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
  }

  #site-logo .logo-text { font-size: 18px; }

  #header-search { order: 3; width: 100%; }

  #header-actions { gap: 5px; }
  .header-action-btn { padding: 6px 8px; font-size: 10px; }
  .header-action-btn i { font-size: 18px; }

  #main-nav ul { display: none; flex-direction: column; width: 100%; }
  #main-nav ul.open { display: flex; }
  #nav-toggle { display: block; }
  #main-nav ul li ul { position: static; box-shadow: none; border: none; background: rgba(255,255,255,0.1); }
  #main-nav ul li ul li a { color: rgba(255,255,255,0.8); padding-left: 30px; }

  .slide img { height: 200px; }
  .slide-content h2 { font-size: 18px; }
  .slide-content p { font-size: 13px; }

  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 25px 0;
  }

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

  #cart-sidebar { width: 100%; right: -100%; }

  .product-detail-price { font-size: 22px; }
}

/* ============================================
   ADMIN OVERRIDES (базов стил)
   ============================================ */
.admin-body {
  background: #f0f2f5;
}

.admin-sidebar {
  background: var(--dark);
  min-height: 100vh;
  width: 240px;
  position: fixed;
  top: 0;
  left: 0;
}

.admin-content {
  margin-left: 240px;
  padding: 25px;
  min-height: 100vh;
}

@media (max-width: 767px) {
  .admin-sidebar { display: none; }
  .admin-content { margin-left: 0; }
}
