/* ===== Carnemart Fullscreen ===== */
body.carnemart-search-open { 
  overflow: hidden; 
}

#carnemart-search-overlay.cmfd-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2147483500;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: none;
  animation: fadeIn 0.2s ease;
}

body.carnemart-search-open #carnemart-search-overlay { 
  display: block; 
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.msg-intro-help{
      display: inline-block;
    width: max-content;
    position: absolute;
    z-index: 3;
    left: 7%;
    bottom: -15px;
    font-size: 12px;
    background: #f0fff0;
    color: #1e66ff;
    padding: 5px 15px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(30, 102, 255, 0.3);
}

.cmfd-layer {
  position: absolute;
  inset: 0;
  background: #fff;
  display: grid;
  grid-template-rows: min-content 1fr min-content;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.cmfd-header {
  background: #fff;
  padding: 20px 48px;
  border-bottom: 1px solid #eaeaea;
  display: grid;
  grid-template-columns: min-content 1fr;
  gap: 20px;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.cmfd-logo {
  max-height: 40px;
  max-width: 160px;
  object-fit: contain;
}

.cmfd-searchbox {
  border: 2px solid #0866fd;
  border-radius: 50px;
  display: grid;
  grid-template-columns: 60px 1fr 40px;
  align-items: center;
  gap: 0;
  background: #fff;
  padding: 0;
  height: 56px;
  position: relative;
}

.cmfd-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 60px;
  border-top-left-radius:300px;
  border-bottom-left-radius: 300px;
  font-size: 20px;
  color: #ffffff;
  background-color: #0866fd!important;
  padding-left: 15px;
  padding-right: 10px;
}

.cmfd-searchbox-input {
  width: 100%;
  border: 0;
  outline: 0;
  font-size: 18px;
  padding: 8px 20px;
  color: #333;
  font-weight: 400;
}

.cmfd-searchbox-input::placeholder {
  color: #999;
  font-weight: 300;
}

.cmfd-close {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 24px;
  color: #333;
  margin-right: 3px;
  transition: all 0.2s ease;
}

.cmfd-close:hover {
  background: #1e66ff;
  color: white;
}

.cmfd-content {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 0;
  align-items: start;
  min-height: 0;
  height: calc(100vh - 140px);
  overflow: hidden;
}

.cmfd-popular {
    background: #f9f9f9;
    padding: 30px;
    height: 100%;
    border-right: 1px solid #eaeaea;
    overflow-y: auto;
    
    /* Estilo para Firefox */
    scrollbar-width: thin;
    scrollbar-color: #1e66ff #e0e0e0;
}

/* Estilo para WebKit (Chrome, Safari, Edge) */
.cmfd-popular::-webkit-scrollbar {
    width: 2px;
}

.cmfd-popular::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 2px;
}

.cmfd-popular::-webkit-scrollbar-thumb {
    background: #1e66ff;
    border-radius: 2px;
}

.cmfd-popular::-webkit-scrollbar-thumb:hover {
    background: #1556d6;
}

.cmfd-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 20px;
  color: #009a38;
  text-transform: capitalize;
  letter-spacing: 0.5px;
}

.cmfd-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cmfd-suggestion {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 15px;
  color: #555;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.cmfd-suggestion:hover {
  background: #fff;
  color: #1e66ff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cmfd-suggestion::before {
   display: none !important; 
  /*content: "🔍";
  margin-right: 12px;
  font-size: 14px;
  opacity: 0.7;*/
}

#last-suggestions.cmfd-suggestions {
  padding-bottom: 50px;
}

.cmfd-results {
  padding: 30px 48px;
  height: 100%;
  overflow-y: auto;
  background: #fff;
}

/* Resultados */
#carnemart-search-overlay .carnemart-search-results {
  position: static;
  display: block;
  max-height: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

#carnemart-search-overlay .carnemart-resultados-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  padding: 0;
  margin: 0;
}

