/* Card shell */
.service-card {
  background: #fff;
  padding: 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid #eee;
  text-align: left;
  transition: box-shadow 0.3s ease;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}
.service-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Media */
.service-logo {
  object-fit: contain;
  height: 120px;
  border-radius: 0;
}

/* Title + category row */
.header-row {
  gap: 8px;
}
.header-row .card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .header-row .card-title {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}
.header-row .badge-soft-warning {
  max-width: 50%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .header-row .badge-soft-warning {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    max-width: 100%;
  }
}

/* Body text */
.body-sm {
  font-size: 0.875rem;
  line-height: 1.45;
  color: #6c757d;
}

/* Category badge (amber) */
.badge-soft-warning {
  background-color: #fff7e6;
  color: #ff9f43;
  padding: 0.3em 0.55em;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}
@media (max-width: 767px) {
  .badge-soft-warning {
    white-space: normal;
  }
}

/* Price first */
.badge-price {
  background: #f8f9fa;
  color: #111827;
  border: 1px solid #e5e7eb;
  padding: 0.3em 0.55em;
  border-radius: 0.375rem;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

/* Offer (GREEN) */
.badge-soft-success {
  background-color: #eafaf1;
  color: #198754;
  padding: 0.3em 0.55em;
  border-radius: 0.375rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .badge-soft-success {
    white-space: normal;
  }
}

/* Offer (RED) */
.badge-soft-danger {
  background-color: #fdecec;
  color: #dc3545;
  padding: 0.3em 0.55em;
  border-radius: 0.375rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .badge-soft-danger {
    white-space: normal;
  }
}

/* Location + delivery */
.meta-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot-sep::before {
  content: '•';
  margin: 0 6px 0 2px;
  color: #9aa0a6;
}

/* CTA */
.btn-4g-primary {
  background-color: #dc3545;
  color: #fff;
  border: none;
  padding: 8px 0.75rem;
  min-height: 44px;
  border-radius: 0.375rem;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.2);
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  text-align: center;
}
.btn-4g-primary:hover {
  background-color: #c82333;
  box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

/* Meta row */
.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* Clamp description */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mobile + tablet portrait improvements */
@media (max-width: 767px) {
  /* Location/delivery stacked and left aligned */
  .meta-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  /* Let users read a bit more in small screens */
  .line-clamp-3 {
    -webkit-line-clamp: 5;
    line-clamp: 5;
  }

  /* Prevent the category badge from overflowing */
  .header-row .badge-soft-warning {
    max-width: 100%;
  }
}

/************------------------------------------------*/

/* Page header */
.marketplace-page .page-header-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

/* Muted text size aligned with app */
.marketplace-page .text-muted {
  font-size: 0.875rem;
}

/* Category badge (used inside cards too for consistency) */
.marketplace-page .badge-soft-warning {
  background-color: #fff7e6;
  color: #ff9f43;
  padding: 0.35em 0.65em;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 767px) {
  .marketplace-page .badge-soft-warning {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}

/* Cards grid: 1 col by default; 2/3/4 on larger screens */
.cards-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

/* ≥768px: 2 columns */
@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ≥1200px: 3 columns */
@media (min-width: 1200px) {
  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ≥1400px: 4 columns (same as Add-on Services) */
@media (min-width: 1400px) {
  .cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- Modal (confirmation) ---------- */

.custom-modal {
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

/* Normalize modal typography to a single base size */
.custom-modal,
.custom-modal .modal-body,
.custom-modal .modal-footer,
.custom-modal .modal-header {
  font-size: 0.875rem;
  line-height: 1.45;
  color: #212529;
}

/* Keep title bold without increasing size */
.custom-modal .modal-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin: 0;
}

/* Divider */
.custom-separator {
  margin: 0.5rem 0 1rem;
  border-top: 1px solid #e5e7eb;
}

/* Service name + description inside modal */
.custom-modal h6 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.custom-modal p {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

/* Key facts layout */
.facts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 16px;
  margin-bottom: 4px;
}
.fact {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 8px;
}
@media (max-width: 576px) {
  .fact {
    grid-template-columns: 1fr;
  }
  .fact-label {
    margin-bottom: 2px;
  }
}
.fact-label,
.fact-value {
  font-size: 0.875rem;
}
.fact-label {
  color: #6c757d;
  font-weight: 600;
}
.fact-value {
  color: #212529;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Two columns for facts on wider modals */
@media (min-width: 576px) {
  .facts-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Modal badges (inherit base sizing) */
.badge-price {
  background: #f8f9fa;
  color: #111827;
  border: 1px solid #e5e7eb;
  padding: 0.3em 0.55em;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}
.badge-soft-success {
  background-color: #eafaf1;
  color: #198754;
  padding: 0.3em 0.55em;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .badge-soft-success {
    white-space: normal;
  }
}

/* Modal buttons */
.custom-cancel-btn {
  color: #212529;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
}
.custom-cancel-btn:hover {
  background-color: #e9ecef;
}
.custom-confirm-btn {
  background-color: #dc3545;
  color: #fff;
  border: none;
}
.custom-confirm-btn:hover {
  background-color: #c82333;
}

/* Validation */
.is-invalid {
  border-color: #dc3545;
}
.invalid-feedback {
  color: #dc3545;
  font-size: 0.75rem;
}

/* Input + label inside modal */
.modal-body .form-label {
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  margin-left: 0.25rem;
}
.modal-body .form-control {
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #ced4da;
  width: 100%;
  box-sizing: border-box;
}

/* Footer layout utilities for even button spacing */
.d-flex {
  display: flex;
}
.gap-2 {
  gap: 0.5rem;
}
.flex-fill {
  flex: 1 1 auto;
}

.market-container, .market-container-sm, .market-container-md, .market-container-lg, .market-container-xl {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}


.service-logo-container {
  width: 60%;
  aspect-ratio: 1; /* Esto hace que sea cuadrado automáticamente */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
   margin: 1rem auto;
      border-radius: 13px;
    box-shadow: 3px -1px 20px 0px #00000052;
}

.service-logo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Mantiene la proporción */
}

/* Breakpoints */
@media (min-width: 576px) {
    .market-container, .market-container-sm {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .market-container, .market-container-sm, .market-container-md {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .market-container, .market-container-sm, .market-container-md, .market-container-lg {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .market-container, .market-container-sm, .market-container-md, .market-container-lg, .market-container-xl {
        max-width: 1300px; /* aquí puedes cambiar el ancho que quieras */
    }
}

/* ---------- Marketplace Filter Bar ---------- */

.marketplace-filter {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.03);
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .filter-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .filter-search {
    flex: 1 1 100%;
  }

  .filter-category,
  .filter-location {
    flex: 1 1 calc(50% - 0.375rem);
  }
}

@media (min-width: 992px) {
  .filter-row {
    flex-wrap: nowrap;
  }

  .filter-search {
    flex: 2 1 0;
  }

  .filter-category,
  .filter-location {
    flex: 1 1 0;
  }
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.filter-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-icon {
  position: absolute;
  left: 0.75rem;
  color: #adb5bd;
  font-size: 0.875rem;
  pointer-events: none;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  min-height: 44px;
  font-size: 0.875rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  background-color: #fff;
  color: #212529;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

.filter-input::placeholder {
  color: #adb5bd;
}

.filter-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px 12px;
  padding-right: 2rem;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
}

.btn-clear-filters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6c757d;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.btn-clear-filters:hover {
  background-color: #e9ecef;
  color: #212529;
}

.filter-results-info {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
}

#results-count {
  font-size: 0.8125rem;
  color: #6c757d;
  font-weight: 500;
}

/* ---------- No Results State ---------- */

.no-results-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.no-results-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  border-radius: 50%;
  color: #adb5bd;
  font-size: 1.75rem;
}

.no-results-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #212529;
  margin: 0 0 0.5rem;
}

.no-results-text {
  font-size: 0.875rem;
  color: #6c757d;
  margin: 0 0 1.25rem;
}

.no-results-state .btn-secondary {
  display: inline-block;
}

/* ---------- Service Card Wrapper (for filtering) ---------- */

.service-card-wrapper {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.service-card-wrapper.is-hidden {
  display: none;
}