/* Products Page Styles - style.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* font-family: 'Arial', sans-serif; */
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* Scroll-Controlled Background System */
.scroll-container {
    height: 80vh; /* Reduced to 0.8x viewport height for immediate products */
    position: relative;
}

.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #1a1a1a; /* Dark fallback to match ship images */
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.05s linear; /* Faster, smoother transition */
    background-attachment: fixed;
    will-change: transform; /* Optimize for animations */
}

.bg-layer-1 {
    background-image: url('img/Ship_product.jpg');
    opacity: 1;
    transform: translateY(0);
    z-index: 2;
}

.bg-layer-2 {
    background-image: url('img/Ship_product2.jpg');
    opacity: 1;
    transform: translateY(0);
    z-index: 1;
}

/* Floating overlay images on the 2nd background image */
.floating-overlays {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.floating-overlays.active {
    opacity: 2;
}

.floating-img {
    position: absolute;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.8s ease;
    opacity: 0;
    transform: translateY(50px) scale(0.8);
    filter: brightness(2.0) contrast(1.3) saturate(1.3);
}

.floating-img.animate {
    opacity: 0.9;
    transform: translateY(0) scale(1);
}

.floating-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

/* Floating image positions and sizes - 20% bigger, middle 35% bigger */
.floating-img-1 {
    top: 15%;
    left: 5%;
    width: 340px;  /* 200px * 1.2 = 240px */
    height: 220px; /* 130px * 1.2 = 156px */
    animation: float1 6s ease-in-out infinite;
}

.floating-img-2 {
    top: 18%;
    right: 8%;
    width: 340px;  /* 180px * 1.2 = 216px */
    height: 220px; /* 120px * 1.2 = 144px */
    animation: float2 6s ease-in-out infinite;
}

.floating-img-3 {
    bottom: 10%;
    left: 8%;
    width: 340px;  /* 220px * 1.2 = 264px */
    height: 220px; /* 140px * 1.2 = 168px */
    animation: float3 8s ease-in-out infinite;
}

.floating-img-4 {
    bottom: 8%;
    right: 5%;
    width: 340px;  /* 190px * 1.2 = 228px */
    height: 220px; /* 125px * 1.2 = 150px */
    animation: float4 6.5s ease-in-out infinite;
}

.floating-img-5 {
    top: 45%;
    left: 50%;
    transform: translateX(-50%);
    width: 340px;  /* 160px * 1.35 = 216px */
    height: 220px; /* 110px * 1.35 = 149px */
    animation: float5 7.5s ease-in-out infinite;
}

/* Floating animations */
@keyframes float1 {
    0%, 100% { transform: translateY(0) rotate(1deg); }
    50% { transform: translateY(-15px) rotate(-1deg); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

@keyframes float3 {
    0%, 100% { transform: translateY(0) rotate(0.5deg); }
    50% { transform: translateY(-12px) rotate(-0.5deg); }
}

@keyframes float4 {
    0%, 100% { transform: translateY(0) rotate(-0.5deg); }
    50% { transform: translateY(-18px) rotate(0.5deg); }
}

@keyframes float5 {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
    50% { transform: translateX(-50%) translateY(-10px) rotate(1deg); }
}

/* Hero Content - Fixed Position */
.page-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(rgba(0, 51, 102, 0.4), rgba(0, 102, 204, 0.4));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 1;
}

.page-header-content {
    color: #fff;
    max-width: 900px;
    padding: 0 2rem;
    transform: translateY(0);
    transition: all 0.1s ease-out;
}

.page-header h1 {
    font-size: 4.5rem;
    margin-bottom: 2rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    line-height: 1.1;
    font-weight: 700;
}

.page-header p {
    font-size: 1.6rem;
    max-width: 800px;
    margin: 0 auto 3rem;
    opacity: 0.95;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    line-height: 1.5;
    font-weight: 400;
}

.breadcrumbs {
    margin-top: 3rem;
    font-size: 1.2rem;
    opacity: 0.9;
}

.breadcrumbs a {
    color: #00bcd4;
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.breadcrumbs span {
    color: #e0e0e0;
    margin: 0 0.8rem;
}

/* Back to Top Button Only */
.scroll-progress {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 188, 212, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    box-shadow: 0 10px 30px rgba(0, 188, 212, 0.3);
}

.scroll-progress.show-button {
    opacity: 1;
    transform: translateY(0);
}

.scroll-progress:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 188, 212, 0.4);
    background: rgba(0, 188, 212, 0.9);
}

.back-to-top-icon {
    color: #fff;
    font-size: 1.5rem;
}

.scroll-hint {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    z-index: 100;
    animation: pulseHint 2s infinite;
    text-align: center;
}

@keyframes pulseHint {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(-5px); }
}

