/* ============================
   BRANCH LIST PAGE (PUBLIC)
   File: static/catalog/branch_list.css
   ============================ */

/* ===== CONTAINER ===== */
.branch-page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== HERO SECTION ===== */
.branch-hero {
  background: linear-gradient(135deg, rgba(13, 110, 253, .05) 0%, rgba(13, 202, 240, .03) 100%);
  border-radius: 24px;
  padding: 3rem 2rem;
  margin-bottom: 3rem;
  border: 1px solid rgba(13, 110, 253, .1);
  position: relative;
  overflow: hidden;
}

.branch-hero::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(13, 110, 253, .08) 0%, transparent 70%);
  border-radius: 50%;
}

.branch-hero::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(13, 202, 240, .08) 0%, transparent 70%);
  border-radius: 50%;
}

.branch-hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.branch-hero-title {
  font-size: 2.75rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 1rem;
  letter-spacing: -.04em;
  line-height: 1.1;
  background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.branch-hero-subtitle {
  font-size: 1.125rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 2rem;
  line-height: 1.7;
  text-align: center;
}

.branch-hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.branch-hero-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(13, 110, 253, .15);
  border-radius: 12px;
  padding: 0.875rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

.branch-hero-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, .15);
  border-color: rgba(13, 110, 253, .3);
}

.branch-hero-feature-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: #0d6efd;
}

.branch-hero-info-box {
  background: linear-gradient(135deg, rgba(255, 193, 7, .1) 0%, rgba(255, 152, 0, .05) 100%);
  border: 1.5px solid rgba(255, 193, 7, .3);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-top: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.branch-hero-info-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(255, 193, 7, .2), rgba(255, 152, 0, .2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
}

.branch-hero-info-content {
  flex: 1;
}

.branch-hero-info-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
  line-height: 1.3;
}

.branch-hero-info-text {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

.branch-count {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 12px;
  font-size: .9375rem;
  font-weight: 600;
  color: #475569;
}

.branch-count strong {
  color: #0f172a;
  font-weight: 800;
}

/* ===== ADVERTISE CTA (Publicidad) — acorde con hero y business CTA ===== */
.advertise-cta-section {
  background: linear-gradient(135deg, rgba(13, 110, 253, .06) 0%, rgba(13, 202, 240, .04) 100%);
  border-radius: 24px;
  padding: 3rem 2rem;
  margin: 4rem 0 2rem;
  border: 1px solid rgba(13, 110, 253, .12);
  position: relative;
  overflow: hidden;
}

.advertise-cta-section::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(13, 110, 253, .1) 0%, transparent 70%);
  border-radius: 50%;
}

.advertise-cta-section::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(13, 202, 240, .1) 0%, transparent 70%);
  border-radius: 50%;
}

.advertise-cta-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.advertise-cta-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(13, 110, 253, .15), rgba(13, 202, 240, .12));
  color: #0d6efd;
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .5rem 1rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}

.advertise-cta-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: #0f172a;
  margin: 0 0 1rem 0;
}

.advertise-cta-title-accent {
  background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.advertise-cta-desc {
  font-size: 1.0625rem;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
}

.advertise-cta-features {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.advertise-cta-feature {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255, 255, 255, .85);
  border: 1px solid rgba(13, 110, 253, .12);
  border-radius: 12px;
  padding: .75rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.advertise-cta-feature-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #0d6efd;
}

.advertise-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.0625rem;
  padding: 1rem 1.75rem;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(13, 110, 253, .3);
  transition: transform .2s ease, box-shadow .2s ease;
}

.advertise-cta-btn:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(13, 110, 253, .4);
}

.advertise-cta-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@media (max-width: 576px) {
  .advertise-cta-title {
    font-size: 1.5rem;
  }
  .advertise-cta-features {
    flex-direction: column;
  }
}

/* ===== SECTION HEADERS ===== */
.branch-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(0, 0, 0, .08);
}

.branch-section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.branch-section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 .875rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  font-size: .875rem;
  font-weight: 700;
  color: #475569;
}

