/* ============================================
   Product Pages - White Background Design
   ============================================ */

/* === Product Index Page === */
.product-index-section {
    background: #ffffff;
    padding: 4rem 0 5rem;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: #3b82f6;
    box-shadow: 0 16px 40px rgba(59, 130, 246, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #f1f5f9;
}

.product-image-wrapper img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.05);
}

.product-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
    transition: color 0.3s ease;
    padding: 1.25rem 1.5rem 0;
}

.product-card:hover .product-card-title {
    color: #2563eb;
}

.product-card-description,
.product-card > p,
.product-card > div:not(.product-image-wrapper) {
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9rem;
    padding: 0 1.5rem;
}

/* Reset inner p tags from CMS content */
.product-card-description p,
.product-card-description strong {
    color: inherit;
    font-size: inherit;
    margin: 0;
    padding: 0;
}

.product-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #2563eb;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 0 1.5rem 1.5rem;
    text-decoration: none;
    position: relative;
    z-index: 2;
}

.product-card-link i {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.product-card:hover .product-card-link {
    color: #1d4ed8;
}

.product-card:hover .product-card-link i {
    transform: translateX(5px);
}

/* === Product Detail Page === */
.product-detail-hero {
    position: relative;
    padding: 3rem 0 1rem;
    background: #ffffff;
}

.product-detail-content {
    position: relative;
    padding: 2rem 0 5rem;
    background: #ffffff;
}

.product-detail-title {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1rem;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.product-detail-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 700px;
    margin: 0 auto 1.5rem;
    line-height: 1.7;
}

.product-main-image {
    border-radius: 16px;
    overflow: hidden;
    margin: 0 0 2.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.product-main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.product-content-section {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.product-content-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: #1e293b;
}

.product-content-section .prose {
    color: #475569;
}

/* === Screen Gallery === */
.screen-gallery-section {
    margin: 3rem 0;
    padding: 3rem 0;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 24px;
}

.screen-gallery-section h2 {
    color: #0f172a !important;
}

.screen-gallery-section p {
    color: #94a3b8 !important;
}

.sg-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    user-select: none;
}

.sg-stage {
    position: relative;
    height: 480px;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sg-frame {
    position: absolute;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform:
        translateX(calc(var(--offset) * 220px))
        scale(calc(1 - var(--abs-offset) * 0.15))
        rotateY(calc(var(--offset) * -5deg));
    z-index: calc(10 - var(--abs-offset));
    opacity: calc(1 - var(--abs-offset) * 0.3);
    filter: blur(calc(var(--abs-offset) * 2px));
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.sg-frame--active {
    filter: blur(0);
    opacity: 1;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.sg-frame--desktop {
    width: 520px;
    height: 360px;
}

.sg-frame--mobile {
    width: 200px;
    height: 400px;
}

.sg-chrome {
    background: #1e1e2e;
    position: relative;
    z-index: 2;
}

.sg-chrome-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(180deg, #2d2d3f, #1e1e2e);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sg-chrome-dots {
    display: flex;
    gap: 6px;
}

.sg-chrome-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.sg-chrome-dots span:nth-child(1) { background: #ff5f57; }
.sg-chrome-dots span:nth-child(2) { background: #febc2e; }
.sg-chrome-dots span:nth-child(3) { background: #28c840; }

.sg-chrome-url {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 12px;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.sg-chrome-notch {
    width: 100px;
    height: 22px;
    background: #0a0a1a;
    border-radius: 0 0 14px 14px;
    margin: 0 auto;
}

.sg-content {
    position: relative;
    overflow: hidden;
    height: calc(100% - 38px);
    background: #f1f5f9;
}

.sg-frame--mobile .sg-content {
    height: calc(100% - 22px);
}

.sg-content-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.sg-frame--active .sg-content-img:hover {
    transform: scale(1.03);
    cursor: zoom-in;
}

/* Gallery dots */
.sg-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
}

.sg-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.sg-dot--active {
    background: #2563eb;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

.sg-dot--mobile {
    border-radius: 3px;
    width: 6px;
    height: 10px;
}

.sg-dot--mobile.sg-dot--active {
    background: #7c3aed;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
}

/* Gallery label */
.sg-label {
    text-align: center;
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.sg-label-type {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

/* Gallery nav arrows */
.sg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sg-nav:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.sg-nav--prev { left: 0; }
.sg-nav--next { right: 0; }

/* === CTA Section === */
.product-cta-section {
    background: linear-gradient(135deg, #1e3a5f, #1e293b);
    border-radius: 20px;
    padding: 3.5rem 2rem;
    text-align: center;
    margin: 3rem 0;
}

.product-cta-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #ffffff;
}

.product-cta-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
}

.product-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

/* === Buttons === */
.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.btn-modern-primary {
    background: #2563eb;
    color: #ffffff !important;
    border: none;
}

.btn-modern-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
    color: #ffffff !important;
}

.btn-modern-secondary {
    background: #f1f5f9;
    color: #475569 !important;
    border: 1px solid #e2e8f0;
}

.btn-modern-secondary:hover {
    background: #e2e8f0;
    color: #1e293b !important;
    transform: translateY(-2px);
}

/* CTA buttons override (inside dark CTA) */
.product-cta-section .btn-modern-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.product-cta-section .btn-modern-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}

/* === Social Share === */
.social-share-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.social-share-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.875rem;
}

.social-share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.social-share-btn.facebook:hover { color: #1877f2; border-color: #1877f2; background: #eef4ff; }
.social-share-btn.twitter:hover { color: #1da1f2; border-color: #1da1f2; background: #eef8ff; }
.social-share-btn.linkedin:hover { color: #0077b5; border-color: #0077b5; background: #eef6fa; }
.social-share-btn.whatsapp:hover { color: #25d366; border-color: #25d366; background: #eefbf2; }

/* === Image Modal === */
.img-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
}

.img-modal-overlay.active {
    display: flex;
}

.img-modal-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.img-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.img-modal-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 70px;
}

.img-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    user-select: none;
}

.img-modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.img-modal-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.img-modal-prev { left: 16px; }
.img-modal-next { right: 16px; }

.img-modal-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 6px 16px;
    backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
    .img-modal-content { padding: 60px 16px; }
    .img-modal-close { top: 12px; right: 12px; width: 42px; height: 42px; }
    .img-modal-nav { width: 40px; height: 40px; font-size: 0.9rem; }
    .img-modal-prev { left: 8px; }
    .img-modal-next { right: 8px; }
}

/* === Responsive === */
@media (max-width: 1024px) {
    .sg-frame--desktop { width: 400px; height: 280px; }
    .sg-frame--mobile { width: 160px; height: 320px; }
    .sg-frame {
        transform:
            translateX(calc(var(--offset) * 160px))
            scale(calc(1 - var(--abs-offset) * 0.18));
    }
    .sg-stage { height: 380px; }
}

@media (max-width: 768px) {
    .product-card { border-radius: 12px; }
    .product-content-section { padding: 1.5rem; }
    .product-cta-section { padding: 2.5rem 1.5rem; }
    .sg-frame--desktop { width: 300px; height: 210px; }
    .sg-frame--mobile { width: 130px; height: 260px; }
    .sg-frame {
        transform:
            translateX(calc(var(--offset) * 100px))
            scale(calc(1 - var(--abs-offset) * 0.2));
    }
    .sg-stage { height: 320px; }
    .sg-nav { width: 36px; height: 36px; }
}

@media (max-width: 480px) {
    .sg-frame--desktop { width: 260px; height: 180px; }
    .sg-frame--mobile { width: 110px; height: 220px; }
    .sg-frame {
        transform:
            translateX(calc(var(--offset) * 70px))
            scale(calc(1 - var(--abs-offset) * 0.25));
    }
    .sg-stage { height: 280px; }
}

/* === Homepage Product Gallery (ScreenGallery Style) === */
.hpg-section {
    background: #ffffff;
    overflow: hidden;
}

.hpg-container {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    user-select: none;
}

.hpg-stage {
    position: relative;
    height: 420px;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hpg-card {
    position: absolute;
    width: 340px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform:
        translateX(calc(var(--offset) * 260px))
        scale(calc(1 - var(--abs-offset) * 0.12))
        rotateY(calc(var(--offset) * -5deg));
    z-index: calc(10 - var(--abs-offset));
    opacity: calc(1 - var(--abs-offset) * 0.35);
    filter: blur(calc(var(--abs-offset) * 2px));
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.hpg-card--active {
    filter: blur(0);
    opacity: 1;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.hpg-card-inner {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.hpg-card-img {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f1f5f9;
}

.hpg-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hpg-card--active .hpg-card-img img:hover {
    transform: scale(1.05);
}

.hpg-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.hpg-card-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.hpg-card--active:hover .hpg-card-body h3 {
    color: #2563eb;
}

.hpg-card-body p {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.hpg-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    transition: gap 0.3s;
}

.hpg-card--active:hover .hpg-card-link {
    gap: 0.625rem;
}

/* Gallery dots */
.hpg-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
}

.hpg-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.hpg-dot--active {
    background: #2563eb;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

/* Gallery label */
.hpg-label {
    text-align: center;
    margin-top: 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
}

/* Gallery nav arrows */
.hpg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.hpg-nav:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.hpg-nav--prev { left: 0; }
.hpg-nav--next { right: 0; }

/* Responsive */
@media (max-width: 1024px) {
    .hpg-card { width: 300px; }
    .hpg-card {
        transform:
            translateX(calc(var(--offset) * 200px))
            scale(calc(1 - var(--abs-offset) * 0.15));
    }
    .hpg-stage { height: 380px; }
}

@media (max-width: 768px) {
    .hpg-card { width: 270px; }
    .hpg-card {
        transform:
            translateX(calc(var(--offset) * 140px))
            scale(calc(1 - var(--abs-offset) * 0.18));
    }
    .hpg-stage { height: 360px; }
    .hpg-nav { width: 36px; height: 36px; }
}

@media (max-width: 480px) {
    .hpg-card { width: 250px; }
    .hpg-card {
        transform:
            translateX(calc(var(--offset) * 90px))
            scale(calc(1 - var(--abs-offset) * 0.22));
    }
    .hpg-stage { height: 340px; }
}
