/* Reset & Base Variables */
:root {
  --primary-color: #000000;
  --text-color: #1a1a1a;
  --text-light: #666666;
  --bg-color: #FFFFFF;
  --border-color: #e5e5e5;
  --hover-bg: #f8f8f8;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  
  --transition: all 0.2s ease-in-out;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }

.container {
  width: 95%;
  max-width: 1400px;
  margin: 0 auto;
}

.text-center { text-align: center; }

/* Header & Nav */
header {
  position: sticky;
  top: 0;
  background: var(--bg-color);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-links a:hover { color: var(--text-light); }

/* Banner / Hero */
.hero-banner {
  width: 100%;
  height: 60vh;
  min-height: 400px;
  background-color: #f1f1f1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.hero-banner h1 {
  font-size: 3rem;
  text-transform: uppercase;
  font-weight: 900;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.btn {
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  padding: 12px 30px;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1px;
  border: 1px solid var(--primary-color);
  cursor: pointer;
}

.btn:hover {
  background: transparent;
  color: var(--primary-color);
}

.btn-sm {
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  padding: 8px 14px;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  border: 1px solid var(--primary-color);
  cursor: pointer;
  transition: var(--transition);
}
.btn-sm:hover {
  background: transparent;
  color: var(--primary-color);
}

/* Mobile Nav */
@media (max-width: 640px) {
  .nav-links {
    gap: 1rem;
  }
  .nav-links a {
    font-size: 0.75rem;
  }
}

/* Catalog Title */
.catalog-header {
  margin: 3rem 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}
.catalog-header h2 { text-transform: uppercase; font-size: 1.5rem; font-weight: 800; }

/* Grid & Product Card (Basket Capital Style) */
/* Filter Buttons */
.filter-btn {
  padding: 8px 18px;
  border: 1px solid var(--border-color);
  background: transparent;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-light);
}
.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.filter-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
}
.product-card:hover .product-img { opacity: 0.85; }

.product-img-wrapper {
  background: #f9f9f9;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: var(--transition);
  padding: 1rem;
}

.badge-top {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary-color);
  color: #fff;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
}

/* Product Info Layout (Price to the rigth) */
.product-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.product-details { flex: 1; }

.product-brand {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.3;
  text-transform: uppercase;
}

.product-price-wrapper {
  text-align: right;
  flex-shrink: 0;
}

.product-price {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--primary-color);
}

.product-details-extra {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.4rem;
}

/* Footer Functional */
footer {
  background: #f8f8f8;
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
}
.footer-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 {
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.footer-col li { margin-bottom: 0.5rem; }
.footer-col li a { font-size: 0.85rem; color: var(--text-light); }
.footer-col li a:hover { color: var(--primary-color); text-decoration: underline; }

.footer-bottom { border-top: 1px solid var(--border-color); padding-top: 2rem; text-align: center; font-size: 0.8rem; color: var(--text-light); }

/* Cart Drawer */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  max-width: 100%;
  height: 100%;
  background: #fff;
  z-index: 1002;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}
.cart-sidebar.open { right: 0; }

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-header h2 { font-size: 1.5rem; font-weight: 800; text-transform: uppercase; margin: 0; }
.cart-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.cart-item img { width: 60px; height: 60px; object-fit: contain; }
.cart-item-details { flex: 1; }
.cart-item-details h4 { font-size: 0.9rem; margin: 0; }
.cart-item-actions { display: flex; align-items: center; gap: 0.5rem; }
.qty-btn { width: 25px; height: 25px; border: 1px solid #ddd; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; }

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
}
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 800; margin-bottom: 1rem; }
.btn-block { width: 100%; padding: 15px; font-size: 1rem; }

/* Header Cart Icon */
.cart-icon-container { position: relative; cursor: pointer; margin-left: 1rem; display: flex; align-items: center; }
.cart-count { 
  position: absolute; 
  top: -8px; 
  right: -12px; 
  background: red; 
  color: white; 
  font-size: 0.7rem; 
  padding: 2px 6px; 
  border-radius: 10px; 
  font-weight: bold; 
}

/* Detalle Producto */
.product-detail-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; margin-top: 1rem; align-items: start; }
@media (max-width: 800px) { .product-detail-layout { grid-template-columns: 1fr; } }
.detail-img-box { background: #f9f9f9; border: 1px solid var(--border-color); border-radius: 8px; padding: 2rem; display: flex; align-items: center; justify-content: center; height: 500px; }
.detail-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: var(--transition); }

/* Ficha tecnica estilo ML */
.tech-specs-box { margin-top: 2rem; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.tech-specs-box h3 { background: #f1f1f1; padding: 1.2rem; margin: 0; font-size: 1.2rem; border-bottom: 1px solid var(--border-color); font-weight: 700; color: #333;}
.tech-specs-box ul { list-style: none; padding: 0; margin: 0; }
.tech-specs-box li { padding: 1rem 1.2rem; border-bottom: 1px solid #e2e8f0; background: #fff; font-size: 0.95rem; display:flex; align-items:flex-start; gap:10px; color: #475569; }
.tech-specs-box li:before { content: "•"; color: var(--primary-color); font-weight: bold; }
.tech-specs-box li:last-child { border-bottom: none; }
.tech-specs-box li:nth-child(even) { background: #f8fafc; }

.detail-title { font-size: 2rem; margin: 0.5rem 0 1.5rem; line-height: 1.1; }
.detail-price { font-size: 2.5rem; font-weight: 300; }

/* Reseñas */
.reviews-section { margin-top: 4rem; border-top: 1px solid var(--border-color); padding-top: 2rem; }
.review-form { background: #f8f8f8; padding: 1.5rem; border-radius: 8px; margin: 1.5rem 0; border: 1px solid var(--border-color); }
.stars-input { font-size: 2rem; color: #ccc; cursor: pointer; user-select: none; margin-bottom: 0.5rem; }
.stars-input span { transition: color 0.2s; }
.stars-input span.hovered { color: #facc15; }
.stars-input span.active { color: #facc15; }
.review-form textarea { width: 100%; padding: 1rem; border: 1px solid #ccc; border-radius: 4px; font-family: inherit; margin-bottom: 1rem; resize: vertical; }

.reviews-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
.review-card { padding: 1.5rem; border: 1px solid #e5e5e5; border-radius: 8px; display: flex; flex-direction: column; gap: 0.5rem; background: #fff; }
.review-stars { color: #facc15; font-size: 1.2rem; margin-bottom: 0.2rem; }
.review-date { font-size: 0.8rem; color: #888; }
.review-text { color: #444; line-height: 1.4; }

/* Horizontal Scroller */
.related-section { margin-top: 3rem; }
.horizontal-scroller { display: flex; overflow-x: auto; gap: 1.5rem; padding-bottom: 2rem; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #ccc transparent; margin-bottom: 3rem; }
.horizontal-scroller::-webkit-scrollbar { height: 8px; }
.horizontal-scroller::-webkit-scrollbar-track { background: transparent; }
.horizontal-scroller::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 4px; }
.horizontal-scroller .product-card { min-width: 250px; scroll-snap-align: start; flex: 0 0 calc(25% - 1rem); }
@media (max-width: 1000px) { .horizontal-scroller .product-card { flex: 0 0 calc(33.3% - 1rem); } }
@media (max-width: 700px) { .horizontal-scroller .product-card { flex: 0 0 calc(50% - 1rem); } }
@media (max-width: 450px) { .horizontal-scroller .product-card { flex: 0 0 80%; } }