.branch-section-wrapper {
  margin-bottom: 4rem;
}

.branch-section-wrapper:last-child {
  margin-bottom: 0;
}

.branch-location {
  margin-top: .1rem;
  margin-bottom: .4rem;
  font-size: .8125rem;
  color: #64748b;
  line-height: 1.1;
}

@media (max-width: 768px) {
  .branch-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
  }

  .branch-section-title {
    font-size: 1.5rem;
  }
}

/* ===== FILTER MODAL ===== */
.filter-modal .modal-content {
  border: none;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
}

.filter-modal .modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  padding: 1.5rem 2rem;
}

.filter-modal .modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.filter-modal .modal-title svg {
  width: 24px;
  height: 24px;
  color: #64748b;
}

.filter-modal .modal-body {
  padding: 2rem;
}

.address-item {
  border: 2px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all .2s ease;
  background: #fff;
}

.address-item:hover {
  border-color: rgba(13, 110, 253, .3) !important;
  box-shadow: 0 2px 8px rgba(13, 110, 253, .1);
}

.address-item.selected {
  border-color: #0d6efd !important;
  background: #f0f7ff !important;
}

.divider {
  margin: 1.5rem 0;
  border-top: 1px solid rgba(0, 0, 0, .06);
}

.filter-modal .modal-footer {
  border-top: 1px solid rgba(0, 0, 0, .06);
  padding: 1.5rem 2rem;
  gap: 1rem;
}

/* ===== FILTERS SECTION (HIDDEN) ===== */
.filters-section {
  display: none;
}

.filters-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.filters-title svg {
  width: 20px;
  height: 20px;
  color: #64748b;
}

.filter-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .filter-row {
    grid-template-columns: 1fr 1fr auto;
  }
}

.filter-select {
  padding: .75rem 1rem;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 10px;
  font-size: .9375rem;
  background: #ffffff;
  color: #0f172a;
  transition: all .2s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, .08);
}

.btn-clear-filters {
  padding: .75rem 1.5rem;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 10px;
  background: #ffffff;
  color: #64748b;
  font-weight: 600;
  font-size: .9375rem;
  transition: all .2s ease;
  white-space: nowrap;
}

.btn-clear-filters:hover {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, .15);
  color: #0f172a;
}

.active-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 8px;
  font-size: .8125rem;
  font-weight: 600;
  color: #475569;
  margin-top: 1rem;
}

/* ===== BRANCHES GRID ===== */
/* Flex + justify-content: center para centrar cuando hay pocas sucursales; grid más compacto */
.branches-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 1rem;
}

/* ===== BRANCH CARD ===== */
.branch-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 14px;
  overflow: hidden;
  transition: all .3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 100%;
}

/* Ancho máximo por tarjeta más pequeño para grid más compacto */
@media (min-width: 640px) {
  .branch-card {
    max-width: min(100%, 300px);
  }
}

.branch-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .1);
  border-color: rgba(0, 0, 0, .1);
}

.branch-cover {
  width: 100%;
  height: 160px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  overflow: visible;
  position: relative;
  z-index: 1;
}

.branch-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.branch-card:hover .branch-cover img {
  transform: scale(1.05);
}

.branch-logo {
  position: absolute;
  bottom: -26px;
  right: 1rem;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.branch-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.branch-logo-fallback {
  font-weight: 900;
  font-size: 1.25rem;
  color: #0f172a;
  letter-spacing: -.02em;
}

.branch-content {
  padding: 1.25rem;
  padding-top: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.branch-business {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
  margin-bottom: .5rem;
}

.branch-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: .5rem;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.branch-card-rating {
  display: flex;
  align-items: center;
  gap: .35rem .5rem;
  font-size: .8125rem;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}

.branch-card-rating .stars {
  color: #f59e0b;
  letter-spacing: .05em;
}

.branch-card-rating .avg {
  font-weight: 700;
  color: #0f172a;
}

.branch-card-rating .count {
  color: #64748b;
  font-weight: 500;
}

.branch-address {
  font-size: .8125rem;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: .5rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.branch-address svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: .125rem;
  color: #94a3b8;
}

.branch-phone {
  font-size: .8125rem;
  color: #64748b;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.branch-phone svg {
  width: 16px;
  height: 16px;
  color: #94a3b8;
}

.branch-footer {
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid rgba(0, 0, 0, .06);
}

.btn-view-menu {
  width: 100%;
  padding: .7rem 1.25rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: .875rem;
  transition: all .2s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.btn-view-menu:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, .3);
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #ffffff;
}

.btn-delivery-info {
  font-size: .75rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  padding: .45rem .65rem;
  text-decoration: none;
  transition: all .2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  width: 100%;
  margin-top: .5rem;
}

.btn-delivery-info:hover {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, .12);
  color: #0f172a;
}

