/* ========================================
   GGG DYNAMIC CAROUSEL - FINAL & FULLY FIXED CSS
   Works 100% with Swiper.js (Loop + Swipe + Autoplay + Touch + Mouse)
   ======================================== */

.ggg-dynamic-carousel {
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
    box-sizing: border-box;
}

/* SWIPER CONTAINER */
.ggg-dynamic-carousel .swiper {
    width: 100%;
    padding: 10px 0;
    overflow: visible !important; /* Critical for loop duplicates */
}

/* SWIPER SLIDES - Let Swiper control layout */
.ggg-dynamic-carousel .swiper-slide {
    height: auto;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

/* REQUIRED FOR LOOP: Show duplicated slides */
.swiper-slide-duplicate,
.swiper-slide-duplicate-active {
    visibility: visible !important;
}

/* CARD - Full height + smooth hover */
.ggg-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.4s ease;
    padding: 20px;
    gap: 16px;
    box-sizing: border-box;
}

.ggg-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}

/* IMAGE */
.ggg-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 12px;
    flex-shrink: 0;
}

.ggg-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ggg-card:hover .ggg-card-image img {
    transform: scale(1.08);
}

/* TEXT ELEMENTS */
.ggg-card-title,
.ggg-card-subtitle,
.ggg-card-description {
    margin: 0;
    width: 100%;
}

.ggg-card-title {
    font: 700 1.4rem/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1a1a1a;
}

.ggg-card-subtitle {
    font: 500 1rem/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #666;
}

.ggg-card-description {
    font: 400 0.95rem/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #444;
    flex: 1;
}

/* BUTTON */
.ggg-card-button {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 11px 26px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    align-self: flex-start;
    min-width: 120px;
}

.ggg-card-button:hover {
    background: #005a87;
    transform: translateY(-2px);
}

/* IMAGE MASKS - Prefix class applied via PHP */
.ggg-image-mask-circle .ggg-card-image,
.ggg-image-mask-circle .ggg-card-image img {
    border-radius: 50%;
}

.ggg-image-mask-square .ggg-card-image,
.ggg-image-mask-square .ggg-card-image img {
    border-radius: 0;
}

.ggg-image-mask-rounded .ggg-card-image,
.ggg-image-mask-rounded .ggg-card-image img {
    border-radius: 20px;
}

.ggg-image-mask-star .ggg-card-image,
.ggg-image-mask-star .ggg-card-image img {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%,
                      21% 91%, 32% 57%, 2% 35%, 39% 35%);
    -webkit-clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%,
                               21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.ggg-image-mask-triangle .ggg-card-image,
.ggg-image-mask-triangle .ggg-card-image img {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    -webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.ggg-image-mask-hexagon .ggg-card-image,
.ggg-image-mask-hexagon .ggg-card-image img {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    -webkit-clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

/* PAGINATION DOTS */
.ggg-pagination {
    margin-top: 30px;
    text-align: center;
}

.ggg-pagination .swiper-pagination {
    position: static;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 10px 0;
}

.ggg-dot,
.ggg-dot-active {
    background: transparent;
    width: auto;
    height: auto;
    margin: 0;
    opacity: 1;
    cursor: pointer;
}

.ggg-dot i,
.ggg-dot-active i {
    font-size: 10px;
    color: #ccc;
    transition: all 0.3s ease;
}

.ggg-dot-active i {
    font-size: 18px;
    color: #0073aa;
}

/* RESPONSIVE */
@media (max-width: 767px) {
    .ggg-card {
        padding: 16px;
        gap: 12px;
    }
    .ggg-card-image {
        height: 180px;
    }
    .ggg-card-title {
        font-size: 1.25rem;
    }
    .ggg-card-button {
        padding: 10px 20px;
        font-size: 0.9rem;
        width: 100%;
        align-self: stretch;
    }
    .ggg-pagination .swiper-pagination {
        gap: 8px;
    }
    .ggg-dot i {
        font-size: 8px;
    }
    .ggg-dot-active i {
        font-size: 14px;
    }
}

/* Ensure Swiper doesn't break on resize */
.ggg-dynamic-carousel .swiper-wrapper {
    align-items: stretch;
}

/* OPTIONAL: Clean arrow styling (if you add arrows later) */
.swiper-button-next,
.swiper-button-prev {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    color: white;
    margin-top: -22px;
}
.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 18px;
}