:root {
    --abpg-orange: #f5871f;
    --abpg-dark: #1e2937;
    --abpg-radius: 14px;
}

.abpg-wrap, .abpg-wrap * { box-sizing: border-box; }
.abpg-wrap { max-width: 1200px; margin: 0 auto; padding: 40px 20px; overflow-x: hidden; width: 100%; }
.abpg-heading { text-align: center; font-size: 28px; margin: 0 0 30px; color: var(--abpg-dark); }
.abpg-row { margin-bottom: 36px; max-width: 100%; }
.abpg-cat-title { font-size: 20px; margin: 0 0 14px; color: var(--abpg-dark); }

.abpg-slider-wrap { position: relative; max-width: 100%; }
.abpg-track {
    display: flex; gap: 16px; overflow-x: auto; scroll-behavior: smooth;
    scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none;
    box-sizing: border-box;
}
.abpg-track::-webkit-scrollbar { display: none; }

.abpg-card {
    /* Desktop: 3 cards visible (2 gaps of 16px shared across 3 cards) */
    flex: 0 0 calc((100% - 32px) / 3) !important;
    max-width: calc((100% - 32px) / 3) !important;
    box-sizing: border-box;
    scroll-snap-align: start; background: #fff;
    border-radius: var(--abpg-radius); overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.08); cursor: pointer;
}
.abpg-card-img { height: 200px; background-size: cover; background-position: center; position: relative; }
.abpg-badge {
    position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.65);
    color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 20px;
}
.abpg-card-info { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; gap: 10px; }
.abpg-card-info .abpg-card-title {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600 !important;
    color: var(--abpg-dark) !important;
    font-size: 15px !important;
}
.abpg-card-info .abpg-view-link {
    flex: 0 0 auto !important;
    color: var(--abpg-orange); font-weight: 600; text-decoration: none; font-size: 14px; white-space: nowrap;
}

.abpg-nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
    border-radius: 50%; background: var(--abpg-orange); color: #fff; border: none;
    cursor: pointer; font-size: 14px; z-index: 2; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.abpg-prev { left: 8px; }
.abpg-next { right: 8px; }

.abpg-modal {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6);
    z-index: 2147483647; align-items: center; justify-content: center; padding: 20px;
}
.abpg-modal.is-open { display: flex; }
.abpg-modal-inner {
    background: #fff; border-radius: 16px; max-width: 900px; width: 100%;
    max-height: 92vh; overflow-y: auto; padding: 26px; position: relative;
}
.abpg-close {
    position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 50%;
    background: var(--abpg-dark); color: #fff; border: none; cursor: pointer; font-size: 18px;
}
.abpg-modal-title { margin: 0 0 4px; font-size: 24px; color: var(--abpg-dark); }
.abpg-modal-meta { margin: 0 0 16px; color: #667085; font-size: 14px; }
.abpg-modal-main { position: relative; border-radius: 12px; overflow: hidden; background: #f2f2f2; }
.abpg-modal-image { width: 100%; height: 420px; object-fit: cover; display: block; }
.abpg-modal-count {
    position: absolute; top: 14px; right: 14px; background: rgba(0,0,0,.6);
    color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 14px;
}
.abpg-modal-prev { left: 14px; }
.abpg-modal-next { right: 14px; }
.abpg-modal-thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.abpg-modal-thumbs img {
    width: 90px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer;
    opacity: .7; border: 2px solid transparent; flex: 0 0 auto;
}
.abpg-modal-thumbs img.is-active { opacity: 1; border-color: var(--abpg-orange); }
.abpg-modal-footer {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 20px; margin-top: 20px; flex-wrap: wrap;
}
.abpg-modal-footer h4 { margin: 0 0 6px; color: var(--abpg-dark); }
.abpg-modal-overview { color: #475467; max-width: 560px; margin: 0 0 10px; }
.abpg-modal-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.abpg-modal-tags span { background: #eef1f4; color: #344054; font-size: 12px; padding: 5px 12px; border-radius: 16px; }
.abpg-modal-cta { background: var(--abpg-orange); color: #fff; text-decoration: none; font-weight: 600; padding: 12px 20px; border-radius: 8px; white-space: nowrap; }

/* Tablet: 2 cards visible, each 45% width (small gap/peek between cards) */
@media (max-width: 900px) and (min-width: 641px) {
    .abpg-card {
        flex-basis: 45% !important;
        max-width: 45% !important;
    }
}

/* Mobile: 1 card visible, full width */
@media (max-width: 640px) {
    .abpg-modal-image { height: 260px; }
    .abpg-card {
        flex-basis: 100% !important;
        max-width: 100% !important;
    }
    .abpg-nav { display: none; }
}

.abpg-dots { display: none; justify-content: center; gap: 8px; margin-top: 12px; }
.abpg-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: #d0d5dd; cursor: pointer; transition: all .2s; }
.abpg-dot.is-active { background: var(--abpg-orange); width: 22px; border-radius: 8px; }
@media (max-width: 640px) { .abpg-dots { display: flex; } }
