/* ==========================================================
   TrustWeb Gallery Pro — style.css v2.3.3
   ========================================================== */

/* ── WRAPPER ── */
.gp-gallery-wrapper {
    position: relative;
    width: 100%;
    --gp-gap-current: var(--gp-gap-d, 20px);
    --gp-h-current: var(--gp-h-d);
}
@media (max-width: 1024px) { .gp-gallery-wrapper { --gp-h-current: var(--gp-h-t); --gp-gap-current: var(--gp-gap-t, 15px); } }
@media (max-width: 767px)  { .gp-gallery-wrapper { --gp-h-current: var(--gp-h-m); --gp-gap-current: var(--gp-gap-m, 10px); } }

/* ── ITEM ── */
.gp-gallery-item {
    position: relative;
    box-sizing: border-box;
    transform: translate3d(0,0,0);
}

/* ── MEDIA ── */
.gp-media {
    width: 100%;
    display: block;
    height: var(--gp-h-current) !important;
    transition: transform 0.3s ease;
}
.gp-video-wrap { width: 100%; height: var(--gp-h-current) !important; }
.gp-video-wrap iframe { width: 100%; height: 100%; border: none; }
.gp-fit-cover   .gp-media { object-fit: cover; }
.gp-fit-contain .gp-media { object-fit: contain; }

/* ── GRID ── */
.gp-layout-grid .gp-inner {
    display: grid;
    gap: var(--gp-gap-current);
    grid-template-columns: repeat(var(--gp-col-d), 1fr);
}
@media (max-width: 1024px) { .gp-layout-grid .gp-inner { grid-template-columns: repeat(var(--gp-col-t), 1fr); } }
@media (max-width: 767px)  { .gp-layout-grid .gp-inner { grid-template-columns: repeat(var(--gp-col-m), 1fr); } }

/* ── CAROUSEL ARROWS ── */
.gp-swiper { position: relative; }
.gp-swiper .swiper-wrapper { z-index: 1; }
.gp-swiper-button-next,
.gp-swiper-button-prev {
    background-image: none !important;
    margin-top: 0 !important;
    width: 45px !important; height: 45px !important;
    background-color: #fff !important;
    border-radius: 50% !important;
    color: #333 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    position: absolute !important;
    top: 50% !important;
    z-index: 999 !important;
    display: flex !important;
    align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0; visibility: hidden;
}
.gp-swiper-button-next::after, .gp-swiper-button-prev::after {
    font-family: sans-serif !important;
    font-size: 24px !important; font-weight: 300 !important;
    line-height: 1 !important; color: #333 !important;
    position: relative; top: -2px;
}
.gp-swiper-button-next::after { content: '›'; padding-left: 2px; }
.gp-swiper-button-prev::after { content: '‹'; padding-right: 2px; }
.gp-swiper-button-next { right: 15px !important; transform: translateX(20px) translateY(-50%) !important; }
.gp-swiper-button-prev { left: 15px !important;  transform: translateX(-20px) translateY(-50%) !important; }
.gp-gallery-wrapper:hover .gp-swiper-button-next { opacity: 1; visibility: visible; transform: translateX(0) translateY(-50%) !important; }
.gp-gallery-wrapper:hover .gp-swiper-button-prev { opacity: 1; visibility: visible; transform: translateX(0) translateY(-50%) !important; }
.gp-swiper-button-disabled,
.gp-swiper-button-next.swiper-button-lock,
.gp-swiper-button-prev.swiper-button-lock { display: none !important; opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }

/* ── LINK WRAP ── */
.gp-link-wrap { display: block; width: 100%; height: 100%; text-decoration: none; }
.gp-link-wrap:hover { opacity: 0.9; }

/* ── PLAY ICON ── */
.gp-play-icon {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid #fff;
}
.gp-play-icon::before {
    content: ''; display: block;
    width: 0; height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff;
    margin-left: 4px;
}
.gp-gallery-item:hover .gp-play-icon { background: rgba(255,0,0,0.8); transform: translate(-50%,-50%) scale(1.1); }