#carnemart-search-overlay .carnemart-resultados-lista li {
  list-style: none;
  margin: 0;
}

#carnemart-search-overlay a.carnemart-item {
  display: flex;
  flex-direction: column;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  gap: 12px;
  text-decoration: none;
  color: #333;
  background: #fff;
  transition: all 0.3s ease;
  height: 100%;
  position: relative;
  overflow: hidden;
}

#carnemart-search-overlay a.carnemart-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  border-color: #1e66ff;
}

#carnemart-search-overlay .carnemart-img {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  background:rgba(255,255,255,0);
  display: flex;
  align-items: center;
  justify-content: center;
}

#carnemart-search-overlay .carnemart-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform 0.3s ease;
}

#carnemart-search-overlay a.carnemart-item:hover .carnemart-img img {
  transform: scale(1.05);
}

#carnemart-search-overlay .carnemart-placeholder {
  font-size: 48px;
  opacity: 0.2;
}

/* Información del producto */
#carnemart-search-overlay .carnemart-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#carnemart-search-overlay .carnemart-titulo {
  display: block;
  width: 100%;
  text-align: center;
  color: var(--color-principal);
  font-family: var(--fuente-alterna);
  padding: .5em 0;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700 !important;
}

#carnemart-search-overlay .carnemart-titulo mark {
  background: #ffeb3b;
  color: #000;
  padding: 0 2px;
  border-radius: 2px;
}

/* Badge y stock */
#carnemart-search-overlay .carnemart-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  position: absolute;
  top: 10px;
  left: 10px;
  border-radius: 300px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

#carnemart-search-overlay .carnemart-badge {
  background: #ff4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#carnemart-search-overlay .carnemart-stock {
  color: #ff4444;
  font-size: 12px;
  font-weight: 500;
}

#carnemart-search-overlay .carnemart-cat {
  background: #f0f7ff;
  color: #1e66ff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 12px;
}

/* Precio */
#carnemart-search-overlay .carnemart-precio {
  margin-top: auto;
  padding-top: 10px;
  text-align: center!important;
}

#carnemart-search-overlay .carnemart-precio .woocommerce-Price-amount {
  font-size: 18px;
  font-weight: 700;
  color: #1e66ff;
}

#carnemart-search-overlay .carnemart-precio del {
  color: #999;
  font-size: 14px;
  margin-right: 8px;
}

#carnemart-search-overlay .carnemart-precio ins {
  background: transparent;
  text-decoration: none;
}

/* Botón "Agregar al carrito" */
#carnemart-search-overlay .carnemart-add-to-cart {
  margin-top: 12px;
  background: #009a38;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: block;
  width: 100%;
}

#carnemart-search-overlay .carnemart-add-to-cart:hover {
  background: #0a50e0;
  transform: translateY(-2px);
}

/* Footer */
#carnemart-search-overlay .carnemart-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  text-align: center;
}

#carnemart-search-overlay .carnemart-more {
  display: inline-block;
  background: #1e66ff;
  color: white;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

#carnemart-search-overlay .carnemart-more:hover {
  background: #0a50e0;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(30, 102, 255, 0.3);
}

.cmfd-footer {
  padding: 20px 48px;
  background: #f9f9f9;
  border-top: 1px solid #eaeaea;
  text-align: right;
}

.cmfd-branding {
  color: #888;
  font-size: 13px;
}

/* Estados vacíos */
#carnemart-search-overlay .carnemart-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 16px;
}

/* Responsive */
@media (max-width: 992px) {
  .cmfd-layer {
    padding: 0;
  }
  
  .cmfd-header {
    padding: 15px 20px;
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .cmfd-logo {
    display: none;
  }
  
  .cmfd-content {
    grid-template-columns: 1fr;
    height: calc(100vh - 120px);
  }
  
  .cmfd-popular {
    display: none;
  }
  
  .cmfd-results {
    padding: 20px;
  }
  
  #carnemart-search-overlay .carnemart-resultados-lista {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

@media (max-width: 576px) {
  #carnemart-search-overlay .carnemart-resultados-lista {
    grid-template-columns: 1fr;
  }
  
  .cmfd-searchbox {
    height: 50px;
    grid-template-columns: 70px 1fr 40px;
  }
  
  .cmfd-searchbox-input {
    font-size: 16px;
  }
}

/* Botón Ver Más */
.carnemart-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  text-align: center;
}

