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

:root {
    --pic-primary: #0a0a0a;
    --pic-secondary: #f5f5f5;
    --pic-accent: #ff3366;
    --pic-accent-hover: #ff5580;
    --pic-text: #1a1a1a;
    --pic-text-light: #666666;
    --pic-border: #e0e0e0;
    --pic-shadow: rgba(0, 0, 0, 0.08);
    --pic-shadow-lg: rgba(0, 0, 0, 0.15);
    --pic-transition: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Carousel Container */
.pic-carousel-wrapper {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: block;
    visibility: visible;
}

.pic-carousel-container {
    position: relative;
    background: white;
    border-radius: 0;
    overflow: hidden;
    width: 100%;
    display: block;
}

/* Carousel Main Area */
.pic-carousel-main {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: white;
    min-height: 350px;
    max-height: 500px;
    display: block;
}

.pic-carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

.pic-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(100%) scale(0.95);
    transition: all 0.6s var(--pic-transition);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pic-slide.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    z-index: 2;
}

.pic-slide.prev {
    transform: translateX(-100%) scale(0.95);
}

.pic-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    cursor: pointer;
    transition: transform 0.4s var(--pic-transition);
    user-select: none;
    -webkit-user-drag: none;
    max-width: 100%;
    max-height: 100%;
}

.pic-slide img:hover {
    transform: scale(1.01);
}

/* Navigation Buttons */
.pic-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--pic-transition);
    z-index: 100;
    padding: 0;
}

.pic-nav:hover {
    transform: translateY(-50%) scale(1.15);
}

.pic-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.pic-nav-prev {
    left: 12px;
}

.pic-nav-next {
    right: 12px;
}

.pic-nav svg {
    stroke-width: 2.5;
    width: 32px;
    height: 32px;
    color: white;
    opacity: 0.75;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s var(--pic-transition);
    display: block;
}

.pic-nav:hover svg {
    opacity: 1;
    color: white;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

/* Thumbnails */
.pic-thumbnails {
    padding: 8px 0 0 0;
    background: white;
    margin-top: 8px;
}

.pic-thumbnails-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
    padding-bottom: 4px;
}

.pic-thumbnails-scroll::-webkit-scrollbar {
    height: 3px;
}

.pic-thumbnails-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.pic-thumbnails-scroll::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.pic-thumbnails-scroll::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.pic-thumbnail {
    flex-shrink: 0;
    width: 85px;
    height: 85px;
    border: 2px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s var(--pic-transition);
    background: white;
    padding: 0;
    position: relative;
}

.pic-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s var(--pic-transition);
}

.pic-thumbnail:hover {
    border-color: #333;
}

.pic-thumbnail:hover::after {
    background: rgba(0, 0, 0, 0.05);
}

.pic-thumbnail.active {
    border-color: #333;
    border-width: 2px;
}

.pic-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s var(--pic-transition);
}

.pic-thumbnail:hover img {
    transform: scale(1.05);
}

/* Zoom Overlay */
.pic-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s var(--pic-transition);
    backdrop-filter: blur(20px);
}

.pic-zoom-overlay.active {
    display: flex;
    opacity: 1;
}

.pic-zoom-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    transition: all 0.3s var(--pic-transition);
    backdrop-filter: blur(10px);
    z-index: 10001;
}

.pic-zoom-close:hover {
    background: var(--pic-accent);
    transform: scale(1.1) rotate(90deg);
}

.pic-zoom-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    padding: 40px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s var(--pic-transition);
}

.pic-zoom-overlay.active .pic-zoom-content {
    opacity: 1;
    transform: scale(1);
}

.pic-zoom-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .pic-carousel-main {
        aspect-ratio: 1 / 1;
        min-height: 300px;
    }
    
    .pic-nav {
        width: 36px;
        height: 36px;
    }
    
    .pic-nav svg {
        width: 28px;
        height: 28px;
    }
    
    .pic-nav-prev {
        left: 8px;
    }
    
    .pic-nav-next {
        right: 8px;
    }
    
    .pic-thumbnail {
        width: 70px;
        height: 70px;
    }
    
    .pic-zoom-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .pic-carousel-main {
        min-height: 280px;
    }
    
    .pic-nav {
        width: 32px;
        height: 32px;
    }
    
    .pic-nav svg {
        width: 24px;
        height: 24px;
    }
    
    .pic-nav-prev {
        left: 6px;
    }
    
    .pic-nav-next {
        right: 6px;
    }
    
    .pic-thumbnails {
        padding: 6px 0 0 0;
    }
    
    .pic-thumbnail {
        width: 60px;
        height: 60px;
    }
}

@media (min-width: 1024px) {
    .pic-carousel-main {
        min-height: 400px;
        max-height: 500px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .pic-slide,
    .pic-nav,
    .pic-indicator,
    .pic-thumbnail,
    .pic-zoom-overlay,
    .pic-zoom-content {
        transition: none;
    }
}

/* Loading State */
.pic-slide img:not([src]) {
    background: linear-gradient(
        90deg,
        var(--pic-secondary) 0%,
        #e8e8e8 50%,
        var(--pic-secondary) 100%
    );
    background-size: 200% 100%;
    animation: pic-loading 1.5s ease-in-out infinite;
}

@keyframes pic-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