/* ── TITLE ── */
.gp-item-title {
    margin: 12px 0 0;
    color: var(--gp-t-color, #333);
    text-align: center;
    font-size: var(--gp-t-fs-d, 16px);
    font-weight: var(--gp-t-fw, 600);
    line-height: var(--gp-t-lh, 1.5);
    text-transform: var(--gp-t-tt, none);
    transition: all 0.3s ease;
}
.gp-item-title[data-pos="overlay"] {
    position: absolute; bottom: 0; left: 0;
    width: 100%; margin: 0; padding: 15px;
    background: var(--gp-t-bg, rgba(0,0,0,0.7));
    box-sizing: border-box; z-index: 10;
}
@media (max-width: 1024px) { .gp-item-title { font-size: var(--gp-t-fs-t, 15px); } }
@media (max-width: 767px)  { .gp-item-title { font-size: var(--gp-t-fs-m, 14px); } }


/* ==========================================================
   SWIPER GALLERY (twtb-gal) — Ảnh lớn + Thumbnail
   ========================================================== */
.gp-gallery-wrapper .twtb-gal {
    display: flex;
    gap: var(--gp-sg-gap, 12px);
    width: 100%;
    user-select: none;
    overflow: hidden;
    padding: 5px;
    box-sizing: border-box;
}

/* ── Bố cục ── */
.gp-gallery-wrapper .twtb-gal--right  { flex-direction: row; align-items: stretch; }
.gp-gallery-wrapper .twtb-gal--right  .twtb-gal__main   { flex: 1 1 auto; min-width: 0; }
.gp-gallery-wrapper .twtb-gal--right  .twtb-gal__thumbs { flex: 0 0 var(--gp-sg-tw, 88px); width: var(--gp-sg-tw, 88px); flex-direction: column; }
.twtb-gal--bottom { flex-direction: column; }
.twtb-gal--bottom .twtb-gal__main   { width: 100%; }
.twtb-gal--bottom .twtb-gal__thumbs { flex-direction: row; }
.twtb-gal--bottom .twtb-gal__thumbs-track { flex-direction: row; }
.twtb-gal--bottom .twtb-gal__tnav   { width: 28px; height: 100%; }

/* ── Main image area ── */
.twtb-gal__main {
    position: relative;
    height: var(--gp-sg-h, 480px);
    border-radius: var(--gp-sg-r, 12px);
    overflow: hidden;
    background: #111;
}
.twtb-gal__swiper { width: 100%; height: 100%; overflow: hidden; }
.twtb-gal__track  { display: flex; width: 100%; height: 100%; will-change: transform; }
.twtb-gal__slide  { flex: 0 0 100%; width: 100%; height: 100%; overflow: hidden; }
.twtb-gal__slide-link { display: block; width: 100%; height: 100%; text-decoration: none; }
.twtb-gal__slide-img  { width: 100%; height: 100% !important; object-fit: cover; display: block; }

/* ── Play button overlay ── */
.twtb-gal__play {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 56px; height: 56px;
    border-radius: 50%; background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.twtb-gal__play::before {
    content: ''; display: block;
    width: 0; height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 18px solid #fff;
    margin-left: 4px;
}

/* ── Arrows ── */
.twtb-gal__arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    width: 44px; height: 44px; border-radius: 50%; border: none;
    background: rgba(255,255,255,0.82); color: #222; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    transition: background .2s, transform .2s, box-shadow .2s; padding: 0;
    opacity: 0; visibility: hidden;
}
.twtb-gal__main:hover .twtb-gal__arrow { opacity: 1; visibility: visible; }
.twtb-gal__arrow:hover { background: rgba(255,255,255,1); box-shadow: 0 4px 18px rgba(0,0,0,0.25); transform: translateY(-50%) scale(1.08); }
.twtb-gal__arrow--prev { left: 12px; transform: translateY(-50%) translateX(-8px); }
.twtb-gal__arrow--next { right: 12px; transform: translateY(-50%) translateX(8px); }
.twtb-gal__main:hover .twtb-gal__arrow--prev { transform: translateY(-50%) translateX(0); }
.twtb-gal__main:hover .twtb-gal__arrow--next { transform: translateY(-50%) translateX(0); }

/* ── Counter ── */
.twtb-gal__counter {
    position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.48); color: #fff;
    font-size: 13px; font-weight: 600;
    padding: 3px 11px; border-radius: 20px;
    pointer-events: none; letter-spacing: .5px; white-space: nowrap;
}

