/* ===========================================
   Catálogo Kyocera - Estilos CSS
   =========================================== */

/* Variables de diseño */
:root {
  --primary: #c8102e;
  --primary-dark: #a00d25;
  --secondary: #1a1a2e;
  --background: #f8f9fa;
  --card-bg: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #6c757d;
  --border: #e9ecef;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 12px;
}

/* Reset y base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ===========================================
   Header
   =========================================== */
.header {
  background: linear-gradient(135deg, var(--secondary) 0%, #2d2d4a 100%);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
}

.logo-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-text span {
  font-size: 0.8rem;
  opacity: 0.8;
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ===========================================
   Buscador
   =========================================== */
.search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  gap: 8px;
  transition: background 0.2s ease;
}

.search-box:focus-within {
  background: rgba(255, 255, 255, 0.15);
}

.search-box input {
  background: transparent;
  border: none;
  color: white;
  outline: none;
  width: 200px;
  font-size: 0.9rem;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* ===========================================
   Navegación de Categorías
   =========================================== */
.nav-categories {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 2rem;
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.nav-inner::-webkit-scrollbar {
  height: 4px;
}

.nav-inner::-webkit-scrollbar-track {
  background: transparent;
}

.nav-inner::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-link.active {
  background: var(--primary);
  color: white;
}

.nav-link .count {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.nav-link.active .count {
  background: rgba(255, 255, 255, 0.3);
}

/* ===========================================
   Contenido Principal
   =========================================== */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ===========================================
   Grid de Productos
   =========================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ===========================================
   Tarjeta de Producto
   =========================================== */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.product-image-container {
  width: 100%;
  height: 240px;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 15px;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.product-image-placeholder svg {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.product-image-placeholder span {
  font-size: 0.8rem;
  opacity: 0.7;
}

.product-content {
  padding: 1.25rem;
}

.product-category {
  display: inline-block;
  padding: 4px 10px;
  background: var(--background);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.product-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.product-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* ===========================================
   Especificaciones del Producto
   =========================================== */
.product-specs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.spec-label {
  color: var(--text-secondary);
}

.spec-value {
  font-weight: 500;
  color: var(--text-primary);
}

/* ===========================================
   Footer de Producto
   =========================================== */
.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1.2rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-contact:hover {
  background: var(--primary-dark);
}

.product-footer {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-whatsapp,
.btn-mercado {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: 0.3s ease;
}

.btn-whatsapp {
  background: #25d366;
  color: white;
}

.btn-whatsapp:hover {
  background: #1ebe5d;
}

.btn-mercado {
  background: #ffe600;
  color: #333;
}

.btn-mercado:hover {
  background: #f5d900;
}

/* ===========================================
   Estado Vacío
   =========================================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* ===========================================
   Footer
   =========================================== */
.footer {
  background: var(--secondary);
  color: white;
  padding: 2rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.footer-section p,
.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.8;
  text-decoration: none;
  display: block;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  max-width: 1400px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

/* ===========================================
   Responsive Design
   =========================================== */
@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .search-box input {
    width: 150px;
  }

  .main-content {
    padding: 1rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .nav-categories {
    padding: 0.5rem 1rem;
  }

  .product-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .btn-contact {
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .logo-text h1 {
    font-size: 1.2rem;
  }

  .logo-text span {
    font-size: 0.7rem;
  }

  .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .page-title {
    font-size: 1.25rem;
  }
}

/* ===========================================
   Animaciones
   =========================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeIn 0.3s ease forwards;
}

.products-grid .product-card:nth-child(1) {
  animation-delay: 0.05s;
}
.products-grid .product-card:nth-child(2) {
  animation-delay: 0.1s;
}
.products-grid .product-card:nth-child(3) {
  animation-delay: 0.15s;
}
.products-grid .product-card:nth-child(4) {
  animation-delay: 0.2s;
}
.products-grid .product-card:nth-child(5) {
  animation-delay: 0.25s;
}
.products-grid .product-card:nth-child(6) {
  animation-delay: 0.3s;
}
