.apc-gallery{
  display:grid;
  grid-template-columns:repeat(var(--apc-cols-desktop,3),minmax(0,1fr));
  gap:var(--apc-gap,18px);
  width:100%;
  box-sizing:border-box;
  margin:22px 0;
}
.apc-gallery-card{
  appearance:none;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg,#16181d 0%,#0e1014 100%);
  padding:0;
  margin:0;
  border-radius:calc(var(--apc-radius,18px) + 2px);
  overflow:hidden;
  box-shadow:0 16px 34px rgba(0,0,0,.24);
  cursor:pointer;
  text-align:left;
  transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  display:flex;
  flex-direction:column;
}
.apc-gallery-card:hover{
  transform:translateY(-5px);
  border-color:rgba(226,52,58,.55);
  box-shadow:0 22px 44px rgba(0,0,0,.34),0 0 0 1px rgba(226,52,58,.18);
}
.apc-gallery-card img{
  width:100%;
  height:var(--apc-img-height,420px);
  object-fit:var(--apc-img-fit,cover);
  display:block;
  background:#111;
}
.apc-gallery-card span{
  display:block;
  padding:14px 16px;
  font-size:15px;
  line-height:1.35;
  font-weight:800;
  color:#f4f6fb;
  background:linear-gradient(180deg,rgba(255,255,255,.02) 0%,rgba(255,255,255,.01) 100%);
}

.apc-modal,
.apc-auto-popup{
  position:fixed;
  inset:0;
  z-index:999999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  box-sizing:border-box;
}
.apc-modal.is-open,
.apc-auto-popup.is-open{
  display:flex;
}
.apc-modal-overlay,
.apc-auto-overlay{
  position:absolute;
  inset:0;
  background:radial-gradient(circle at top, rgba(217,32,39,.16), transparent 28%), rgba(4,6,10,.82);
  backdrop-filter:blur(8px);
}

.apc-modal-dialog,
.apc-auto-dialog{
  position:relative;
  overflow:hidden;
  box-shadow:0 30px 90px rgba(0,0,0,.46);
  animation:apcPop .18s ease-out;
}
.apc-modal-dialog::before,
.apc-auto-dialog::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at top right, rgba(225,38,44,.22), transparent 24%),
    radial-gradient(circle at bottom left, rgba(46,89,255,.12), transparent 26%),
    linear-gradient(135deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,0) 42%);
}
.apc-modal-dialog::after,
.apc-auto-dialog::after{
  content:"";
  position:absolute;
  inset:1px;
  border-radius:inherit;
  border:1px solid rgba(255,255,255,.08);
  pointer-events:none;
}

