*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* COLOR SEC: #143FA5 */

:root {
  --bg:           #000000;
  --surface:      #111111;
  --card:         #1a1a1a;
  --nav:          #2b2d30;
  --accent:       #fff; /* COLOR ECOMMERCE */ /*OLD: 0565C3*/
  --accent-hover: #143FA5; /* COLOR ECOMMERCE HOVER */
  --text:         #ffffff;
  --text-muted:   #aaaaaa;
  --text-dim:     #555555;
  --border:       #2a2a2a;
}

html, body {
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* ── Bubble Navbar ───────────────────────────────────────── */
.bubble-nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  background-color: var(--nav);
  border-radius: 9999px;
  padding: 7px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 100;
  overflow: visible;
}

.nav-brand {
  display: block;
  text-decoration: none;
  position: relative;
  width: 150px;
  height: 24px;
}

.nav-logo {
  position: absolute;
  left: 0;
  top: 50%;
  height: 100px;
  width: auto;
  transform: translateY(-50%);
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Categorías dropdown ── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger[aria-expanded="true"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-arrow {
  transition: transform 0.2s;
  flex-shrink: 0;
}

.nav-dropdown-trigger[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  background: var(--nav);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  list-style: none;
  padding: 6px;
  min-width: 190px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 200;
}

.nav-dropdown-menu.open {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 9px 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.dropdown-item.active-category {
  color: var(--accent);
}

/* ── Buscador ── */
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 340px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 7px 16px;
  transition: border-color 0.2s, background 0.2s;
}

.nav-search:focus-within {
  border-color: rgba(154, 237, 182, 0.4);
  background: rgba(255, 255, 255, 0.09);
}

.search-icon {
  color: var(--text-dim);
  flex-shrink: 0;
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.875rem;
  width: 100%;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input::-webkit-search-cancel-button {
  filter: invert(0.5);
  cursor: pointer;
}

/* ── Carrito ── */
.nav-cart {
  position: relative;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.nav-cart:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.18);
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent);
  color: #000000;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9999px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

.cart-badge.visible {
  display: flex;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Nav usuario logueado ────────────────────────────────── */
.user-menu-wrap {
  position: relative;
}
.nav-btn--user {
  background-color: transparent;
  color: var(--text);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.nav-btn--user:hover {
  background-color: rgba(255, 255, 255, 0.07);
  transform: none;
}
.user-dropdown {
  display: none;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  min-width: 170px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.user-dropdown.open { display: flex; }
.user-dropdown-item {
  display: block;
  padding: 9px 13px;
  border-radius: 7px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s;
}
.user-dropdown-item:hover { background: rgba(255, 255, 255, 0.08); }
.user-dropdown-logout { color: #f87171; }
.user-dropdown-logout:hover { background: rgba(248, 113, 113, 0.08); }

.nav-btn {
  background-color: var(--accent);
  color: #000000;
  border: none;
  border-radius: 9999px;
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.nav-btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

/* ── Carousel ────────────────────────────────────────────── */
.carousel-section {
  width: 100%;
}

.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.slide-1 {
  background: linear-gradient(135deg, #050d1a 0%, #0d1f3c 55%, #143458 100%);
}
.slide-1::after {
  content: '';
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(20, 80, 160, 0.45) 0%, transparent 70%);
  pointer-events: none;
}

.slide-2 {
  background: linear-gradient(135deg, #120400 0%, #2e0d00 55%, #5c2000 100%);
}
.slide-2::after {
  content: '';
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(180, 60, 0, 0.4) 0%, transparent 70%);
  pointer-events: none;
}

.slide-3 {
  background: linear-gradient(135deg, #080012 0%, #150025 55%, #2a0050 100%);
}
.slide-3::after {
  content: '';
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(80, 0, 180, 0.4) 0%, transparent 70%);
  pointer-events: none;
}

.slide-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 5%;
  padding-top: 80px;
}

.slide-tag {
  display: inline-block;
  background: rgba(154, 237, 182, 0.1);
  color: var(--accent);
  border: 1px solid rgba(154, 237, 182, 0.25);
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}

.slide-content h2 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 16px;
  max-width: 580px;
  letter-spacing: -0.02em;
}

.slide-content p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 460px;
}

.slide-btn {
  background: var(--accent);
  color: #000000;
  border: none;
  border-radius: 9999px;
  padding: 14px 34px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.slide-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(154, 237, 182, 0.25);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.8rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-50%) scale(1.07);
}

.carousel-btn.prev { left: 24px; }
.carousel-btn.next { right: 24px; }

.carousel-dots {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.dot {
  height: 8px;
  width: 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  cursor: pointer;
  transition: background 0.3s, width 0.3s;
  padding: 0;
}

.dot.active {
  background: var(--accent);
  width: 28px;
}

/* ── Products Section ────────────────────────────────────── */
.products-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 5% 100px;
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 40px;
  letter-spacing: -0.01em;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--accent);
  margin-top: 10px;
  border-radius: 2px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ── Product Card ────────────────────────────────────────── */
.product-card {
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  border-color: #3a3a3a;
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 1;
}

.badge-sale {
  background: var(--accent);
  color: #000000;
}

.badge-new {
  background: #60a5fa;
  color: #000000;
}

.badge-urgent {
  background: #f97316;
  color: #000000;
}

.product-image-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

.product-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.product-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.product-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.55;
  flex: 1;
}

.product-pricing {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.product-original {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: line-through;
}

.product-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.add-to-cart {
  margin-top: 12px;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(154, 237, 182, 0.35);
  color: var(--accent);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.add-to-cart:hover {
  background: var(--accent-hover);
  color: #ffffff;
  border-color: var(--accent-hover);
}

.add-to-cart:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not([disabled]) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.page-btn.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #000000;
  font-weight: 700;
  cursor: default;
}

.page-btn.page-nav {
  font-size: 1.2rem;
  font-weight: 400;
}

.page-btn[disabled] {
  opacity: 0.3;
  cursor: default;
}

.page-ellipsis {
  color: var(--text-dim);
  font-size: 0.875rem;
  min-width: 28px;
  text-align: center;
  user-select: none;
}

/* ── Skeleton Loading ────────────────────────────────────── */
.skeleton {
  border-radius: 14px;
  height: 320px;
  background: linear-gradient(90deg, #1a1a1a 25%, #242424 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Product Card Link ───────────────────────────────────── */
.product-card-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.product-card-footer {
  padding: 0 16px 16px;
}

/* ── Cart Drawer ─────────────────────────────────────────── */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100vw;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 500;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-drawer-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.cart-drawer-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: color 0.2s, background 0.2s;
}

.cart-drawer-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.cart-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 40px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.cart-item-image {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 7px;
  background: var(--surface);
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.cart-item-qty {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.cart-item-remove:hover {
  color: #f87171;
}

.cart-drawer-footer {
  padding: 16px 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.cart-drawer-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.cart-checkout-btn {
  width: 100%;
  background: #25D366;
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.cart-checkout-btn:hover {
  background: #1ebe5b;
  transform: translateY(-1px);
}

.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 499;
  display: none;
}

.cart-drawer-overlay.visible {
  display: block;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-search { display: none; }
  .nav-brand { width: 150px; height: 24px; }
  .nav-logo { height: 150px; transform: translateY(-50%); }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }

  .carousel-btn.prev { left: 12px; }
  .carousel-btn.next { right: 12px; }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}
