/* ==========================================================================
   Mundial Products - Style System (Fondo Blanco Estilo Wallapop)
   WhatsApp de Empresa: +34 632 92 69 31
   ========================================================================== */

:root {
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Palette */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-pill: #f1f5f9;
  
  --brand-color: #13ac97; /* Wallapop Teal */
  --brand-hover: #0e8777;
  --brand-light: #e6f7f4;
  --brand-dark: #0a4f46;
  
  --text-main: #000000; /* Texto principal negro puro */
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-focus: #13ac97;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 16px 32px -8px rgba(0,0,0,0.12);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.navbar-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Logo "Mundial Products" en texto negro limpio */
.brand-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #000000;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.6px;
  color: #000000;
  line-height: 1;
}

.search-box {
  flex: 1;
  max-width: 580px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 11px 42px 11px 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(19, 172, 151, 0.12);
}

.clear-search {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-whatsapp-nav {
  background-color: #25d366;
  color: #ffffff;
  font-weight: 700;
}

.btn-whatsapp-nav:hover {
  background-color: #1ebc57;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-primary {
  background-color: var(--brand-color);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--brand-hover);
  box-shadow: 0 4px 14px rgba(19, 172, 151, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: #000000;
}

.btn-outline:hover {
  background-color: var(--bg-secondary);
  border-color: var(--text-muted);
}

.btn-secondary {
  background-color: var(--bg-pill);
  color: #000000;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-whatsapp {
  background-color: #25d366;
  color: #ffffff;
  font-weight: 700;
}

.btn-whatsapp:hover {
  background-color: #1ebc57;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-block {
  width: 100%;
}

/* Categorias Bar */
.categories-bar {
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
}

.categories-bar::-webkit-scrollbar {
  display: none;
}

.categories-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.cat-pill:hover {
  background-color: #e2e8f0;
  color: #000000;
}

.cat-pill.active {
  background-color: var(--brand-light);
  border-color: var(--brand-color);
  color: var(--brand-dark);
  font-weight: 700;
}

/* Banner Informativo */
.store-banner {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 32px 24px;
}

.banner-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.banner-info {
  max-width: 680px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--brand-light);
  color: var(--brand-dark);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.banner-info h1 {
  font-size: 26px;
  font-weight: 800;
  color: #000000;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.banner-info p {
  color: var(--text-muted);
  font-size: 14px;
}

.banner-contacts {
  display: flex;
  align-items: center;
  gap: 20px;
}

.whatsapp-pill {
  padding: 12px 22px;
  font-size: 14px;
}

.banner-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-left: 20px;
  border-left: 2px solid var(--border-color);
}

.banner-stat strong {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-color);
  line-height: 1;
}

.banner-stat span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Main Content */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  flex: 1;
  width: 100%;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.results-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.results-info h2 {
  font-size: 20px;
  font-weight: 700;
  color: #000000;
}

.count-badge {
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.sort-wrapper select {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  color: #000000;
  cursor: pointer;
  outline: none;
}

.sort-wrapper select:focus {
  border-color: var(--brand-color);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* Product Card */
.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(19, 172, 151, 0.4);
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 75%;
  background-color: #f1f5f9;
  overflow: hidden;
}

.card-image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.product-card:hover .card-image-wrapper img {
  transform: scale(1.04);
}

.card-condition-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  color: #000000;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.card-reserved-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #ffc107;
  color: #000000;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 10px rgba(255, 193, 7, 0.4);
  z-index: 10;
}

.detail-reserved-badge {
  background-color: #ffc107 !important;
  color: #000000 !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.card-category-tag {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.card-photos-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.card-price {
  font-size: 22px;
  font-weight: 800;
  color: #000000;
  letter-spacing: -0.5px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-location {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-card-buy {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-full);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
  margin-top: 24px;
}

.empty-icon {
  font-size: 48px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-height: 94vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  font-size: 22px;
  color: #000000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.modal-close:hover {
  background: #f1f5f9;
}

/* Detail Modal */
.detail-card {
  max-width: 1080px;
}

.detail-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

.detail-gallery-section {
  display: flex;
  flex-direction: column;
  background-color: #f8fafc;
  border-right: 1px solid var(--border-color);
  position: relative;
}

.detail-image-wrapper {
  position: relative;
  background-color: #ffffff;
  min-height: 480px;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}

.detail-image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.zoom-hint-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  pointer-events: none;
  z-index: 10;
}

/* Lupa de Zoom en Hover */
.zoom-lens {
  position: absolute;
  width: 130px;
  height: 130px;
  border: 2px solid var(--brand-color);
  background: rgba(19, 172, 151, 0.15);
  border-radius: 50%;
  cursor: crosshair;
  pointer-events: none;
  display: none;
  box-shadow: 0 0 12px rgba(19, 172, 151, 0.3);
  z-index: 15;
}

.zoom-result {
  position: absolute;
  inset: 0;
  z-index: 25;
  background-color: #ffffff;
  background-repeat: no-repeat;
  background-size: 250%;
  display: none;
  pointer-events: none;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

.detail-condition-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background-color: var(--brand-color);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  z-index: 10;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #000000;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gallery-nav:hover {
  background: #ffffff;
  transform: translateY(-50%) scale(1.1);
  color: var(--brand-color);
}

.gallery-prev {
  left: 16px;
}

.gallery-next {
  right: 16px;
}

.gallery-counter {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  z-index: 10;
}

.gallery-thumbnails {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  overflow-x: auto;
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  scrollbar-width: thin;
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.65;
  transition: var(--transition);
  flex-shrink: 0;
}

.gallery-thumb:hover {
  opacity: 1;
}

.gallery-thumb.active {
  border-color: var(--brand-color);
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(19, 172, 151, 0.2);
}

.detail-info {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
}

.detail-category {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--brand-color);
  margin-bottom: 6px;
}

.detail-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  color: #000000;
}

.detail-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.detail-price {
  font-size: 34px;
  font-weight: 800;
  color: var(--brand-color);
}

.detail-seller {
  font-size: 13px;
  color: var(--text-muted);
}

.detail-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 16px 0;
}

.detail-info h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #000000;
}

.detail-description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  white-space: pre-line;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

/* Lightbox Fullscreen HD Overlay */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 3010;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

.lightbox-content {
  max-width: 90vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  border-radius: 8px;
}

.lightbox-controls {
  position: absolute;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(15, 23, 42, 0.8);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.lightbox-controls button {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 10px;
  transition: var(--transition);
}

.lightbox-controls button:hover {
  color: var(--brand-color);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--text-main);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 4000;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast i {
  color: #25d366;
}

/* Footer */
.footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  margin-top: auto;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.footer-brand p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.footer-whatsapp {
  margin-top: 12px;
}

.footer-wa-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #25d366;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

.footer-wa-link:hover {
  text-decoration: underline;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-light);
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  width: 100%;
}

/* Responsive Queries */
@media (max-width: 900px) {
  .detail-body {
    grid-template-columns: 1fr;
  }

  .detail-gallery-section {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .detail-image-wrapper {
    min-height: 360px;
    height: 360px;
  }
}

@media (max-width: 768px) {
  .navbar-container {
    padding: 10px 16px;
    flex-wrap: wrap;
  }

  .search-box {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .btn-text {
    display: none;
  }

  .banner-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .banner-stat {
    border-left: none;
    padding-left: 0;
    align-items: flex-start;
  }
}
