/* فروع نايوش هوب — عرض كامل + شبكة حتى 6 كروت */

body.branches-page main.container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1.25rem clamp(14px, 2vw, 28px) 3.5rem;
  box-sizing: border-box;
}

body.branches-page {
  overflow-x: hidden;
}

.branches-showcase {
  margin: 18px 0 26px;
  width: 100%;
  box-sizing: border-box;
}

.branches-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 24px;
  text-align: right;
  margin-bottom: 16px;
  width: 100%;
}

.branches-head-copy {
  flex: 1 1 280px;
  min-width: 0;
}

.branches-head h1 {
  margin: 0;
  color: #1d222b;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.2px;
  line-height: 1.3;
  max-width: none;
}

.branches-head p {
  margin: 10px 0 0;
  color: #5f6672;
  font-size: 16px;
  font-weight: 600;
  max-width: 52rem;
  line-height: 1.65;
}

.branches-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  margin-top: 18px;
  margin-bottom: 22px;
  align-items: center;
  width: 100%;
}

.branches-toolbar input,
.branches-toolbar select {
  min-height: 47px;
  border: 1px solid #d7dbe4;
  border-radius: 14px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #1f232b;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.branches-toolbar input::placeholder {
  color: #8b93a2;
}

.branches-filter-all {
  min-height: 47px;
  border: 1px solid rgba(185, 10, 26, 0.35);
  background: #fff;
  color: #b40d1f;
  border-radius: 14px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.branches-filter-all:hover {
  background: #fff1f3;
}

.branches-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* حتى 6 كروت في الصف على الشاشات الواسعة */
.branch-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.branch-card {
  border-radius: 18px;
  border: 1px solid #eceef4;
  background: #fff;
  box-shadow: 0 12px 24px rgba(11, 14, 20, 0.07);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.branch-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(10, 14, 22, 0.12);
}

.branch-card-top {
  --branch-flag-size: 56px;
  --branch-flag-overlap: 28px;
  position: relative;
  min-height: 78px;
  background: #f3f5f9;
  padding: 14px 12px calc(var(--branch-flag-overlap) + 8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.branch-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 999px;
  background: #ffffff;
  color: #a11222;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid #f0d3d8;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-flag {
  width: var(--branch-flag-size);
  height: var(--branch-flag-size);
  border-radius: 999px;
  object-fit: contain;
  position: absolute;
  right: auto;
  left: 50%;
  bottom: calc(-1 * var(--branch-flag-overlap));
  transform: translateX(-50%);
  border: 3px solid #fff;
  box-shadow: 0 10px 18px rgba(14, 20, 29, 0.16);
  background: #fff;
  padding: 4px;
}

.branch-content {
  padding: 36px 12px 14px;
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
  flex: 1;
  min-width: 0;
}

.branch-title {
  margin: 0;
  color: #171c24;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 900;
  max-width: 100%;
  word-break: break-word;
}

.branch-title span {
  display: block;
  color: #888;
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}

.branch-hours {
  margin: 0;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  color: #4f5562;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  max-width: 100%;
}

.branch-hours i {
  color: #b10f1f;
  margin-top: 2px;
  flex-shrink: 0;
}

.branch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
  width: 100%;
}

.branch-btn {
  min-height: 38px;
  border-radius: 11px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #d9dde6;
  background: #fff;
  color: #1f232b;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 6px 8px;
  line-height: 1.25;
  min-width: 0;
}

.branch-btn.primary {
  background: linear-gradient(135deg, #d70000, #8f000d);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(160, 6, 24, 0.22);
}

.branch-btn:hover {
  transform: translateY(-1px);
}

.branch-card-actions {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 100%;
}

.branch-card-actions .hub-row-actions,
.branch-card-actions .row-actions,
.branch-card-actions [class*="actions"] {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

.branch-card-actions button,
.branch-card-actions a {
  flex: 0 0 auto;
}

body.branches-page .hub-inline-ads {
  width: 100%;
  box-sizing: border-box;
}

/* —— Responsive —— */
@media (max-width: 1400px) {
  .branch-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .branch-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .branch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .branches-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .branches-toolbar input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .branches-toolbar {
    grid-template-columns: 1fr;
  }

  .branch-grid {
    grid-template-columns: 1fr;
  }

  .branches-head {
    text-align: center;
    justify-content: center;
  }

  .branches-head-copy {
    text-align: center;
  }

  .branches-head p {
    margin-inline: auto;
  }

  body.branches-page main.container {
    padding-inline: 12px;
  }

  .branch-card {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .branch-flag {
    position: absolute;
    right: 12px;
    left: auto;
    transform: none;
    bottom: calc(-1 * var(--branch-flag-overlap));
  }

  .branch-card-top {
    align-items: flex-start;
    text-align: right;
    padding-inline-end: calc(var(--branch-flag-size) + 20px);
  }

  .branch-content {
    text-align: right;
    width: 100%;
    justify-items: stretch;
  }

  .branch-hours {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .branch-actions {
    width: 100%;
  }

  .branch-actions a,
  .branch-actions button {
    min-height: 42px;
  }
}

@media (min-width: 420px) and (max-width: 640px) {
  .branch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