/* Image Transition Overlay */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    z-index: 0;
    transition: opacity 0.3s ease;
}

/* Main Content - Positioned after scroll area */
.main-content {
    position: relative;
    top: 150vh; /* Start after the scroll container */
    background: #ffffffff;
    z-index: 2;
    min-height: 100vh;
    padding: 4rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Filter Section */
.filter-section {
    background: #f8f9fa;
    padding: 2rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #666;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(45deg, #00bcd4, #0099cc);
    border-color: #00bcd4;
    color: #fff;
    transform: translateY(-2px);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.product-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.product-image {
    height: 200px;
    background: linear-gradient(135deg, #00bcd4, #0099cc);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 3rem;
}

.product-info {
    padding: 2rem;
}

.product-category {
    color: #00bcd4;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-info h3 {
    font-size: 1.5rem;
    color: #003366;
    margin-bottom: 1rem;
}

.product-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.product-features {
    list-style: none;
    margin-bottom: 1.5rem;
}

.product-features li {
    color: #666;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.product-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #00bcd4;
    font-weight: bold;
}

.product-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    flex: 1;
}

.btn-primary {
    background: linear-gradient(45deg, #00bcd4, #0099cc);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 188, 212, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #003366;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    border-color: #00bcd4;
    color: #00bcd4;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: #003366;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Category visibility */
.automation-systems { display: block; }
.navigation-equipment { display: none; }
.spare-parts { display: none; }
.communication-systems { display: none; }

/* Mobile Optimizations */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 3rem;
    }
    
    .page-header p {
        font-size: 1.3rem;
        padding: 0 1rem;
    }
    
    .bg-layer {
        background-attachment: scroll; /* Fixed backgrounds don't work well on mobile */
    }
    
    .scroll-progress {
        width: 50px;
        height: 50px;
        bottom: 1rem;
        right: 1rem;
    }
    
    .back-to-top-icon {
        font-size: 1.2rem;
    }
    
    /* Mobile floating image adjustments - 20% bigger, middle 35% bigger */
    .floating-img-1 {
        width: 144px;  /* 120px * 1.2 = 144px */
        height: 96px;  /* 80px * 1.2 = 96px */
        top: 10%;
        left: 3%;
    }

    .floating-img-2 {
        width: 132px;  /* 110px * 1.2 = 132px */
        height: 90px;  /* 75px * 1.2 = 90px */
        top: 20%;
        right: 5%;
    }

    .floating-img-3 {
        width: 156px;  /* 130px * 1.2 = 156px */
        height: 102px; /* 85px * 1.2 = 102px */
        bottom: 25%;
        left: 5%;
    }

    .floating-img-4 {
        width: 138px;  /* 115px * 1.2 = 138px */
        height: 94px;  /* 78px * 1.2 = 94px */
        bottom: 12%;
        right: 3%;
    }

    .floating-img-5 {
        width: 135px;  /* 100px * 1.35 = 135px */
        height: 95px;  /* 70px * 1.35 = 95px */
        top: 40%;
    }
    
    .filter-tabs {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    .page-header p {
        font-size: 1.1rem;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .bg-layer,
    .page-header-content,
    .transition-overlay {
        transition: none;
    }
    
    .scroll-hint {
        animation: none;
    }
}