/* ── Dots ── */
.twtb-gal__dots { position: absolute; bottom: 14px; right: 14px; display: flex; gap: 5px; z-index: 10; }
.twtb-gal__dot  { width: 7px; height: 7px; border-radius: 50%; border: none; background: rgba(255,255,255,0.45); cursor: pointer; padding: 0; transition: background .25s, transform .25s; }
.twtb-gal__dot.active { background: #fff; transform: scale(1.4); }

/* ── Thumbnail container ── */
.twtb-gal__thumbs {
    display: flex;
    align-items: center;
    gap: 4px;
}
.twtb-gal--right .twtb-gal__thumbs { flex-direction: column; }

/* ── Thumb nav buttons ── */
.twtb-gal__tnav {
    flex: 0 0 auto;
    background: #f0f0f0; border: none; border-radius: 6px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: #555; transition: background .18s, color .18s; padding: 5px;
}
.twtb-gal--right  .twtb-gal__tnav { width: 100%; height: 28px; }
.twtb-gal--bottom .twtb-gal__tnav { height: 100%; width: 28px; }
.twtb-gal__tnav:hover    { background: #e0e0e0; color: #111; }
.twtb-gal__tnav:disabled { opacity: .3; cursor: default; }

/* ── Viewport & track ── */

.twtb-gal--right .twtb-gal__thumbs-viewport { min-height: 0; }
.twtb-gal__thumbs-track {
    display: flex; flex-direction: column; gap: var(--gp-sg-thumb-gap, 6px);
    transition: transform .38s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}
.twtb-gal--bottom .twtb-gal__thumbs-track { flex-direction: row; }

/* ── Individual thumb ── */
.twtb-gal__thumb {
    position: relative; flex: 0 0 auto;
    border: 3px solid transparent; padding: 0; cursor: pointer;
    border-radius: var(--gp-sg-thumb-r, 8px) !important; overflow: hidden;
    box-sizing: border-box;
    transition: border-color .2s, opacity .2s;
}
.twtb-gal--right .twtb-gal__thumb { width: 100%; }
.twtb-gal__thumb img { width: 100%; display: block; object-fit: cover; }
.twtb-gal--bottom .twtb-gal__thumb img { height: 100%; }
.twtb-gal__thumb.active { border: 3px solid var(--gp-sg-active-color, #e63329); }
.twtb-gal__thumb-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.22);
    transition: opacity .2s;
}
.twtb-gal__thumb.active .twtb-gal__thumb-overlay,
.twtb-gal__thumb:hover  .twtb-gal__thumb-overlay { opacity: 0; }

/* ── Tablet: 601–900px — thu nhỏ thumbnail ── */
@media (max-width: 900px) and (min-width: 601px) {
    .twtb-gal--right .twtb-gal__thumbs { flex: 0 0 70px; width: 70px; }
}

/* ── Mobile: ≤600px — ẩn thumbnail, arrows luôn hiện ── */
@media (max-width: 600px) {
    /* Right layout: stack dọc → ngang */
    .twtb-gal--right { flex-direction: column; }
    .twtb-gal--right .twtb-gal__thumbs       { flex-direction: row; width: 100%; height: 60px; flex: 0 0 60px; }
    .twtb-gal--right .twtb-gal__thumbs-track { flex-direction: row; }
    .twtb-gal--right .twtb-gal__thumb        { flex: 0 0 74px; width: 74px; height: 60px; }
    .twtb-gal--right .twtb-gal__thumb img    { width: 74px; height: 60px; }
    .twtb-gal--right .twtb-gal__tnav         { width: 28px; height: 100%; }

    /* Arrows luôn hiện trên mobile (không có hover) */
    .twtb-gal__arrow {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(-50%) !important;
        width: 34px; height: 34px;
        background: rgba(0,0,0,0.45);
        border: none;
    }
    .twtb-gal__arrow--prev { left: 8px; }
    .twtb-gal__arrow--next { right: 8px; }

    /* Dots luôn hiện trên mobile */
    .twtb-gal__dots { right: auto; left: 50%; transform: translateX(-50%); }
}

/* ── Rất nhỏ: ≤400px — ẩn thumbnail, chỉ dùng dots + arrows ── */
@media (max-width: 400px) {
    .twtb-gal--right .twtb-gal__thumbs,
    .twtb-gal--bottom .twtb-gal__thumbs { display: none !important; }
    .twtb-gal--right { flex-direction: column; }
}
