/* ===============================
Base Layout & Global Styles
================================ */
.at-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

.at-heading {
  font-size: 40px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 20px;
  font-family: "Manrope", sans-serif !important;
  height: 54px !important;
  letter-spacing: -0.5px !important;
}

/* ===============================
Tabs
================================ */
.at-tabs {
  display: flex;
  flex-basis: initial !important;
  flex-direction: row !important;
  flex-shrink: 0 !important;
  flex-wrap: wrap;
  justify-content: flex-start !important;
  gap: 15px;
  margin-bottom: 24px;
  overflow-x: initial !important;
  scrollbar-width: none !important;
  letter-spacing: -0.1px !important;
  line-height: 19px !important;
}

.at-tab {
  padding: 9px 24px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  border: 1px solid #e9eaeb !important;
  background: transparent !important;
  color: #535862 !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  line-height: 19px !important;
}

.at-tab:hover,
.at-tab--active {
  background: #1f4282 !important;
  color: #fff !important;
  border-color: #1f4282 !important;
}

/* ===============================
Panels & Grid Base
================================ */
.at-panel {
  display: none;
}
.at-panel--active {
  display: block;
}

.at-grid {
  display: grid;
  grid-template-columns: repeat(3, 397.328px);
  gap: 22px;
}

/* Default Desktop: show first 6 only */
.at-grid .at-card:nth-child(n + 7) {
  display: none;
}

/* ===============================
Card Styling
================================ */
.at-card {
  position: relative;
  display: block;
  border-radius: 16px;
  border: 1px solid #e9eaeb;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  text-decoration: none;
  height: 345px;
  width: 397.328px;
}

/* Only target direct child img (product thumbnail) */
.at-card > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.at-overlay {
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(
    180deg,
    rgba(31, 66, 130, 0) 0%,
    rgba(31, 66, 130, 1) 100%
  ) !important;
  z-index: 1;
}

.at-card-content {
  position: absolute;
  bottom: -50px;
  left: 20px;
  right: 0;
  padding: 0px 0px 0px 0px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 10;
  transition: transform 0.3s ease;
}

.at-title {
  color: #fff !important;
  font-family: "Manrope", sans-serif !important;
  font-weight: 700 !important;
  font-size: 24px !important;
  line-height: inherit !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) !important;
  transition: transform 0.3s ease !important;
}