.carnemart-more-btn {
  display: inline-block;
  background: #1e66ff;
  color: white;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.3s ease;
}

.carnemart-more-btn:hover {
  background: #0a50e0;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(30, 102, 255, 0.3);
}

.carnemart-more-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.carnemart-more-link {
  display: inline-block;
  background: #f8f9fa;
  color: #1e66ff;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid #1e66ff;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.3s ease;
}

.carnemart-more-link:hover {
  background: #1e66ff;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(30, 102, 255, 0.3);
}

/* Indicador de resultados */
.carnemart-result-count {
  font-size: 13px;
  color: #666;
  margin-left: 10px;
  font-weight: normal;
}


/* Skeleton loader para búsquedas populares */
.cmfd-suggestions-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cmfd-skeleton {
  height: 40px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Mejoras para el logo */
.cmfd-logo {
  max-height: 48px;
  max-width: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Ajuste para cuando no hay logo */
.cmfd-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
}

.cmfd-header:has(.cmfd-logo:empty) {
  grid-template-columns: 1fr;
}

/* Mejorar el aspecto de las sugerencias */
.cmfd-suggestion {
  text-align: left;
  border: 1px solid #eaeaea;
  background: #f9f9f9;
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.8rem;
  text-transform: capitalize;
  color: #333;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cmfd-suggestion:hover {
  background: #1e66ff;
  color: white;
  border-color: #1e66ff;
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(30, 102, 255, 0.2);
}

.cmfd-suggestion::after {
  content: "→";
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cmfd-suggestion:hover::after {
  opacity: 1;
}

/* Notificación de ubicación */
.cmfd-location-notice {
  grid-column: 1 / -1;
  margin-top: 10px;
}

.cmfd-location-warning {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  padding: 12px 16px;
  color: #856404;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cmfd-location-warning span {
  font-size: 18px;
}

/* Mensaje cuando no hay ubicación seleccionada */
.carnemart-no-location {
  text-align: center;
  padding: 60px 20px;
  max-width: 400px;
  margin: 0 auto;
}

.carnemart-location-icon {
  margin-bottom: 20px;
}

.map-icon{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 50px;
  border-radius: 300px;
  width: 50px;
  background-color: #0866fd;
  color: #ffffff;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.map-icon:before {
    content: "";
    display: inline-block;
    width: 64px;
    height: 6px;
    background-color: #000000;
    filter: blur(.4rem);
    border-radius: 50%;
    position: absolute;
    z-index: -1;
    bottom: -1px;
}

.map-icon .bi{
  font-size: 25px;
  position: relative;
  z-index: 4;
}

.carnemart-no-location h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #0866fd;
}

.carnemart-no-location p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.3;
    font-size: .8rem;
}

.carnemart-select-location {
  background: #1e66ff;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.3s ease;
}

.carnemart-select-location:hover {
  background: #0a50e0;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(30, 102, 255, 0.3);
}

/* Stock por ubicación */
.carnemart-location-stock {
  font-size: 13px;
  color: #19a500;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.carnemart-location-stock:before {
  content: "✓";
  font-size: 12px;
}

.carnemart-location-stock strong {
  color: #1e66ff;
  font-weight: 700;
}

/* Estado deshabilitado del input cuando no hay ubicación */
.cmfd-searchbox-input:disabled {
  background: #ffffff;
  cursor: not-allowed;
}

/* Mensaje en búsquedas populares sin ubicación */
.cmfd-no-location {
  padding: 15px;
  text-align: center;
  color: #999;
  font-size: 14px;
  border: 1px dashed #ddd;
  border-radius: 8px;
  background: #fafafa;
}

