/* Gameria Meilisearch - CSS completo */
:root {
  --g: #1D9E75;
  --gl: #E1F5EE;
  --gd: #0F6E56;
  --gm: #9FE1CB;
  --am: #FAEEDA;
  --amd: #854F0B;
}

/* ── Dropdown container ─────────────────────────────── */
#gmei-dropdown {
  display: none;
  position: absolute;
  z-index: 99999;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  overflow: hidden;
  max-height: 880px;
  align-items: stretch;
}
#gmei-dropdown.visible { display: flex; }

/* ── Sidebar filtros ────────────────────────────────── */
.gmei-dd-filters {
  width: 20%;
  flex-shrink: 0;
  border-right: 1px solid #f0f0f0;
  background: #fafafa;
  overflow-y: auto;
  padding: 12px 0;
  max-height: 780px;
}
.gmei-dd-filter-group { padding: 8px 14px 10px; }
.gmei-dd-filter-group + .gmei-dd-filter-group { border-top: 1px solid #eee; }
.gmei-dd-filter-title { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #aaa; margin-bottom: 7px; }
.gmei-pill { display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 20px; background: #fff; color: #555; border: 1px solid #ddd; margin: 2px 2px 2px 0; cursor: pointer; transition: all .15s; user-select: none; }
.gmei-pill:hover { border-color: var(--g); color: var(--gd); }
.gmei-pill.active { background: var(--g); color: #fff; border-color: var(--g); }

/* ── Columna resultados ─────────────────────────────── */
.gmei-dd-results { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-y: auto; overflow-x: hidden; }

.gmei-dd-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 8px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0; gap: 8px; }
.gmei-dd-count { font-size: 12px; color: #aaa; white-space: nowrap; }
.gmei-dd-count strong { color: #333; font-weight: 600; }
.gmei-dd-sort { border: 1px solid #ddd; border-radius: 6px; padding: 4px 8px; font-size: 12px; background: #fff; color: #555; }

/* ── Grid de tarjetas ───────────────────────────────── */
.gmei-dd-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px 12px;
  overflow-y: auto;
  height: 740px;
  flex-shrink: 0;
  align-content: start;
}

.gmei-dd-card {
  display: flex !important;
  flex-direction: column !important;
  border: none;
  overflow: visible;
  background: transparent;
  cursor: pointer;
  padding: 4px;
}
.gmei-dd-card:hover .gmei-dd-card-img { opacity: 0.9; }
.gmei-dd-card.out-of-stock { opacity: .72; }

.gmei-dd-card-img {
  display: block !important;
  height: 140px !important;
  overflow: hidden !important;
  display: block;
  position: relative;
  background: #f7f7f7;
  height: 140px !important;
  overflow: hidden !important;
  text-decoration: none;
}
.gmei-dd-card-img img { position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; object-fit: contain !important; padding: 8px !important; display: block !important; max-width: none !important; }
.gmei-dd-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 36px; color: #ccc; }

.gmei-dd-badge { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.gmei-dd-badge-new { background: var(--gl); color: var(--gd); }
.gmei-dd-badge-pre { background: var(--am); color: var(--amd); }

.gmei-dd-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.gmei-dd-brand { font-size: 11px; color: #aaa; margin-bottom: 3px; }
.gmei-dd-name { font-size: 13px; font-weight: 700; color: #222; line-height: 1.35; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-decoration: none; }
.gmei-dd-name:hover { color: var(--g); }

.gmei-dd-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; border-top: 1px solid #f5f5f5; }
.gmei-dd-price { font-size: 15px; font-weight: 700; color: #222; }

.gmei-dd-btn-add {
  padding: 7px 14px;
  border-radius: 20px;
  background: var(--g);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  line-height: 1;
}
.gmei-dd-btn-add:hover { background: var(--gd); }
.gmei-dd-btn-add:disabled { opacity: .6; cursor: default; }
.gmei-dd-no-stock { font-size: 11px; color: #bbb; font-style: italic; }

/* ── Footer dropdown ────────────────────────────────── */
.gmei-dd-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #f0f0f0; flex-shrink: 0; }
.gmei-dd-pagination { display: flex; gap: 4px; padding: 8px 12px; }
.gmei-dd-page-btn { width: 28px; height: 28px; border: 1px solid #ddd; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.gmei-dd-page-btn:hover { border-color: var(--g); color: var(--g); }
.gmei-dd-page-btn.active { background: var(--g); color: #fff; border-color: var(--g); }
.gmei-dd-ver-todos { display: flex; align-items: center; padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--g); text-decoration: none; white-space: nowrap; transition: background .15s; }
.gmei-dd-ver-todos:hover { background: var(--gl); }

/* ── Panel móvil overlay ────────────────────────────── */
#gmei-mobile-overlay { display: none; position: fixed; inset: 0; z-index: 99998; background: rgba(0,0,0,.35); }
#gmei-mobile-panel { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 99999; background: #fff; border-radius: 16px 16px 0 0; max-height: 85vh; flex-direction: column; overflow: hidden; }
#gmei-mobile-panel.open, #gmei-mobile-overlay.open { display: flex; }
.gmei-mobile-handle { width: 36px; height: 4px; background: #ddd; border-radius: 2px; margin: 10px auto 0; flex-shrink: 0; }
.gmei-mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 8px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0; }
.gmei-mobile-title { font-size: 14px; font-weight: 600; color: #222; }
.gmei-mobile-count { font-size: 12px; color: #aaa; }
.gmei-mobile-actions { display: flex; gap: 8px; padding: 8px 16px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0; }
.gmei-btn-filtros { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 20px; background: var(--g); color: #fff; font-size: 13px; font-weight: 600; border: none; cursor: pointer; flex-shrink: 0; }
.gmei-btn-filtros svg { width: 14px; height: 14px; }
.gmei-mobile-sort { flex: 1; border: 1px solid #ddd; border-radius: 20px; padding: 8px 12px; font-size: 13px; background: #fff; color: #333; appearance: none; }
.gmei-mobile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px 16px; overflow-y: auto; flex: 1; }
.gmei-mobile-card { border: 1px solid #eee; border-radius: 10px; overflow: hidden; text-decoration: none; display: block; color: inherit; transition: border-color .15s; }
.gmei-mobile-card:active { border-color: var(--g); }
.gmei-mobile-card-img { height: 110px; background: #f7f7f7; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.gmei-mobile-card-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.gmei-mobile-card-body { padding: 8px 10px 10px; }
.gmei-mobile-brand { font-size: 10px; color: #aaa; margin-bottom: 2px; }
.gmei-mobile-name { font-size: 12px; font-weight: 600; color: #222; line-height: 1.3; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gmei-mobile-footer { display: flex; align-items: center; justify-content: space-between; }
.gmei-mobile-price { font-size: 13px; font-weight: 700; color: var(--g); }
.gmei-mobile-add { width: 28px; height: 28px; border-radius: 50%; background: var(--g); color: #fff; border: none; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gmei-mobile-ver-todos { display: block; text-align: center; padding: 14px; font-size: 14px; font-weight: 600; color: var(--g); border-top: 1px solid #f0f0f0; text-decoration: none; flex-shrink: 0; background: #fff; }

/* ── Drawer filtros móvil ────────────────────────────── */
#gmei-filter-drawer { display: none; position: fixed; top: 0; left: 0; bottom: 0; width: 80%; max-width: 320px; z-index: 100000; background: #fff; flex-direction: column; overflow: hidden; box-shadow: 4px 0 24px rgba(0,0,0,.15); }
#gmei-filter-drawer.open { display: flex; }
.gmei-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0; }
.gmei-drawer-title { font-size: 16px; font-weight: 700; color: #222; }
.gmei-drawer-close { width: 32px; height: 32px; border-radius: 50%; background: #f0f0f0; border: none; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #555; }
.gmei-drawer-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.gmei-drawer-group { padding: 12px 16px; border-bottom: 1px solid #f5f5f5; }
.gmei-drawer-group-title { font-size: 13px; font-weight: 700; color: #333; margin-bottom: 10px; }
.gmei-drawer-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.gmei-drawer-pill { font-size: 12px; padding: 5px 12px; border-radius: 20px; background: #f5f5f5; color: #444; border: 1px solid #e0e0e0; cursor: pointer; transition: all .15s; }
.gmei-drawer-pill.active { background: var(--g); color: #fff; border-color: var(--g); }
.gmei-drawer-footer { padding: 12px 16px; border-top: 1px solid #f0f0f0; flex-shrink: 0; display: flex; gap: 8px; }
.gmei-drawer-apply { flex: 1; padding: 12px; background: var(--g); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.gmei-drawer-clear { padding: 12px 16px; background: #f0f0f0; color: #555; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; }

/* ── Página de resultados ────────────────────────────── */
.gmei-wrapper { display: flex; gap: 24px; align-items: flex-start; }
.gmei-sidebar { width: 220px; flex-shrink: 0; }
.gmei-content { flex: 1; min-width: 0; }
.gmei-filter-group { border-bottom: 1px solid #f0f0f0; }
.gmei-filter-header { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 10px 0; background: none; border: none; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #888; cursor: pointer; }
.gmei-filter-ico { font-size: 16px; color: #ccc; }
.gmei-filter-body { display: none; padding-bottom: 10px; }
.gmei-filter-body.open { display: block; }
.gmei-filter-opt { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; cursor: pointer; color: #333; }
.gmei-filter-opt input[type=checkbox] { accent-color: var(--g); }
.gmei-filter-count { color: #bbb; font-size: 11px; margin-left: auto; }
.gmei-filter-active-count { color: var(--g); font-size: 11px; }
.gmei-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.gmei-product-card { border: 1px solid #eee; border-radius: 10px; overflow: hidden; background: #fff; transition: box-shadow .2s; display: flex; flex-direction: column; }
.gmei-product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.gmei-product-img-wrap { display: block; position: relative; background: #fff; height: 160px; overflow: hidden; }
.gmei-product-img-wrap img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.gmei-img-placeholder { width: 100%; height: 100%; background: #f0f0f0; }
.gmei-badge { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.gmei-badge-new { background: var(--gl); color: var(--gd); }
.gmei-badge-out { background: #f0f0f0; color: #999; }
.gmei-product-body { padding: 10px; display: flex; flex-direction: column; flex: 1; }
.gmei-product-brand { font-size: 11px; color: #aaa; margin: 0 0 2px; }
.gmei-product-name { font-size: 13px; font-weight: 600; color: #222; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; min-height: 34px; margin-bottom: 8px; }
.gmei-product-name:hover { color: var(--g); }
.gmei-product-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; border-top: 1px solid #f5f5f5; }
.gmei-price { font-size: 15px; font-weight: 700; color: #222; }
.gmei-price-old { font-size: 12px; color: #aaa; text-decoration: line-through; margin-right: 4px; }
.gmei-btn-add { font-size: 13px; padding: 7px 14px; border-radius: 20px; border: none; background: var(--g); color: #fff; cursor: pointer; font-weight: 600; transition: background .15s; }
.gmei-btn-add:hover { background: var(--gd); }
.gmei-sin-stock { font-size: 11px; color: #bbb; }
.gmei-loading { opacity: .5; pointer-events: none; }
.gmei-no-results { padding: 3rem; text-align: center; color: #aaa; font-size: 14px; }
.gmei-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.gmei-page-btn { padding: 6px 12px; border: 1px solid #ddd; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; transition: all .15s; }
.gmei-page-btn:hover { border-color: var(--g); color: var(--g); }
.gmei-page-active { background: var(--g); color: #fff; border-color: var(--g); }
.gmei-results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 13px; color: #666; }
.gmei-sort { border: 1px solid #ddd; border-radius: 6px; padding: 5px 10px; font-size: 13px; background: #fff; }

@media (max-width: 768px) {
  .gmei-wrapper { flex-direction: column; }
  .gmei-sidebar { display: none; }
  .gmei-products-grid { grid-template-columns: repeat(2, 1fr); }
  #gmei-dropdown { display: none !important; }
}

.gmei-dd-page-dots { font-size: 13px; color: #aaa; padding: 0 2px; line-height: 28px; }



.gmei-dd-filter-pills { display: none; padding: 4px 0 8px; }
.gmei-dd-filter-pills.open { display: block; }
