/*
Theme Name: TechStore Dark
Theme URI: https://tutienda.com
Description: Tema oscuro para tienda de tecnología, inspirado en CDR Medios. Compatible con WooCommerce.
Version: 1.0.0
Author: Tu Nombre
Text Domain: techstore-dark
*/

/* ===================== VARIABLES ===================== */
:root {
  --bg-body:      #191919;
  --bg-header:    #111111;
  --bg-card:      #222222;
  --bg-card-hover:#2a2a2a;
  --bg-sidebar:   #1a1a1a;
  --bg-input:     #2c2c2c;
  --accent:       #0078d4;
  --accent-hover: #005fa3;
  --accent2:      #e8a000;
  --text-primary: #eeeeee;
  --text-secondary:#aaaaaa;
  --text-muted:   #666666;
  --border:       #333333;
  --border-light: #3d3d3d;
  --success:      #2ecc71;
  --danger:       #e74c3c;
  --radius:       6px;
  --shadow:       0 2px 12px rgba(0,0,0,0.4);
}

/* ===================== RESET ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: 'Barlow', 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ===================== TOPBAR ===================== */
#topbar {
  background: #0d0d0d;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
#topbar .inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#topbar a { color: var(--text-secondary); }
#topbar a:hover { color: var(--text-primary); }

/* ===================== HEADER ===================== */
#site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 70px;
}
.site-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.site-logo span { color: var(--accent); }

/* Buscador */
.search-bar {
  flex: 1;
  display: flex;
  max-width: 560px;
}
.search-bar input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar button {
  background: var(--accent);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 18px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  transition: background .2s;
}
.search-bar button:hover { background: var(--accent-hover); }

/* Header derecha */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
.header-actions a {
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: color .2s;
}
.header-actions a:hover { color: var(--text-primary); }
.header-actions .icon { font-size: 20px; }
.cart-btn {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: var(--radius);
  flex-direction: row !important;
  gap: 8px !important;
}
.cart-btn:hover { background: var(--accent-hover); color: #fff !important; }
.cart-count {
  background: var(--accent2);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================== NAV CATEGORÍAS ===================== */
#categories-nav {
  background: #141414;
  border-bottom: 1px solid var(--border);
}
.categories-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
}
.categories-inner::-webkit-scrollbar { height: 3px; }
.categories-inner::-webkit-scrollbar-track { background: transparent; }
.categories-inner::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
.cat-nav-item {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all .2s;
  border-bottom: 2px solid transparent;
  position: relative;
}
.cat-nav-item:hover, .cat-nav-item.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* ===================== LAYOUT ===================== */
.site-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

/* ===================== BANNER SLIDER ===================== */
.banner-slider {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
  background: #1a1a2e;
  min-height: 260px;
  display: flex;
  align-items: center;
}
.banner-slide {
  padding: 40px 60px;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 50%, #0d1b2a 100%);
  width: 100%;
}
.banner-slide .tag {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.banner-slide h2 {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.2;
}
.banner-slide p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 15px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  display: inline-block;
  transition: background .2s, transform .1s;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }

/* ===================== SECCIÓN PRODUCTOS ===================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
  display: block;
}
.section-link {
  font-size: 12px;
  color: var(--accent);
}

/* ===================== GRILLA DE PRODUCTOS ===================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

/* WooCommerce overrides */
ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
  gap: 12px !important;
  margin: 0 0 32px !important;
  padding: 0 !important;
  list-style: none !important;
}

ul.products li.product,
.product-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  overflow: hidden !important;
  transition: transform .2s, border-color .2s, box-shadow .2s !important;
  position: relative !important;
}
ul.products li.product:hover,
.product-card:hover {
  transform: translateY(-3px) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 8px 24px rgba(0,120,212,0.15) !important;
  background: var(--bg-card-hover) !important;
}

/* Badge stock */
ul.products li.product .stock-badge,
.product-card .stock-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--success);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 2;
}

/* Imagen */
ul.products li.product a img,
ul.products li.product .woocommerce-loop-product__link img,
.product-card .product-img {
  width: 100% !important;
  height: 160px !important;
  object-fit: contain !important;
  background: #2a2a2a !important;
  padding: 12px !important;
}

/* Info producto */
ul.products li.product .product-info,
.woocommerce-loop-product__title + *,
.product-card .product-info {
  padding: 10px 12px 12px !important;
}
ul.products li.product .brand,
.product-card .brand {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
ul.products li.product .woocommerce-loop-product__title,
.product-card .product-name {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
  line-height: 1.4 !important;
  margin: 0 0 8px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
ul.products li.product .price,
.product-card .product-price {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--accent2) !important;
  display: block !important;
  margin-bottom: 10px !important;
}
ul.products li.product .sku,
.product-card .product-sku {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
ul.products li.product .button,
ul.products li.product a.button,
.product-card .btn-cart {
  display: block !important;
  width: 100% !important;
  background: var(--accent) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--radius) !important;
  padding: 9px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: background .2s !important;
}
ul.products li.product .button:hover,
ul.products li.product a.button:hover,
.product-card .btn-cart:hover {
  background: var(--accent-hover) !important;
  color: #fff !important;
}

/* ===================== SIDEBAR ===================== */
.sidebar-widget {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.widget-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.widget-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.widget-list li:last-child { border-bottom: none; }
.widget-list a { color: var(--text-secondary); }
.widget-list a:hover { color: var(--accent); }
.widget-list .count {
  float: right;
  background: var(--bg-input);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ===================== WOOCOMMERCE GENERAL ===================== */
.woocommerce-breadcrumb {
  color: var(--text-muted) !important;
  font-size: 12px !important;
  margin-bottom: 20px !important;
}
.woocommerce-breadcrumb a { color: var(--text-secondary) !important; }
.woocommerce-notices-wrapper .woocommerce-message {
  background: #1a2a1a !important;
  border: 1px solid var(--success) !important;
  color: var(--success) !important;
  border-radius: var(--radius) !important;
}
.woocommerce-notices-wrapper .woocommerce-error {
  background: #2a1a1a !important;
  border: 1px solid var(--danger) !important;
  color: var(--danger) !important;
  border-radius: var(--radius) !important;
}
select, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], textarea {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius) !important;
  padding: 10px 14px !important;
  outline: none !important;
  width: 100% !important;
  font-size: 14px !important;
  transition: border-color .2s !important;
}
select:focus, input:focus, textarea:focus {
  border-color: var(--accent) !important;
}

/* ===================== FOOTER ===================== */
#site-footer {
  background: #111;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.footer-col ul li {
  margin-bottom: 8px;
}
.footer-col ul a {
  color: var(--text-secondary);
  font-size: 13px;
}
.footer-col ul a:hover { color: var(--text-primary); }
.footer-bottom {
  background: #0d0d0d;
  text-align: center;
  padding: 16px 20px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .header-inner { gap: 12px; height: 60px; }
  .search-bar { max-width: 100%; }
  .header-actions .label { display: none; }
  .banner-slide { padding: 24px; }
  .banner-slide h2 { font-size: 22px; }
  .products-grid, ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 480px) {
  .products-grid, ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}