.delivery-fee {
  text-align: center;
  margin-top: .5rem;
  font-size: .75rem;
  color: #64748b;
  font-weight: 600;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 20px;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, .05) 0%, rgba(15, 23, 42, .02) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.empty-state-icon svg {
  width: 40px;
  height: 40px;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: .5rem;
}

.empty-state-text {
  font-size: .9375rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
  .branch-hero {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }

  .branch-hero-title {
    font-size: 2rem;
  }

  .branch-hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .branch-hero-features {
    flex-direction: column;
    gap: 0.75rem;
  }

  .branch-hero-feature {
    width: 100%;
    justify-content: center;
  }

  .branch-hero-info-box {
    flex-direction: column;
    padding: 1rem;
    margin-top: 1.5rem;
  }

  .branch-hero-info-icon {
    align-self: flex-start;
  }

  .filters-section {
    padding: 1.5rem;
  }
}

/* ============================
   ADVERTISEMENTS SLIDER
   (moved from inline <style>)
   ============================ */
.advertisements-slider-wrapper {
  max-width: 100%;
  margin: 0;
  padding: 0;
  width: 100%;
}

.ad-slide-container {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #f8fafc;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

.ad-slide-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}

.ad-slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, .95) 0%,
    rgba(15, 23, 42, .85) 60%,
    transparent 100%
  );
  padding: 2.5rem 2rem 2rem;
  color: #fff;
}

.ad-slide-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.75rem 0;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.ad-slide-description {
  font-size: 1rem;
  color: rgba(255, 255, 255, .9);
  margin: 0 0 1.25rem 0;
  line-height: 1.6;
  max-width: 700px;
}

.ad-slide-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  color: #0f172a;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.ad-slide-button:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
  color: #0f172a;
}

.ad-control-prev,
.ad-control-next {
  display: none;
}

.ad-indicators {
  bottom: 1rem;
  margin-bottom: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.ad-indicators button {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
  border: none;
  margin: 0;
  padding: 0;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0.5;
  cursor: pointer;
}

.ad-indicators button:hover {
  opacity: 0.7;
  transform: scale(1.3);
}

.ad-indicators button.active {
  background: #ffffff;
  opacity: 1;
  width: 16px;
  border-radius: 8px;
  animation: indicatorSlide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes indicatorSlide {
  0% { width: 4px; transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { width: 16px; transform: scale(1); }
}

.carousel-item {
  transition: transform 0.6s ease-in-out;
}

@media (max-width: 768px) {
  .advertisements-slider-wrapper {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .ad-slide-image {
    height: 300px;
  }

  .ad-slide-content {
    padding: 1.75rem 1.5rem 1.5rem;
  }

  .ad-slide-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .ad-slide-description {
    font-size: 0.9375rem;
    margin-bottom: 1rem;
  }

  .ad-slide-button {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }

  .ad-control-prev,
  .ad-control-next {
    width: 40px;
    height: 40px;
  }

  .ad-control-prev { left: 1rem; }
  .ad-control-next { right: 1rem; }

  .ad-indicators { bottom: 0.75rem; }
}

@media (min-width: 1400px) {
  .advertisements-slider-wrapper {
    max-width: 1400px;
    margin: 0 auto;
  }
}