/* Skeleton loader para búsquedas populares */
.cmfd-suggestions-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cmfd-skeleton {
  height: 40px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Botón Ver Más */
.carnemart-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  text-align: center;
}

.carnemart-more-btn {
  display: inline-block;
  background: #1e66ff;
  color: white;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.3s ease;
}

.carnemart-more-btn:hover {
  background: #0a50e0;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(30, 102, 255, 0.3);
}

.carnemart-more-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

/* Dashboard */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.dashboard-widgets .widget {
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.dashboard-widgets .widget:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.dashboard-widgets .widget h3 {
    margin-top: 0;
    color: #1e66ff;
    font-size: 18px;
}

/* Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-box {
    text-align: center;
    padding: 25px 15px;
    border: 1px solid #ccd0d4;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.stat-box h3 {
    font-size: 2.5em;
    margin: 0 0 10px;
    color: #1e66ff;
    font-weight: 700;
}

.stat-box p {
    margin: 0;
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tablas */
.widefat th {
    font-weight: 600;
    color: #1e66ff;
}

.widefat tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Formularios */
.form-table textarea.large-text {
    font-family: monospace;
    line-height: 1.5;
}

.form-table .description {
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

/* Tarjetas */
.card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card h2.title {
    margin-top: 0;
    color: #1e66ff;
    border-bottom: 2px solid #1e66ff;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Botones personalizados */
.button-primary {
    background: #1e66ff;
    border-color: #1e66ff;
}

.button-primary:hover {
    background: #0a50e0;
    border-color: #0a50e0;
}

.button-secondary {
    background: #f0f7ff;
    color: #1e66ff;
    border-color: #1e66ff;
}

.button-secondary:hover {
    background: #1e66ff;
    color: white;
}

/* Checkboxes en grid */
fieldset label {
    display: block;
    padding: 5px 0;
    transition: all 0.2s ease;
}

fieldset label:hover {
    background: #f0f7ff;
    padding-left: 5px;
    border-radius: 3px;
}

/* Preformateado */
pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #1e66ff;
    overflow-x: auto;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.4;
}

/* Responsive */


@media screen and (max-width: 782px) {
    .dashboard-widgets,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-box {
        padding: 15px 10px;
    }
    
    .stat-box h3 {
        font-size: 2em;
    }
}

@media screen and (max-width: 680px){
  .msg-intro-help {
    left: 4%;
    bottom: -25px;
    font-size: 12px;
  }
}

/* Estilo para sugerencias de categoría */
.cmfd-suggestion-category {
    background: #f8f9fa;
    border: 1px solid #eaeaea;
    color: #0866fd;
}
.cmfd-suggestion-category:hover {
    background: #1e66ff;
    color: white;
    border-color: #1e66ff;
}
.cmfd-suggestion-search {
    background: #fff;
    border: 1px solid #eee;
    color: #555;
}
.cmfd-suggestion-search:hover {
    background: #f0f7ff;
    color: #1e66ff;
    border-color: #1e66ff;
}
#location-notice { margin-top: 10px; }

.cmfd-notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.08);
    background: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
}

.cmfd-notice-icon {
    font-size: 18px;
    margin-top: 2px;
}

.cmfd-notice-title {
    display: block;
    font-size: 13px;
}

.cmfd-notice-msg {
    font-size: 13px;
    opacity: .9;
}

.cmfd-notice-close {
    margin-left: auto;
    background: transparent;
    border: 0;
    font-size: 18px;
    cursor: pointer;
    opacity: .6;
}

.cmfd-notice-close:hover { opacity: 1; }

.cmfd-notice-warning { border-left: 4px solid #f0b429; }
.cmfd-notice-success { border-left: 4px solid #2ecc71; }
.cmfd-notice-error   { border-left: 4px solid #e74c3c; }
.cmfd-notice-info    { border-left: 4px solid #3498db; }