@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&display=swap');

/* Main gallery container */
.pgs-gallery-container {
    max-width: 100%;
    margin: 0 auto 20px;
    position: relative;
    background: transparent !important;
    box-shadow: none;
    border-radius: 0;
}

/* Main image styling */
.pgs-main-image {
    position: relative;
    overflow: hidden;
    height: 0;
    padding-bottom: 100%;
    margin-bottom: 15px;
    border-radius: 15px;
    background-color: #fff;
    line-height: 0;
}

.pgs-main-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.4s ease-in-out;
    opacity: 1;
    background: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Thumbnails wrapper */
.pgs-thumbnails-wrapper {
    display: flex;
    align-items: center;
    background: transparent !important;
    border: none;
    padding: 0 5px 10px;
}

/* Thumbnails */
.pgs-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 5px 0;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 8px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    flex-grow: 1;
    width: auto;
}

/* Hide scrollbar */
.pgs-thumbnails::-webkit-scrollbar {
    height: 3px;
    background: rgba(0,0,0,0.05);
    border-radius: 2px;
}

.pgs-thumbnails::-webkit-scrollbar-thumb {
    background: var(--woocommerce-theme-color, #0073aa);
    border-radius: 2px;
}

/* Individual thumbnail */
.pgs-thumbnail {
    width: 100px;
    height: 100px;
    flex: 0 0 auto;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    border-radius: 4px;
    overflow: hidden;
    scroll-snap-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    background: #fff;
}

.pgs-thumbnail.active,
.pgs-thumbnail:hover {
    border-color: #eb0202;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pgs-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: transparent;
}
.pgs-thumbnail {
    border-radius: 12px;
    overflow: hidden;
}

.pgs-thumbnail img {
    border-radius: 12px;
}
/* Navigation buttons */
.pgs-nav {
    top: auto;
    transform: none;
    background: rgba(255, 192, 203, 0.7);
    color: #333;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: none; /* تم إخفاء الأزرار بشكل افتراضي */
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.pgs-nav:hover {
    opacity: 1;
    transform: scale(1.05);
    background: rgba(255, 192, 203, 1);
    box-shadow: 2px 6px rgba(0, 0, 0, 0.15);
}

.pgs-prev {
    margin-right: 5px;
}

.pgs-next {
    margin-left: 5px;
}

/* Active indicator */
.pgs-thumbnail.active::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: var(--woocommerce-theme-color, #0073aa);
    border-radius: 1px;
    z-index: 2;
}

/* Loading indicator */
.pgs-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35px;
    height: 35px;
    border: 3px solid rgba(0, 115, 170, 0.1);
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    background: transparent;
    z-index: 5;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Product info styling */
.pgs-product-info {
    margin-top: 15px;
    text-align: center;
    background: transparent;
    padding: 15px;
    border-radius: 8px;
    background-color: transparent;
}

.pgs-product-title {
    font-size: 1.4rem;
    margin: 0 0 5px;
    color: #333;
    font-weight: 600;
    font-family: 'Amiri', serif;
}

.pgs-product-price {
    font-size: 1.2rem;
    color: var(--woocommerce-theme-color, #0073aa);
    font-weight: 700;
}
@media (max-width: 768px) {
    .pgs-nav {
        display: none !important;
    }
}
/* Responsive design */
@media (min-width: 769px) {
    .pgs-nav {
        display: flex; /* يتم إظهار الأزرار فقط على الشاشات الأكبر من 768px */
    }
}
@media (max-width: 768px) {
    .pgs-thumbnail {
        width: 90px;
        height: 90px;
    }
    
    .pgs-main-image {
        padding-bottom: 100%;
        margin-bottom: 15px;
    }
    
    .pgs-thumbnails-wrapper {
        padding: 0 5px 8px;
    }
    
    .pgs-product-title {
        font-size: 1.2rem;
    }
    
    .pgs-product-price {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .pgs-thumbnail {
        width: 80px;
        height: 80px;
    }
    
    .pgs-main-image {
        padding-bottom: 100%;
        margin-bottom: 15px;
    }
    
    .pgs-thumbnails-wrapper {
        padding: 0 5px 5px;
    }
}