/* ===============================
Donate Button (Desktop/Tablet only)
================================ */
.at-donate-btn {
  background: #f6895b;
  color: #000;
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  font-family: "Manrope", sans-serif;
  width: 159px;
  text-align: center;
  height: 45px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.akhyar-cta-arrow {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain !important;
  position: static !important;
  inset: unset !important;
  flex-shrink: 0;
}

/* ===============================
Mobile Arrow (Mobile only)
================================ */
.at-mobile-arrow {
  display: none;
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  align-items: center;
  justify-content: center;
  z-index: 4;
  flex-shrink: 0;
}

.at-mobile-arrow svg {
  width: 14px !important;
  height: 14px !important;
  position: static !important;
  inset: unset !important;
  display: block;
  flex-shrink: 0;
}

/* ===============================
Show More Button
================================ */
.at-more-wrap {
  display: none;
  text-align: center;
  margin-top: 20px;
  justify-content: center;
}

.at-more-btn {
  padding: 11px 32px 14px 32px !important;
  background: #fff !important;
  color: #1c1d30 !important;
  border: 2px solid #fd8b66 !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  fill: rgb(28, 29, 48) !important;
  height: 46px !important;
  width: 140.16px !important;
  display: inline-block !important;
}

.at-more-btn:hover {
  background: #fd8b66 !important;
  color: #1c1d30 !important;
}

/* ===============================
RESPONSIVE QUERIES
================================ */

/* ── Desktop Hover Effects (≥768px) ── */
@media (min-width: 768px) {
  .at-card:hover .at-title {
    transform: translateY(-60px) !important;
  }
  .at-card:hover .at-donate-btn {
    opacity: 1;
    transform: translateY(-60px) !important;
  }
}

/* ── Laptop (1024px – 1199px) ── */
@media (min-width: 1024px) and (max-width: 1199px) {
  .at-grid {
    grid-template-columns: repeat(2, 484px) !important;
    justify-content: center;
    gap: 22px !important;
  }
  .at-card {
    width: 484px !important;
    height: 345px !important;
    aspect-ratio: unset !important;
  }
  .at-title {
    font-size: 18px !important;
    line-height: 28px !important;
  }
}

/* ── Tablet (768px – 1023px) ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .at-grid {
    grid-template-columns: repeat(2, 356px) !important;
    justify-content: center;
    gap: 24px !important;
  }
  .at-card {
    width: 356px;
    height: 340px;
    aspect-ratio: unset;
  }
  .at-title {
    font-size: 18px !important;
    line-height: 28px !important;
  }
}

/* ── Mobile General (≤767px) ── */
@media (max-width: 767px) {
  .at-section {
    padding: 24px 14px;
  }

  .at-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .at-heading {
    font-size: 30px;
    margin-bottom: 5px !important;
    line-height: 38px !important;
    letter-spacing: -0.5px !important;
  }
  .at-tabs {
    gap: 10px !important;
  }

  /* FIX: base title wrapping for ALL mobile sizes */
  .at-title {
    font-size: 12px !important;
    line-height: 1.4 !important;
    padding: 0px 36px 10px 10px !important;
    white-space: normal !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    word-break: break-word !important;
  }

  /* Show first 4 only on mobile */
  .at-grid .at-card:nth-child(n + 7) {
    display: block;
  }
  .at-grid .at-card:nth-child(n + 5) {
    display: none;
  }

  /* Reveal all when expanded */
  .at-grid.at-expanded .at-card {
    display: block !important;
  }

  .at-more-wrap {
    display: block;
  }

  /* Hide donate btn, show mobile arrow */
  .at-donate-btn {
    display: none !important;
  }
  .at-mobile-arrow {
    display: flex;
  }
  .at-tab {
    font-size: 14px !important;
    padding: 9px 18px !important;
    line-height: 18px !important;
  }
}

/* ── Mobile Medium (480px – 767px) ── */
@media (min-width: 480px) and (max-width: 767px) {
  .at-grid {
    grid-template-columns: repeat(2, 189px);
    justify-content: center;
    gap: 12px;
  }
  .at-card {
    width: 189px;
    height: 135px;
    aspect-ratio: unset;
  }
  .at-title {
    font-size: 0.9rem !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    word-break: break-word !important;
    padding: 0px 36px 10px 10px !important;
  }
  .at-card-content {
    padding: 10px;
    gap: 6px;
  }
  .at-mobile-arrow {
    width: 26px;
    height: 26px;
    bottom: 8px;
    right: 8px;
  }
  .at-mobile-arrow svg {
    width: 14px !important;
    height: 14px !important;
  }
}

/* ── Mobile 400px–479px (covers 425px) ── */
@media (min-width: 400px) and (max-width: 479px) {
  .at-grid {
    grid-template-columns: repeat(2, 188.5px);
    justify-content: center;
    gap: 14px;
  }
  .at-card {
    width: 188.5px !important;
    height: 132px !important;
    aspect-ratio: unset !important;
    border-radius: 14px !important;
  }
  .at-title {
    font-size: 12px !important;
    line-height: 20px !important;
    white-space: normal !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    word-break: break-word !important;
    padding: 0px 36px 10px 10px !important;
  }
  .at-card-content {
    padding: 0px 4px;
    gap: 5px;
    left: 0;
    bottom: 0;
  }
  .at-mobile-arrow {
    width: 24px !important;
    height: 24px !important;
    bottom: 8px !important;
    right: 7px !important;
  }
  .at-mobile-arrow svg {
    width: 15px !important;
    height: 15px !important;
  }
  .at-tabs--wrap {
    flex-wrap: wrap !important;
    overflow-x: hidden !important;
  }
  .at-heading {
    font-size: 30px !important;
    margin-bottom: 10px !important;
    letter-spacing: -0.5px !important;
    line-height: 39px !important;
  }
}

@media (min-width: 376px) and (max-width: 479px) {
  .at-tabs.at-tabs--single-line {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .at-tabs.at-tabs--single-line::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  .at-tabs.at-tabs--wrap {
    flex-wrap: wrap !important;
    overflow-x: hidden !important;
  }
}

/* ── Mobile Small (375px – 399px) ── */
@media (min-width: 375px) and (max-width: 399px) {
  .at-grid {
    grid-template-columns: repeat(2, 167.5px);
    justify-content: center;
    gap: 14px;
  }
  .at-card {
    width: 167.5px !important;
    height: 132px !important;
    aspect-ratio: unset !important;
    border-radius: 14px !important;
  }
  .at-title {
    font-size: 12px !important;
    line-height: 20px !important;
    white-space: normal !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    word-break: break-word !important;
    padding: 0px 36px 10px 10px !important;
  }
  .at-card-content {
    padding: 2px 4px;
    gap: 4px;
    left: 0;
    bottom: 0;
  }
  .at-mobile-arrow {
    width: 24px !important;
    height: 24px !important;
    bottom: 9px !important;
    right: 7px !important;
  }
  .at-mobile-arrow svg {
    width: 15px !important;
    height: 15px !important;
  }
}

/* ── Mobile Small (320px – 374px) ── */
@media (min-width: 320px) and (max-width: 374px) {
  .at-grid {
    grid-template-columns: repeat(2, 138px) !important;
    gap: 14px !important;
    justify-content: center;
    max-width: 100%;
    margin: 0 auto;
  }
  .at-card {
    width: 139px !important;
    max-width: 158px !important;
    height: 132px !important;
    aspect-ratio: unset !important;
    border-radius: 12px !important;
    margin: 0 auto;
  }
  .at-title {
    font-size: 11.5px !important;
    line-height: 20px !important;
    white-space: normal !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    word-break: break-word !important;
    padding: 0px 36px 10px 10px !important;
  }
  .at-card-content {
    padding: 0;
    gap: 4px;
    bottom: 0;
    left: 0;
  }
  .at-mobile-arrow {
    width: 22px !important;
    height: 22px !important;
    bottom: 8px !important;
    right: 6px !important;
  }
  .at-mobile-arrow svg {
    width: 15px !important;
    height: 15px !important;
  }
  .at-more-btn {
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ── Mobile Extra Small (below 320px) ── */
@media (max-width: 319px) {
  .at-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    justify-content: center;
  }
  .at-card {
    width: 100% !important;
    max-width: 136px !important;
    height: 118px !important;
    margin: 0 auto;
    border-radius: 10px !important;
  }
  .at-title {
    font-size: 11px !important;
    line-height: 20px !important;
    white-space: normal !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    word-break: break-word !important;
    padding: 0px 36px 10px 10px !important;
  }
  .at-card-content {
    padding: 0px 4px;
    gap: 3px;
    left: 0;
    bottom: 0;
  }
  .at-mobile-arrow {
    width: 20px;
    height: 20px;
    bottom: 5px;
    right: 5px;
  }
  .at-mobile-arrow svg {
    width: 11px !important;
    height: 11px !important;
  }
}
