/* ==========================================================================
   CarVice Express (كارفيس إكسبريس) - Branches Page Stylesheet
   Designed strictly from "كارفيس الفروع.pdf" reference
   ========================================================================== */

/* Page Canvas */
body.branches-page {
  background-color: #FFFAEC;
  color: var(--color-text-dark);
  font-family: var(--font-family-base);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   1. Branches Hero Section — full-width image display
   -------------------------------------------------------------------------- */
.branches-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #0B0E11;
  overflow: hidden;
  /* No fixed min-height: the image dictates the height */
}

/* The hero image shown in full, no cropping */
.branches-hero-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* "فروعنا" title overlay on top of the image */
.branches-hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
  padding-top: var(--header-height, 86px);
}

.branches-hero-title {
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 80px;
  line-height: 90px;
  letter-spacing: 0;
  text-align: center;
  vertical-align: middle;
  text-transform: uppercase;
  color: #FFFFFF;
  margin: 0;
  opacity: 1;
  text-shadow: 0 4px 25px rgba(0, 0, 0, 0.8), 0 0 30px rgba(243, 168, 5, 0.3);
}

@media (max-width: 768px) {
  .branches-hero-title {
    font-size: 52px;
    line-height: 62px;
  }
}

@media (max-width: 480px) {
  .branches-hero-title {
    font-size: 42px;
    line-height: 52px;
  }
}



/* --------------------------------------------------------------------------
   2. Branches Main Section
   -------------------------------------------------------------------------- */
.branches-main-section {
  background-color: #FFFAEC;
  padding: 50px 24px 120px;
  position: relative;
}

@media (min-width: 1200px) {
  .branches-main-section {
    padding: 60px 40px 140px;
  }
}

/* Cards List Container */
.branches-cards-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto;
}

@media (min-width: 1400px) {
  .branches-cards-list {
    gap: 36px;
  }
}

/* --------------------------------------------------------------------------
   3. Branch Card — frame.png as decorative border (Zero-gap seamless fit)
   -------------------------------------------------------------------------- */
.branch-card {
  position: relative;
  transition: filter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.branch-card:hover {
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.15)) drop-shadow(0 4px 14px rgba(243, 168, 5, 0.22));
}

/* The frame.png image wraps the card border seamlessly */
.branch-card-frame {
  position: absolute;
  top: -4.8px;
  left: -9.5px;
  width: calc(100% + 19px);
  height: calc(100% + 16px);
  max-width: none;
  pointer-events: none;
  z-index: 2;
}

/* The actual card content sits inside the frame with 0 margin gap */
.branch-card-inner {
  position: relative;
  z-index: 1;
  background: #FFFFFF;
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  transform: translateZ(0);
  isolation: isolate;
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.branch-card:hover .branch-card-inner {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

/* Desktop: two-column layout — Info right (~40%), Map left (~60%) in RTL */
@media (min-width: 992px) {
  .branch-card-inner {
    grid-template-columns: 0.95fr 1.05fr;
    margin: 0;
  }
}

/* Info Side (Right in RTL) */
.branch-card-info {
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #FFFFFF;
  gap: 6px;
}

@media (min-width: 768px) {
  .branch-card-info {
    padding: 48px 40px;
    gap: 8px;
  }
}

/* Region + City title in gold */
.branch-card-title {
  font-size: clamp(1.5rem, 2.5vw, 1.95rem);
  font-weight: 800;
  color: var(--color-gold);
  margin: 0 0 8px;
  line-height: 1.3;
}

/* Neighborhood address in dark */
.branch-card-address {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 700;
  color: #1A1D20;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* Primary CTA button (gold pill) */
.branch-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-gold);
  color: #0B0E11;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 12px 38px;
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 18px rgba(243, 168, 5, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.branch-btn-primary:hover {
  background: var(--color-gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(243, 168, 5, 0.5);
  color: #0B0E11;
}

/* Light beam sweep on button hover */
.branch-btn-primary::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  transition: all 0.6s ease;
  pointer-events: none;
}

.branch-btn-primary:hover::before {
  animation: btnLightBeam 1.2s cubic-bezier(0.19, 1, 0.22, 1) infinite;
}

/* Map Side (Left in RTL) */
.branch-card-map-wrap {
  position: relative;
  min-height: 200px;
  background-color: #E5E7EB;
  overflow: hidden;
  border-top-left-radius: 28px;
  border-bottom-left-radius: 28px;
}

@media (min-width: 992px) {
  .branch-card-map-wrap {
    min-height: 100%;
  }
}

.branch-map-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (min-width: 992px) {
  .branch-map-img {
    position: absolute;
    inset: 0;
  }
}

/* "Open in Maps" badge (top-left corner on map) */
.branch-map-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.82rem;
  font-weight: 700;
  color: #1A1D20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.branch-map-badge:hover {
  background: var(--color-gold);
  color: #0B0E11;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(243, 168, 5, 0.35);
}

.branch-map-badge svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   4. Mobile Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .branch-card-inner {
    grid-template-columns: 1fr;
  }

  /* On mobile: map on top, info below */
  .branch-card-info {
    order: 2;
  }

  .branch-card-map-wrap {
    order: 1;
    min-height: 220px;
    border-radius: 28px 28px 0 0;
  }
}

@media (max-width: 480px) {
  .branches-main-section {
    padding: 30px 16px 80px;
  }

  .branches-cards-list {
    gap: 24px;
  }

  .branch-card-info {
    padding: 24px 20px;
  }

  .branch-card-title {
    font-size: 1.35rem;
  }

  .branch-card-address {
    font-size: 1.05rem;
    margin-bottom: 16px;
  }

  .branch-btn-primary {
    font-size: 1rem;
    padding: 10px 28px;
  }

  .branch-card-inner {
    margin: 0;
  }
}
