:root {
  --bg-color: #0f1115;
  --panel-bg: rgba(25, 28, 36, 0.6);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 16px;
  --transition: all 0.3s ease;
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

img {
  user-select: none; /* App feel: prevent selecting images */
  -webkit-user-drag: none;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: rgba(15, 17, 21, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo span {
  color: var(--accent);
}

/* Search and Filters */
.search-filter-bar {
  display: flex;
  gap: 15px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.search-form {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.filter-select {
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  cursor: pointer;
  min-width: 200px;
  appearance: none;
}

.btn {
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* Grid de Productos */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.product-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--glass-shadow);
  border-color: rgba(59, 130, 246, 0.3);
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--panel-border);
}

.product-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-category {
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 5px;
}

.product-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #fff;
  line-height: 1.4;
}

.product-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-price {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

/* Producto Detalle */
.product-detail-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 40px 0;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 40px;
  backdrop-filter: blur(10px);
}

.gallery-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.main-image {
  width: 100%;
  height: 400px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
}

.thumbnail-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.thumbnail.active, .thumbnail:hover {
  border-color: var(--accent);
}

.detail-info h1 {
  font-size: 32px;
  margin-bottom: 10px;
  color: #fff;
}

.detail-price {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  margin: 20px 0;
}

.detail-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 30px;
  white-space: pre-wrap;
}

.btn-whatsapp {
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-size: 18px;
}

.btn-whatsapp:hover {
  background: #128C7E;
}

/* Admin Styles (re-ussed partly) */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: var(--panel-bg);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table th, .admin-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--panel-border);
}

.admin-table th {
  background: rgba(0,0,0,0.2);
  font-weight: 600;
  color: #fff;
}

.admin-form {
  background: var(--panel-bg);
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  max-width: 800px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--panel-border);
  color: #fff;
  font-size: 16px;
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.action-btns {
  display: flex;
  gap: 10px;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

.btn-edit {
  background: #f59e0b;
  color: white;
}

.btn-edit:hover {
  background: #d97706;
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding-bottom: 80px; /* Space for the floating button */
  }

  .container {
    padding: 0 15px; /* Edge to edge feel */
  }

  header {
    padding: 12px 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .search-filter-bar {
    flex-direction: column;
    margin: 15px 0;
    gap: 10px;
  }
  
  .search-form {
    width: 100%;
  }

  .search-input, .filter-select {
    padding: 14px 20px;
    font-size: 15px; /* Prevents iOS auto-zoom */
    width: 100%;
  }
  
  /* GRID PARA QUE PAREZCA APP NATIVA (2 Columnas) */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }

  .product-image {
    height: 150px;
  }

  .product-info {
    padding: 10px;
  }

  .product-title {
    font-size: 13px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* App style truncate */
  }

  .product-price {
    font-size: 15px;
  }

  .product-card .btn {
    padding: 8px;
    font-size: 12px;
    width: 100%;
    margin-top: 5px;
  }

  .product-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .product-detail-container {
    grid-template-columns: 1fr;
    padding: 15px;
    border: none;
    background: transparent;
    border-radius: 0;
    margin: 15px 0;
  }

  .main-image {
    height: 300px;
  }

  .detail-info h1 {
    font-size: 24px;
  }

  .detail-price {
    font-size: 28px;
  }
  
  /* Botón Sugerir Flotante estilo APP (FAB) */
  .btn-suggest {
    position: fixed !important;
    bottom: 20px;
    right: 20px;
    border-radius: 50px !important;
    padding: 15px 25px !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    z-index: 1000;
  }
}
