<style>
#branches-block { box-sizing: border-box; padding: 16px; width: 100%; }
#branches-block * { box-sizing: border-box; }
.branches-inner { max-width: 1400px; margin: 0 auto; }
.branches-header { text-align: center; margin-bottom: 18px; }
.branches-title {
  background: #b91c1c; color: #fff; border-radius: 10px;
  padding: 10px 20px; font-size: 20px; font-weight: 700;
}
.branches-grid { display: grid; gap: 20px; justify-content: center; }
@media (max-width: 767px) { .branches-grid { grid-template-columns: 1fr; } }
@media (min-width: 768px) and (max-width: 1199px) {
  .branches-grid { grid-template-columns: repeat(2, minmax(0, 360px)); }
}
@media (min-width: 1200px) { .branches-grid { grid-template-columns: repeat(4, 1fr); } }

/* الكارد */
.branches-card {
  position: relative;
  background-size: cover;
  background-position: center;
  border-radius: 14px;
  padding: 24px;
  min-height: 320px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform .2s ease, box-shadow .2s ease;
  overflow: hidden;
}
.branches-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(11,11,11,0.18);
}

/* الغطاء التدريجي الغامق */
.branches-overlay {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 70%);
  transition: background 0.3s ease;
}
.branches-card:hover .branches-overlay {
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 70%);
}

.branches-info { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; height: 100%; }

.branches-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.branches-name {
  margin: 0; font-size: 18px; font-weight: 700;
  word-break: break-word; 
  overflow-wrap: anywhere;
  white-space: normal;
}

.branches-status-wrap { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.branches-status-badge { width: 12px; height: 12px; border-radius: 50%; }

.open .branches-status-badge { background-color: #00ff00; animation: pulseGreen 1.8s infinite; }
.closed .branches-status-badge { background-color: #ff0000; animation: pulseRed 1.8s infinite; }

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(0,255,0,0.6); }
  70% { box-shadow: 0 0 0 14px rgba(0,255,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,255,0,0); }
}
@keyframes pulseRed {
  0% { box-shadow: 0 0 0 0 rgba(255,0,0,0.6); }
  70% { box-shadow: 0 0 0 14px rgba(255,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,0,0,0); }
}

.branches-bottom { display: flex; flex-direction: column; gap: 8px; flex-wrap: wrap; }
.branches-hours-label { font-weight: 600; font-size: 14px; }
.branches-hours { font-size: 14px; color: #fff; word-break: break-word; }
.branches-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.branches-btn {
  flex: 1 1 auto; 
  min-width: 80px; 
  background: #b91c1c; color: #fff; border: none;
  border-radius: 8px; padding: 8px 12px;
  font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
  white-space: normal;
}
</style>