.apc-modal-dialog{
  width:min(920px,100%);
  max-height:92vh;
  background:linear-gradient(180deg,#15181d 0%,#0a0c10 100%);
  border-radius:24px;
}
.apc-modal-image{
  display:block;
  width:100%;
  max-height:72vh;
  object-fit:contain;
  background:#050608;
  position:relative;
  z-index:1;
}
.apc-modal-content{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:18px 20px 20px;
  background:linear-gradient(180deg,rgba(255,255,255,.02) 0%,rgba(255,255,255,.01) 100%);
  border-top:1px solid rgba(255,255,255,.08);
}
.apc-modal-title{
  font-size:18px;
  line-height:1.3;
  margin:0;
  color:#f8faff;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:-.02em;
}
.apc-modal-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:0 18px;
  border-radius:999px;
  background:linear-gradient(135deg,#e1272d 0%,#8d0f14 100%);
  color:#fff;
  text-decoration:none;
  font-weight:900;
  white-space:nowrap;
  box-shadow:0 10px 24px rgba(225,39,45,.26);
}
.apc-modal-link:hover{
  color:#fff;
  opacity:.92;
}
.apc-modal-link[hidden]{display:none}
.apc-modal-close{
  position:absolute;
  right:14px;
  top:14px;
  width:46px;
  height:46px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(12,14,18,.78);
  backdrop-filter:blur(10px);
  font-size:28px;
  line-height:40px;
  cursor:pointer;
  z-index:4;
  color:#fff;
  font-weight:400;
  box-shadow:0 10px 26px rgba(0,0,0,.22);
}
.apc-modal-close:hover{
  background:rgba(225,39,45,.18);
  border-color:rgba(225,39,45,.42);
}
.apc-gallery-empty{
  padding:12px 14px;
  background:#fff8e5;
  border:1px solid #f0d58a;
  border-radius:10px;
}

.apc-auto-dialog{
  width:min(var(--apc-popup-width,1040px), calc(100vw - 36px));
  max-height:min(90vh, 900px);
  background:
    linear-gradient(180deg, rgba(22,24,29,.98) 0%, rgba(9,11,15,.98) 100%),
    #0c0f13;
  border-radius:28px;
  display:flex;
  flex-direction:column;
}
.apc-auto-head{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  align-items:center;
  min-height:84px;
  padding:22px 80px 18px 26px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg,rgba(17,20,25,.95) 0%, rgba(14,16,21,.9) 100%);
  backdrop-filter:blur(8px);
}
.apc-auto-head::before{
  content:"ATHLETIC PERFORMANCE CENTER";
  position:absolute;
  left:26px;
  top:12px;
  font-size:11px;
  line-height:1;
  font-weight:800;
  letter-spacing:.18em;
  color:rgba(255,255,255,.46);
}
.apc-auto-head::after{
  content:"";
  position:absolute;
  left:26px;
  bottom:-1px;
  width:120px;
  height:3px;
  border-radius:999px;
  background:linear-gradient(90deg,#e1272d 0%,#5c0e12 55%,rgba(255,255,255,.3) 100%);
  box-shadow:0 0 20px rgba(225,39,45,.35);
}
.apc-auto-head h2{
  margin:8px 0 0 !important;
  font-size:30px !important;
  line-height:1.08 !important;
  font-weight:900 !important;
  letter-spacing:-.04em;
  color:#f5f7fb !important;
  text-transform:uppercase;
}
.apc-popup-gallery{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:repeat(var(--apc-cols-desktop,3), minmax(0,1fr));
  gap:var(--apc-gap,18px);
  padding:24px;
  overflow:auto;
  align-items:start;
  background:
    linear-gradient(180deg,rgba(255,255,255,.01) 0%,rgba(255,255,255,0) 100%),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size:auto, 24px 24px, 24px 24px;
}
.apc-popup-card{
  position:relative;
  display:block;
  overflow:hidden;
  border-radius:calc(var(--apc-radius,18px) + 4px);
  background:linear-gradient(180deg,#191c22 0%,#0d1014 100%);
  box-shadow:0 14px 38px rgba(0,0,0,.28);
  text-decoration:none !important;
  color:#111 !important;
  transform:translateZ(0);
  transition:transform .24s ease, box-shadow .24s ease, border-color .24s ease;
  isolation:isolate;
  border:1px solid rgba(255,255,255,.08);
}
.apc-popup-card::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius:inherit;
  padding:1px;
  background:linear-gradient(145deg, rgba(255,255,255,.12) 0%, rgba(225,39,45,.34) 48%, rgba(255,255,255,.06) 100%);
  -webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
  pointer-events:none;
  opacity:.8;
}
.apc-popup-card:hover{
  transform:translateY(-6px) scale(1.01);
  box-shadow:0 22px 48px rgba(0,0,0,.34), 0 0 0 1px rgba(225,39,45,.14);
}
.apc-popup-image-wrap{
  position:relative;
  display:block;
  width:100%;
}
.apc-popup-card img{
  width:100%;
  height:var(--apc-img-height,420px);
  object-fit:var(--apc-img-fit,cover);
  display:block;
  background:#0e1116;
}
.apc-popup-card-chip{
  position:absolute;
  top:14px;
  right:14px;
  z-index:2;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:8px 13px;
  border-radius:999px;
  background:linear-gradient(135deg,#e1272d 0%,#8b0f14 100%);
  color:#fff;
  font-size:12px;
  line-height:1.1;
  font-weight:900;
  text-align:center;
  box-shadow:0 12px 24px rgba(225,39,45,.24);
}
.apc-popup-card-chip::before{
  content:"↗";
  display:inline-block;
  margin-right:6px;
  font-size:12px;
  transform:translateY(-1px);
}
.apc-popup-card-overlay{
  position:absolute;
  right:0;
  bottom:0;
  left:0;
  z-index:2;
  display:flex;
  align-items:flex-end;
  min-height:82px;
  padding:32px 16px 16px;
  background:linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(5,6,8,.9) 100%);
}
.apc-popup-card-overlay strong{
  display:block;
  margin:0;
  color:#fff;
  font-size:15px;
  line-height:1.3;
  font-weight:900;
  text-shadow:0 2px 10px rgba(0,0,0,.35);
  text-transform:uppercase;
}

body.apc-modal-locked{overflow:hidden}

@keyframes apcPop{
  from{transform:scale(.96); opacity:.7}
  to{transform:scale(1); opacity:1}
}

@media (max-width: 1024px){
  .apc-auto-head h2{font-size:25px !important;}
}

@media (max-width:900px){
  .apc-gallery{grid-template-columns:repeat(var(--apc-cols-tablet,2), minmax(0,1fr));}
  .apc-modal-dialog{border-radius:20px;}
  .apc-modal-content{align-items:flex-start; flex-direction:column;}
  .apc-modal-link{width:100%;}
  .apc-popup-gallery{grid-template-columns:repeat(var(--apc-cols-tablet,2), minmax(0,1fr)); padding:18px;}
  .apc-auto-dialog{border-radius:24px; width:min(var(--apc-popup-width,1040px), calc(100vw - 28px));}
  .apc-auto-head{min-height:74px; padding:20px 72px 16px 20px;}
  .apc-auto-head::before{left:20px; top:11px; font-size:10px;}
  .apc-auto-head::after{left:20px; width:98px;}
  .apc-auto-head h2{font-size:22px !important; margin-top:10px !important;}
}

@media (max-width: 767px){
  .apc-auto-popup{padding:0; align-items:flex-end;}
  .apc-auto-dialog{
    width:100%;
    max-height:88vh;
    border-radius:26px 26px 0 0;
    box-shadow:0 -8px 44px rgba(0,0,0,.35);
  }
  .apc-auto-head{
    min-height:70px;
    padding:18px 70px 14px 18px;
  }
  .apc-auto-head::before{left:18px; top:10px; font-size:9px; letter-spacing:.16em;}
  .apc-auto-head::after{left:18px; width:88px;}
  .apc-auto-head h2{
    font-size:18px !important;
    line-height:1.15 !important;
    margin-top:9px !important;
  }
  .apc-popup-gallery{
    display:flex;
    gap:14px;
    padding:14px 14px 18px;
    overflow-x:auto;
    overflow-y:hidden;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    background-size:auto, 18px 18px, 18px 18px;
  }
  .apc-popup-gallery::after{
    content:"";
    min-width:2px;
    height:1px;
    flex:0 0 2px;
  }
  .apc-popup-card{
    flex:0 0 calc(100vw - 42px);
    width:calc(100vw - 42px);
    max-width:430px;
    scroll-snap-align:start;
    scroll-snap-stop:always;
    border-radius:20px;
  }
  .apc-popup-card img{height:var(--apc-img-height-mobile,320px);}
  .apc-popup-card-chip{
    top:12px;
    right:12px;
    min-height:34px;
    padding:7px 11px;
    font-size:11px;
  }
  .apc-popup-card-overlay{
    min-height:72px;
    padding:26px 14px 14px;
  }
  .apc-popup-card-overlay strong{font-size:14px;}
}

@media (max-width:600px){
  .apc-gallery{grid-template-columns:repeat(var(--apc-cols-mobile,1), minmax(0,1fr)); gap:14px;}
  .apc-gallery-card img{height:var(--apc-img-height-mobile,320px);}
  .apc-modal{padding:10px;}
  .apc-modal-dialog{max-height:94vh; border-radius:18px;}
  .apc-modal-image{max-height:70vh;}
  .apc-modal-title{font-size:16px;}
  .apc-modal-close{right:10px; top:10px; width:40px; height:40px; font-size:26px; line-height:34px; border-radius:12px;}
  .apc-modal-content{padding:14px;}
  .apc-modal-link{min-height:46px;}
}
