.apps-list {
  margin-top: 100px;
  background: var(--body-color);
  min-height: calc(100vh - 160px);
}

.section-p {
    text-align: center;
}

/* Grid: 1 column on mobile, 2 on tablet/desktop */
.apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 10px;
}

@media (min-width: 768px) {
  .apps-grid {
    grid-template-columns: repeat(2, minmax(320px, 1fr)); /* 2-up */
  }
}

/* App card: side by side layout */
.app-card {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center; /* vertical centering */
  gap: 20px;
  padding: 24px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  transition: transform 0.2s ease-in-out;
}

.app-card:hover {
  transform: translateY(-4px);
}

/* Left: image + name stacked */
.app-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.app-icon {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border: 2px dotted var(--border);
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.app-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--p);
  text-align: center;
}

/* Right: vertical buttons */
.app-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  align-items: flex-end;
}

/* Modern buttons */
.app-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  min-height: 44px;
  min-width: 200px;
  background-color: #63C328;
  color: #000;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.2s, transform 0.1s;
  outline: none;
  border: 2px solid transparent;
  white-space: nowrap;
}

.app-download-btn:hover {
  background-color: #da7310;
}

.app-download-btn:focus-visible {
  border-color: var(--btn-border);
  box-shadow: 0 0 0 3px rgb(99 195 40 / 30%);
}

/* Disabled buttons */
.app-download-btn.disabled {
  background-color: #ccc;        
  color: #666;                    
  border: 2px solid #bbb;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.app-download-btn.disabled:hover {
  background-color: #ccc;         
}

/* Large screens tweak */
@media (min-width: 1280px) {
  .app-icon { width: 160px; height: 160px; }
  .app-name { font-size: 1.35rem; }
  .app-download-btn { min-width: 240px; }
}

/* ===== Mobile refinements ===== */
@media (max-width: 767px) {
  /* Keep two-column layout on mobile and align tops */
  .app-card {
    display: grid;
    grid-template-columns: min(120px, 30vw) 1fr; /* left a bit narrower on small screens */
    align-items: start;                           /* <-- top-align both columns */
    gap: 16px 16px;
    padding: 16px;                                /* tighter card padding on mobile */
  }

  /* Left column (image + name) */
  .app-left {
    display: grid;
    justify-items: center;    /* center icon + name under it */
    align-content: start;     /* stack from top */
    gap: 8px;
  }

  /* Make icon responsive but not huge */
  .app-icon {
    width: clamp(88px, 28vw, 112px);
    height: clamp(88px, 28vw, 112px);
  }

  .app-name {
    font-size: clamp(1rem, 3.5vw, 1.1rem);
    text-align: center;
    margin: 0;
  }

  /* Right column (vertical buttons), aligned to the right edge */
  .app-right {
    display: grid;
    gap: 10px;               /* slightly tighter than desktop */
    justify-self: end;       /* keep the column right-aligned */
    width: 100%;
    max-width: 320px;        /* prevent buttons from stretching too wide */
  }

  /* Smaller buttons on mobile while keeping 44px tap target */
  .app-download-btn {
    min-width: 0;            /* allow natural shrink */
    width: 100%;             /* fill right column nicely */
    max-width: 280px;        /* cap width for balance */
    padding: 10px 14px;      /* smaller horizontal padding */
    min-height: 44px;        /* ADA tap-size compliance */
    font-size: 0.95rem;      /* slightly smaller text */
    gap: 6px;
  }
}

/* Ultra-small phones: tighten a bit more */
@media (max-width: 360px) {
  .app-card {
    grid-template-columns: min(104px, 28vw) 1fr;
    gap: 12px 12px;
    padding: 12px;
  }

  .app-icon {
    width: clamp(80px, 26vw, 100px);
    height: clamp(80px, 26vw, 100px);
  }

  .app-download-btn {
    max-width: 260px;
    padding: 9px 12px;
    font-size: 0.9rem;
  }
}
