/* =========================================================
   ApexHorizon Logistics — Service Card Slider Styling
   Proportional images, centered text, bottom-anchored buttons
   ========================================================= */

/* Main Slider Container */
.ah-service-slider {
  --ah-slider-gap: 24px;
  --ah-slider-blue: #2160D5;
  --ah-slider-blue-hover: #1749A8;

  display: block !important;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Viewport Clips Overflow */
.ah-service-slider .ah-slider-viewport {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Horizontal Sliding Track */
.ah-service-slider .ah-slider-track {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important; /* Forces all cards to match height */
  gap: var(--ah-slider-gap) !important;
  width: 100%;
  transition: transform 420ms cubic-bezier(.22, .75, .25, 1);
  will-change: transform;
}

/* ---------------------------------------------------------
   Equal-Height Card Layout & Styling
   --------------------------------------------------------- */
.ah-service-slider .ah-slider-track > .ext-card {
  display: flex !important;
  flex: 0 0 calc((100% - (3 * var(--ah-slider-gap))) / 4) !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: space-between !important; /* Pushes content down to the bottom button */

  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  box-sizing: border-box !important;
  border-radius: 20px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  overflow: hidden !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

/* ---------------------------------------------------------
   Image Proportions (Fluid Aspect Ratio)
   --------------------------------------------------------- */
.ah-service-slider .ah-slider-track > .ext-card figure,
.ah-service-slider .ah-slider-track > .ext-card .ext-card-image {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 auto !important;
  overflow: hidden !important;
}

.ah-service-slider .ah-slider-track > .ext-card figure a,
.ah-service-slider .ah-slider-track > .ext-card .ext-card-image a {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

.ah-service-slider .ah-slider-track > .ext-card figure img,
.ah-service-slider .ah-slider-track > .ext-card .ext-card-image img {
  display: block !important;
  width: 100% !important;
  height: 200px !important; /* Standard height across cards */
  object-fit: cover !important; /* Preserves aspect ratio without stretching */
  object-position: center !important;
  border: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

/* ---------------------------------------------------------
   Card Body & Centered Text Content
   --------------------------------------------------------- */
.ah-service-slider .ah-slider-track > .ext-card .ext-card-content {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  justify-content: space-between !important; /* Keeps bottom elements pinned to bottom */
  align-items: center !important;
  padding: 24px 20px !important;
  text-align: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.ah-service-slider .ah-slider-track > .ext-card .ext-card-body {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  text-align: center !important;
  gap: 8px !important;
}

/* Headings & Text Formatting */
.ah-service-slider .ah-slider-track > .ext-card h1,
.ah-service-slider .ah-slider-track > .ext-card h2,
.ah-service-slider .ah-slider-track > .ext-card h3,
.ah-service-slider .ah-slider-track > .ext-card h4,
.ah-service-slider .ah-slider-track > .ext-card p {
  width: 100% !important;
  margin: 0 !important;
  text-align: center !important;
  color: #1e293b !important;
}

.ah-service-slider .ah-slider-track > .ext-card h3 a {
  color: var(--ah-slider-blue) !important;
  text-decoration: none !important;
  font-weight: 700 !important;
}

.ah-service-slider .ah-slider-track > .ext-card p {
  color: #64748b !important;
  font-size: 14px !important;
}

/* ---------------------------------------------------------
   Buttons Centered at the Bottom of Each Card
   --------------------------------------------------------- */
.ah-service-slider .ah-slider-track > .ext-card .wp-block-buttons {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  margin-top: 16px !important;
}

.ah-service-slider .ah-slider-track > .ext-card .wp-block-button {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
}

.ah-service-slider .ah-slider-track > .ext-card .wp-block-button__link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 200px !important;
  min-height: 44px !important;
  padding: 10px 20px !important;
  background-color: var(--ah-slider-blue) !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  text-align: center !important;
  text-decoration: none !important;
  transition: background-color 0.2s ease !important;
}

.ah-service-slider .ah-slider-track > .ext-card .wp-block-button__link:hover {
  background-color: var(--ah-slider-blue-hover) !important;
}

/* ---------------------------------------------------------
   Controls (Arrows & Dots)
   --------------------------------------------------------- */
.ah-service-slider .ah-slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.ah-service-slider .ah-slider-arrow {
  appearance: none;
  border: 0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  background: var(--ah-slider-blue);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s ease, transform .2s ease;
}

.ah-service-slider .ah-slider-arrow:hover:not(:disabled) {
  background: var(--ah-slider-blue-hover);
  transform: scale(1.05);
}

.ah-service-slider .ah-slider-arrow:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.ah-service-slider .ah-slider-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ah-service-slider .ah-slider-dot {
  appearance: none;
  border: 0;
  border-radius: 50%;
  width: 9px;
  height: 9px;
  background: #cbd5e1;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}

.ah-service-slider .ah-slider-dot[aria-current="true"] {
  background: var(--ah-slider-blue);
  transform: scale(1.3);
}

/* ---------------------------------------------------------
   Responsive Media Queries
   --------------------------------------------------------- */
@media (max-width: 1100px) {
  .ah-service-slider .ah-slider-track > .ext-card {
    flex: 0 0 calc((100% - (2 * var(--ah-slider-gap))) / 3) !important;
  }
}

@media (max-width: 800px) {
  .ah-service-slider .ah-slider-track > .ext-card {
    flex: 0 0 calc((100% - var(--ah-slider-gap)) / 2) !important;
  }
}

@media (max-width: 600px) {
  .ah-service-slider .ah-slider-track > .ext-card {
    flex: 0 0 100% !important;
  }
}
