/* Frontend Styles for Product Grid - Apple Style Full Width */

/* Video Section - Full Width (Same technique as product grid) */
.pgm-video-section {
    width: 100vw;
    margin: 0;
    padding: 0;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: #000;
    overflow: hidden;
}

.pgm-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 42%; /* 21:9 aspect ratio */
    height: 0;
    overflow: hidden;
    min-height: 600px;
}

.pgm-video-container iframe,
.pgm-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}

.pgm-video-container video {
    object-fit: cover;
}

/* Disable pointer events on video to prevent controls */
.pgm-video-container iframe,
.pgm-video-container video {
    pointer-events: none;
}

/* Hide video controls completely */
.pgm-video-container video::-webkit-media-controls {
    display: none !important;
}

.pgm-video-container video::-webkit-media-controls-enclosure {
    display: none !important;
}

.pgm-video-container video::-webkit-media-controls-panel {
    display: none !important;
}

.pgm-video-container video::-webkit-media-controls-play-button {
    display: none !important;
}

/* Product Grid - Full Width with White Borders */
.pgm-product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100vw;
    margin: 0;
    padding: 12px;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #fff;
}

/* Product Item with Background Image - NO HOVER EFFECTS */
.pgm-product-item {
    position: relative;
    overflow: hidden;
    min-height: 600px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border-radius: 18px;
}

/* Dark overlay for better text readability - STATIC */
.pgm-product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.5) 100%);
    z-index: 1;
}

/* Link styling - NO HOVER */
.pgm-product-link {
    display: flex;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    align-items: flex-start;
    justify-content: center;
}

/* Product Content */
.pgm-product-content {
    position: relative;
    z-index: 2;
    padding: 60px 40px;
    width: 100%;
    max-width: 800px;
    text-align: center;
}

/* Title */
.pgm-product-title {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Subtitle */
.pgm-product-subtitle {
    font-size: 24px;
    font-weight: 400;
    color: #ffffff;
    margin: 0 0 30px 0;
    line-height: 1.4;
    text-shadow: 0 1px 5px rgba(0,0,0,0.3);
}

/* Buttons - STATIC, NO HOVER */
.pgm-product-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 3;
}

.pgm-btn {
    padding: 12px 24px;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    pointer-events: none; /* Buttons are static */
}

.pgm-btn-primary {
    background: #0071e3;
    color: #fff;
}

.pgm-btn-secondary {
    display: none; /* Hide secondary button */
}

