/**
 * =============================================================================
 * Search Package - Home Search Styles v2.12
 * =============================================================================
 * Archivo cacheable - El navegador lo guarda después de la primera visita
 * =============================================================================
 */

/* ============================================
   SEARCH TOP BAR
   ============================================ */
.az-srch-top { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* Switch de vista (Lista/Mapa) */
.az-switch { display: flex; align-items: center; gap: 10px; }
.az-switch-label { font-size: 11px; color: #565959; font-weight: 700; }

/* Segmented control */
.az-seg { display: inline-flex; border: 1px solid #d5d9d9; border-radius: 999px; overflow: hidden; background: #fff; }
.az-seg a { padding: 8px 12px; font-size: 13px; text-decoration: none; color: #0F1111; border-right: 1px solid #d5d9d9; }
.az-seg a:last-child { border-right: 0; }
.az-seg a.on { background: #111; color: #fff; border-right: 1px solid #111; }

/* Pills (botones de filtro) */
.az-pill { border: 1px solid #d5d9d9; background: #fff; border-radius: 999px; padding: 8px 12px; font-size: 13px; cursor: pointer; text-decoration: none; color: #0F1111; }
.az-pill.on { border-color: #111; background: #f3f3f3; }

/* Pill con slider (radio) */
.az-pill-range { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #111; background: #f3f3f3; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.az-pill-range input[type=range] { width: 80px; height: 4px; cursor: pointer; -webkit-appearance: none; appearance: none; background: #ccc; border-radius: 2px; }
.az-pill-range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; background: #111; border-radius: 50%; cursor: pointer; }
.az-pill-range .v { font-size: 11px; font-weight: 700; color: #0F1111; min-width: 35px; text-align: right; }

/* ============================================
   CARDS DE PROVEEDORES
   ============================================ */
.az-card { display: flex; gap: 12px; align-items: flex-start; }
.az-ava { width: 54px; height: 54px; border-radius: 10px; border: 1px solid #e3e6e6; background: #fff; flex: 0 0 auto; position: relative; }
.az-ava img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 9px; }
.az-online-dot { position: absolute; bottom: -1px; right: -1px; width: 10px; height: 10px; background: #22c55e; border: 2px solid #fff; border-radius: 50%; z-index: 1; }
.sec-btn-msg { background: none; border: 1px solid #007185; border-radius: 8px; padding: 6px 8px; font-size: 14px; cursor: pointer; color: #007185; line-height: 1; }
.sec-btn-msg:hover { background: #f7fafa; }
.az-name { font-size: 15px; font-weight: 700; color: #0F1111; }
.az-meta { font-size: 12px; color: #565959; margin-top: 2px; }

/* Estrellas de rating */
.az-stars2 { display: inline-block; position: relative; font-size: 14px; line-height: 1; letter-spacing: .5px; vertical-align: middle; }
.az-stars2 .bg { color: #d5d9d9; }
.az-stars2 .fg { position: absolute; top: 0; left: 0; white-space: nowrap; overflow: hidden; color: #f08804; }
.az-rate-num { color: #0F1111; margin-left: 6px; }
.az-rate-cnt { margin-left: 6px; color: #565959; }

/* Chips de servicios */
.az-chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.az-chip { display: inline-block; padding: 6px 10px; border: 1px solid #d5d9d9; border-radius: 999px; font-size: 12px; background: #fff; }

/* Badge "Nuevo" */
.az-badge-new { display: inline-block; background: #00B4D8; color: #fff; font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: 3px; margin-left: 6px; vertical-align: middle; text-transform: uppercase; }

/* ============================================
   BOTONES DE CATEGORÍAS
   ============================================ */
.az-cat-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 16px; background: #fff; border: 1px solid #e3e6e6; text-decoration: none; color: #0F1111; transition: all 0.2s ease; }
.az-cat-btn:hover { background: #f7fafa; border-color: #007185; transform: translateY(-2px); }
.az-cat-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.az-cat-icon svg { width: 100%; height: 100%; }
.az-cat-label { font-size: 10px; font-weight: 600; margin-top: 4px; text-align: center; }

/* ============================================
   MAPA
   ============================================ */
.az-map { height: 420px; border: 1px solid #e3e6e6; border-radius: 12px; overflow: hidden; }

/* Marcadores del mapa */
.mk-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mk { width: 44px; height: 44px; border-radius: 14px; border: 2px solid #fff; box-shadow: 0 10px 18px rgba(0,0,0,.14); background: #fff; overflow: hidden; position: relative; }
.mk img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk .b { position: absolute; right: -2px; bottom: -2px; height: 18px; border-radius: 999px; background: #111; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; border: 2px solid #fff; padding: 0 6px; white-space: nowrap; }
.mk-n { max-width: 92px; padding: 2px 7px; background: rgba(255,255,255,.95); border: 1px solid #d5d9d9; border-radius: 999px; font-size: 11px; font-weight: 800; color: #0F1111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Cluster de marcadores */
.mk.mk-cluster { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f7f7f7; border: 2px solid #111; }
.mk.mk-cluster .mk-num { font-size: 16px; font-weight: 900; color: #0F1111; line-height: 1; }
.mk.mk-cluster .b { position: absolute; right: -2px; bottom: -2px; }

/* Popup del mapa */
.pv-pop { min-width: 220px; max-width: 260px; }
.pv-pop .row { display: flex; gap: 10px; align-items: flex-start; }
.pv-pop .ava { width: 46px; height: 46px; border-radius: 12px; border: 1px solid #e3e6e6; overflow: hidden; background: #fff; flex: 0 0 auto; }
.pv-pop .ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-pop .n { font-weight: 900; color: #0F1111; font-size: 14px; line-height: 1.15; }
.pv-pop .r { font-size: 12px; color: #565959; margin-top: 4px; }
.pv-pop .chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.pv-pop .chip { display: inline-block; padding: 5px 9px; border: 1px solid #d5d9d9; border-radius: 999px; font-size: 11px; background: #fff; }

/* ============================================
   BOTÓN CENTRAR MAPA
   ============================================ */
.map-center-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: #fff;
  border: none;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: background 0.2s;
}
.map-center-btn:hover { background: #f5f5f5; }
.map-center-btn:active { background: #e0e0e0; }
.map-center-btn svg { color: #5f6368; }

/* ============================================
   SPINNER / LOADER
   ============================================ */
.az-spinner { width: 30px; height: 30px; margin: 0 auto; border: 3px solid #e3e6e6; border-top-color: #007185; border-radius: 50%; animation: az-spin 0.8s linear infinite; }
@keyframes az-spin { to { transform: rotate(360deg); } }

/* ============================================
   PAGINACIÓN ESTILO AMAZON
   ============================================ */
.pagination-container { display: flex; justify-content: center; align-items: center; padding: 20px; gap: 8px; flex-wrap: wrap; }
.pag-btn { padding: 8px 12px; border: 1px solid #ddd; background: #fff; border-radius: 4px; cursor: pointer; font-size: 14px; transition: all 0.2s; }
.pag-btn:hover { border-color: #007185; background: #f7fafa; }
.pag-btn.active { border-color: #007bff; background: #007bff; color: #fff; font-weight: bold; }
.pag-prev, .pag-next { padding: 8px 16px; }

/* ============================================
   UTILIDADES
   ============================================ */
.bottom-spacer { height: 120px; }
.search-loading { text-align: center; padding: 40px; }

/* ============================================
   SKELETON LOADING
   ============================================ */
@keyframes sk-pulse { 0%,100%{opacity:.06} 50%{opacity:.12} }
.sk-card { padding: 14px 16px; }
.sk-row { display: flex; gap: 12px; align-items: flex-start; }
.sk-ava { width: 54px; height: 54px; border-radius: 10px; background: #0F1111; opacity: .08; flex: 0 0 auto; animation: sk-pulse 1.4s ease-in-out infinite; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.sk-line { height: 12px; border-radius: 6px; background: #0F1111; opacity: .08; animation: sk-pulse 1.4s ease-in-out infinite; }
.sk-w40 { width: 40%; } .sk-w50 { width: 50%; } .sk-w60 { width: 60%; } .sk-w70 { width: 70%; } .sk-w80 { width: 80%; }
.sk-card:nth-child(2) .sk-ava, .sk-card:nth-child(2) .sk-line { animation-delay: .15s; }
.sk-card:nth-child(3) .sk-ava, .sk-card:nth-child(3) .sk-line { animation-delay: .3s; }

/* ============================================
   VISITED CAROUSEL (estilo Amazon)
   ============================================ */
.visited-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.visited-header .sec-label { font-size: 13px; }
.visited-clear { background: none; border: none; color: #565959; font-size: 12px; cursor: pointer; padding: 4px 8px; }
.visited-clear:hover { color: #c45500; }
.visited-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.visited-scroll::-webkit-scrollbar { display: none; }
.visited-item { flex: 0 0 auto; text-align: center; width: 72px; text-decoration: none; color: inherit; position: relative; }
.visited-item-x { position: absolute; top: -4px; right: 0; width: 18px; height: 18px; border-radius: 50%; background: #f0f0f0; border: 1px solid #ddd; color: #888; font-size: 10px; line-height: 16px; text-align: center; cursor: pointer; padding: 0; z-index: 2; }
.visited-item-x:hover { background: #e0e0e0; color: #c45500; }
.visited-item .visited-ava { width: 54px; height: 54px; border-radius: 10px; border: 1px solid #e3e6e6; overflow: hidden; margin: 0 auto; background: #fff; }
.visited-item .visited-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.visited-item .visited-name { font-size: 11px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visited-item .visited-rate { font-size: 10px; color: #565959; }

/* ============================================
   MODE SWITCH (data-mode on .hs-amz)
   ============================================ */
.hs-amz[data-mode="provider"] .mode-product { display: none; }
.hs-amz[data-mode="product"] .mode-provider { display: none; }
.hs-amz[data-mode="product"] #view-map { display: none !important; }

/* ============================================
   PRODUCT GRID (modo marketplace)
   ============================================ */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 8px; }
.product-card { border-radius: 10px; border: 1px solid #e3e6e6; background: #fff; overflow: hidden; cursor: pointer; transition: transform .15s; }
.product-card:active { transform: scale(0.97); }
.product-card-img-wrap { width: 100%; aspect-ratio: 1; background: #f0f0f0; display: flex; align-items: center; justify-content: center; transition: background-color .3s; }
.product-card-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-card-body { padding: 8px 10px; }
.product-card-price { font-size: 15px; font-weight: 700; color: #0F1111; }
.product-card-compare { font-size: 12px; color: #888; text-decoration: line-through; margin-left: 6px; }
.product-card-discount { font-size: 11px; color: #cc0c39; font-weight: 600; margin-left: 4px; }
.product-card-name { font-size: 12px; color: #565959; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-store { font-size: 11px; color: #007185; margin-top: 4px; }
.product-card-rating { font-size: 11px; color: #565959; margin-top: 2px; }
.product-sort-btn.on { background: #0F1111; color: #fff; border-color: #0F1111; }
.product-filter-btn.on { background: #0F1111; color: #fff; border-color: #0F1111; }
.az-scope-select { appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23565959'/%3E%3C/svg%3E") no-repeat right 8px center; padding-right: 22px; cursor: pointer; font-size: 12px; }
.az-price-input { width: 70px; padding: 5px 8px; border: 1px solid #e3e6e6; border-radius: 8px; font-size: 13px; text-align: center; }

/* ═══ Dark Mode ═══ */
.dark-mode .az-switch-label{color:#8696a0}
.dark-mode .az-seg{background:#1e2a32;border-color:#2a3942}
.dark-mode .az-seg a{color:#e1e1e1;border-color:#2a3942}
.dark-mode .az-seg a.on{background:#e1e1e1;color:#111;border-color:#e1e1e1}
.dark-mode .az-pill{background:#1e2a32;border-color:#2a3942;color:#e1e1e1}
.dark-mode .az-pill.on{background:#263038;border-color:#e1e1e1}
.dark-mode .az-pill-range{background:#263038;border-color:#e1e1e1;color:#e1e1e1}
.dark-mode .az-pill-range .v{color:#e1e1e1}
.dark-mode .az-pill-range input[type=range]{background:#3b4f5a}
.dark-mode .az-pill-range input[type=range]::-webkit-slider-thumb{background:#e1e1e1}
.dark-mode .az-card{color:#e1e1e1}
.dark-mode .az-ava{border-color:#2a3942;background:#1e2a32}
.dark-mode .az-online-dot{border-color:#111b21}
.dark-mode .sec-btn-msg{border-color:#4fc3f7;color:#4fc3f7}
.dark-mode .sec-btn-msg:hover{background:#263038}
.dark-mode .az-name{color:#e1e1e1}
.dark-mode .az-meta{color:#8696a0}
.dark-mode .az-stars2 .bg{color:#3b4f5a}
.dark-mode .az-rate-num{color:#e1e1e1}
.dark-mode .az-rate-cnt{color:#8696a0}
.dark-mode .az-chip{background:#1e2a32;border-color:#2a3942;color:#e1e1e1}
.dark-mode .az-recent-chip{background:#1e2a32;border-color:#2a3942;color:#e1e1e1}
.dark-mode .az-recent-x{color:#8696a0}
.dark-mode .az-recent-x:hover{color:#4fc3f7}
.dark-mode .az-cat-btn{background:#1e2a32;border-color:#2a3942;color:#e1e1e1}
.dark-mode .az-cat-btn:hover{background:#263038;border-color:#4fc3f7}
.dark-mode .az-map{border-color:#2a3942}
.dark-mode .mk{background:#1e2a32;border-color:#2a3942}
.dark-mode .mk-n{background:rgba(30,42,50,.95);border-color:#2a3942;color:#e1e1e1}
.dark-mode .mk.mk-cluster{background:#263038;border-color:#e1e1e1}
.dark-mode .pv-pop .n{color:#e1e1e1}
.dark-mode .pv-pop .r{color:#8696a0}
.dark-mode .pv-pop .chip{background:#1e2a32;border-color:#2a3942;color:#e1e1e1}
.dark-mode .map-center-btn{background:#1e2a32;box-shadow:0 2px 6px rgba(0,0,0,.5)}
.dark-mode .map-center-btn:hover{background:#263038}
.dark-mode .map-center-btn svg{color:#8696a0}
.dark-mode .az-spinner{border-color:#2a3942;border-top-color:#4fc3f7}
.dark-mode .pag-btn{background:#1e2a32;border-color:#2a3942;color:#e1e1e1}
.dark-mode .pag-btn:hover{border-color:#4fc3f7;background:#263038}
.dark-mode .pag-btn.active{background:#4fc3f7;border-color:#4fc3f7;color:#111}
.dark-mode .search-loading{color:#8696a0}
.dark-mode .sk-ava,.dark-mode .sk-line{background:#e1e1e1}
.dark-mode .visited-item .visited-ava{border-color:#2a3942;background:#1e2a32}
.dark-mode .visited-item .visited-name{color:#e1e1e1}
.dark-mode .visited-item .visited-rate{color:#8696a0}
.dark-mode .visited-clear{color:#8696a0}
.dark-mode .visited-clear:hover{color:#4fc3f7}
.dark-mode .visited-item-x{background:#2a3942;border-color:#3b4f5a;color:#8696a0}
.dark-mode .visited-item-x:hover{background:#3b4f5a;color:#4fc3f7}
.dark-mode .product-card{background:#1e2a32;border-color:#2a3942}
.dark-mode .product-card-price{color:#e1e1e1}
.dark-mode .product-card-rating{color:#8696a0}
.dark-mode .product-card-compare{color:#6b7b8d}
.dark-mode .product-card-discount{color:#ff6b6b}
.dark-mode .product-card-name{color:#8696a0}
.dark-mode .product-card-store{color:#4fc3f7}
.dark-mode .product-card-img-wrap{background:#263038}
.dark-mode .product-sort-btn.on{background:#e1e1e1;color:#111;border-color:#e1e1e1}
.dark-mode .product-filter-btn.on{background:#e1e1e1;color:#111;border-color:#e1e1e1}
.dark-mode .az-scope-select{background-color:#1e2a32;border-color:#2a3942;color:#e1e1e1;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238696a0'/%3E%3C/svg%3E")}
.dark-mode .az-price-input{background:#1e2a32;border-color:#2a3942;color:#e1e1e1}