/* Fallback colors when no image */
.pgm-product-item:nth-child(1):not([style*="background-image"]) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pgm-product-item:nth-child(2):not([style*="background-image"]) {
    background: linear-gradient(135deg, #1d1d1f 0%, #000000 100%);
}

.pgm-product-item:nth-child(3):not([style*="background-image"]) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.pgm-product-item:nth-child(4):not([style*="background-image"]) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.pgm-product-item:nth-child(5):not([style*="background-image"]) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.pgm-product-item:nth-child(6):not([style*="background-image"]) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.pgm-product-item:nth-child(7):not([style*="background-image"]) {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.pgm-product-item:nth-child(8):not([style*="background-image"]) {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

/* Carousel Section - Apple TV+ Style */
.pgm-carousel-wrapper {
    width: 100vw;
    margin: 0;
    padding: 60px 0 80px 0;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: #f5f5f5;
}

.pgm-carousel {
    width: 100%;
    height: auto;
    overflow: visible !important;
}

.pgm-carousel .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    height: auto;
    transition: all 0.3s ease;
    opacity: 0.4;
}

.pgm-carousel .swiper-slide-active {
    opacity: 1;
    z-index: 10;
}

.pgm-carousel .swiper-slide img {
    width: auto;
    height: 400px;
    max-width: 90%;
    display: block;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.pgm-carousel .swiper-slide-active img {
    transform: scale(1.05);
}

/* White overlay on inactive slides */
.pgm-carousel .swiper-slide:not(.swiper-slide-active)::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    border-radius: 12px;
}

.pgm-carousel-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.pgm-carousel-link img {
    width: auto;
    height: 400px;
    max-width: 90%;
    display: block;
    border-radius: 12px;
}

/* Hide Navigation Buttons */
.pgm-carousel .swiper-button-next,
.pgm-carousel .swiper-button-prev {
    display: none;
}

/* Swiper Pagination - Below images */
.pgm-carousel .swiper-pagination {
    position: relative;
    bottom: auto;
    margin-top: 30px;
}

.pgm-carousel .swiper-pagination-bullet {
    background: #86868b;
    opacity: 0.4;
    width: 8px;
    height: 8px;
}

.pgm-carousel .swiper-pagination-bullet-active {
    opacity: 1;
    background: #1d1d1f;
}

/* Responsive Design */
@media screen and (max-width: 1068px) {
    .pgm-product-item {
        min-height: 500px;
    }
    
    .pgm-product-title {
        font-size: 40px;
    }
    
    .pgm-product-subtitle {
        font-size: 20px;
    }
    
    .pgm-product-content {
        padding: 50px 30px;
    }
    
    .pgm-carousel-wrapper {
        padding: 40px 0 60px 0;
    }
    
    .pgm-carousel .swiper-slide img,
    .pgm-carousel-link img {
        height: 350px;
    }
    
    .pgm-video-container {
        padding-bottom: 50%;
        min-height: 500px;
    }
}

@media screen and (max-width: 768px) {
    .pgm-product-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }
    
    .pgm-product-item {
        min-height: 450px;
    }
    
    .pgm-product-title {
        font-size: 36px;
    }
    
    .pgm-product-subtitle {
        font-size: 18px;
    }
    
    .pgm-product-content {
        padding: 40px 25px;
    }
    
    .pgm-product-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .pgm-btn {
        width: 100%;
        max-width: 280px;
    }
    
    .pgm-video-container {
        padding-bottom: 56.25%;
        min-height: 400px;
    }
    
    .pgm-carousel-wrapper {
        padding: 30px 0 50px 0;
    }
    
    .pgm-carousel .swiper-slide img,
    .pgm-carousel-link img {
        height: 300px;
        max-width: 95%;
    }
}

@media screen and (max-width: 480px) {
    .pgm-product-item {
        min-height: 400px;
    }
    
    .pgm-product-title {
        font-size: 28px;
    }
    
    .pgm-product-subtitle {
        font-size: 16px;
    }
    
    .pgm-product-content {
        padding: 30px 20px;
    }
    
    .pgm-carousel-wrapper {
        padding: 20px 0 40px 0;
    }
    
    .pgm-carousel .swiper-slide img,
    .pgm-carousel-link img {
        height: 250px;
    }
    
    .pgm-video-container {
        padding-bottom: 75%;
        min-height: 300px;
    }
}

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pgm-product-item {
    animation: fadeInUp 0.6s ease-out;
}

.pgm-product-item:nth-child(1) { animation-delay: 0.1s; }
.pgm-product-item:nth-child(2) { animation-delay: 0.15s; }
.pgm-product-item:nth-child(3) { animation-delay: 0.2s; }
.pgm-product-item:nth-child(4) { animation-delay: 0.25s; }
.pgm-product-item:nth-child(5) { animation-delay: 0.3s; }
.pgm-product-item:nth-child(6) { animation-delay: 0.35s; }
.pgm-product-item:nth-child(7) { animation-delay: 0.4s; }
.pgm-product-item:nth-child(8) { animation-delay: 0.45s; }

/* ============================================================
   WIKI MICROSCOPI
   ============================================================ */

.wiki-microscopi-wrap {
    display: flex;
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    min-height: 520px;
    overflow: hidden;
}

/* Colonna sinistra — immagine, 35% */
.wiki-col-sx {
    flex: 0 0 35%;
    max-width: 35%;
    overflow: hidden;
    position: relative;
}

.wiki-immagine {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.wiki-immagine-placeholder {
    width: 100%;
    height: 100%;
    background: #c8d8d8;
}

/* Colonna destra — 4 pannelli, 65% */
.wiki-col-dx {
    flex: 0 0 65%;
    max-width: 65%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

/* Singolo pannello */
.wiki-pannello {
    position: relative;
    display: flex;
    align-items: stretch;
    transition: filter 0.25s ease;
}

.wiki-pannello:hover {
    filter: brightness(1.08);
}

/* Link che copre tutto il pannello */
.wiki-pannello-link {
    display: flex;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.wiki-pannello-inner {
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.wiki-pannello-titolo {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.2px;
}

.wiki-pannello-desc {
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
    opacity: 0.88;
}

.wiki-pannello-cta {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.wiki-pannello:hover .wiki-pannello-cta {
    opacity: 1;
}

/* Responsive */
@media screen and (max-width: 1024px) {
    .wiki-pannello-inner {
        padding: 30px 24px;
    }
    .wiki-pannello-titolo {
        font-size: 19px;
    }
}

@media screen and (max-width: 768px) {
    .wiki-microscopi-wrap {
        flex-direction: column;
    }
    .wiki-col-sx {
        flex: 0 0 auto;
        max-width: 100%;
        height: 240px;
    }
    .wiki-col-dx {
        flex: 0 0 auto;
        max-width: 100%;
        grid-template-columns: 1fr 1fr;
    }
    .wiki-pannello-inner {
        padding: 24px 18px;
    }
    .wiki-pannello-titolo {
        font-size: 16px;
    }
    .wiki-pannello-desc {
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .wiki-col-dx {
        grid-template-columns: 1fr;
    }
}
