/* ================================================================
   Flexible Engineering — Products & Services
   Matches Coolify theme: Plus Jakarta Sans, primary #203A4F,
   accent #ED703F, secondary #E9F4F4, text #84919A
   ================================================================ */

/* ── Products Archive / Overview ────────────────────────────────── */

.fel-products-archive {
    padding: 80px 0 100px;
}

.fel-products-intro {
    max-width: 740px;
    margin: 0 auto 60px;
    text-align: center;
}

.fel-products-intro h2 {
    font-size: 42px;
    color: var(--e-global-color-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.fel-products-intro p {
    font-size: 17px;
    line-height: 1.7;
    color: var(--e-global-color-text);
}

/* Category Grid */
.fel-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.fel-category-card {
    position: relative;
    background: var(--e-global-color-white);
    border: 1px solid var(--e-global-color-divider);
    border-radius: 16px;
    padding: 40px 32px 36px;
    transition: all 0.4s ease;
    overflow: hidden;
}

.fel-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--e-global-color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.fel-category-card:hover {
    border-color: transparent;
    box-shadow: 0 12px 40px rgba(32, 58, 79, 0.1);
    transform: translateY(-4px);
}

.fel-category-card:hover::before {
    transform: scaleX(1);
}

.fel-category-card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--e-global-color-secondary);
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 24px;
    color: var(--e-global-color-accent);
    transition: all 0.3s ease;
}

.fel-category-card:hover .fel-category-card-icon {
    background: var(--e-global-color-accent);
    color: var(--e-global-color-white);
}

.fel-category-card h3 {
    font-size: 22px;
    color: var(--e-global-color-primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.fel-category-card h3 a {
    color: inherit;
}

.fel-category-card h3 a:hover {
    color: var(--e-global-color-accent);
}

.fel-category-card-desc {
    font-size: 15px;
    line-height: 1.65;
    color: var(--e-global-color-text);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fel-category-card-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--e-global-color-accent);
}

.fel-category-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--e-global-color-accent);
    margin-top: 20px;
    transition: gap 0.3s ease;
}

.fel-category-card-link:hover {
    gap: 12px;
    color: var(--e-global-color-primary);
}

.fel-category-card-link i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.fel-category-card:hover .fel-category-card-link i {
    transform: translateX(3px);
}

/* ── Category Archive (taxonomy page) ───────────────────────────── */

.fel-category-header {
    background: var(--e-global-color-primary);
    padding: 200px 0 80px;
    margin-top: 40px !important;
    position: relative;
    overflow: hidden;
}

.fel-category-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(32, 58, 79, 0.4), transparent);
    pointer-events: none;
}

.fel-category-header-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.fel-category-header h1 {
    font-size: 56px;
    color: var(--e-global-color-white) !important;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.fel-category-header-desc {
    max-width: 680px;
    margin: 0 auto;
    font-size: 17px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
}

/* Products listing within a category */
.fel-product-listing {
    padding: 80px 0 100px;
}

.fel-product-listing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.fel-product-card {
    position: relative;
    background: var(--e-global-color-white);
    border: 1px solid var(--e-global-color-divider);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.fel-product-card:hover {
    border-color: transparent;
    box-shadow: 0 12px 40px rgba(32, 58, 79, 0.1);
    transform: translateY(-3px);
}

.fel-product-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--e-global-color-secondary);
}

.fel-product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.fel-product-card:hover .fel-product-card-image img {
    transform: scale(1.05);
}

.fel-product-card-body {
    padding: 28px 28px 32px;
}

.fel-product-card h3 {
    font-size: 20px;
    color: var(--e-global-color-primary);
    margin-bottom: 10px;
    line-height: 1.35;
}

.fel-product-card h3 a {
    color: inherit;
}

.fel-product-card h3 a:hover {
    color: var(--e-global-color-accent);
}

.fel-product-card-excerpt {
    font-size: 15px;
    line-height: 1.65;
    color: var(--e-global-color-text);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fel-product-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--e-global-color-accent);
    transition: gap 0.3s ease;
}

.fel-product-card-cta:hover {
    gap: 12px;
    color: var(--e-global-color-primary);
}

.fel-product-card-cta i {
    font-size: 12px;
}

/* ── Single Product Page ────────────────────────────────────────── */

.fel-product-hero {
    background: var(--e-global-color-primary);
    padding: 200px 0 80px;
    margin-top: 40px !important;
}

.fel-product-hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.fel-product-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.fel-product-breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.fel-product-breadcrumb a:hover {
    color: var(--e-global-color-accent);
}

.fel-product-breadcrumb span {
    color: rgba(255, 255, 255, 0.4);
}

.fel-product-breadcrumb .current {
    color: var(--e-global-color-white);
}

.fel-product-hero h1 {
    font-size: 48px;
    color: var(--e-global-color-white) !important;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.fel-product-hero-cat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--e-global-color-accent);
    background: rgba(237, 112, 63, 0.15);
    padding: 6px 16px;
    border-radius: 50px;
}

/* Product Content */
.fel-product-content {
    padding: 80px 0 100px;
}

.fel-product-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 60px;
    max-width: 960px;
    margin: 0 auto;
}

.fel-product-section {
    position: relative;
}

.fel-product-section-title {
    font-size: 28px;
    color: var(--e-global-color-primary);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--e-global-color-secondary);
}

.fel-product-description {
    font-size: 16px;
    line-height: 1.75;
    color: #3B4855;
}

.fel-product-description h2,
.fel-product-description h3 {
    color: var(--e-global-color-primary);
    margin-top: 32px;
    margin-bottom: 14px;
}

.fel-product-description h2 {
    font-size: 26px;
}

.fel-product-description h3 {
    font-size: 21px;
}

.fel-product-description p {
    margin-bottom: 16px;
}

.fel-product-description ul,
.fel-product-description ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.fel-product-description li {
    margin-bottom: 8px;
    line-height: 1.65;
    color: #3B4855;
}

/* Specs Table */
.fel-product-specs {
    margin-top: 40px;
}

.fel-specs-grid {
    display: grid;
    gap: 0;
    border: 1px solid var(--e-global-color-divider);
    border-radius: 12px;
    overflow: hidden;
}

.fel-spec-row {
    display: grid;
    grid-template-columns: 240px 1fr;
    border-bottom: 1px solid var(--e-global-color-divider);
}

.fel-spec-row:last-child {
    border-bottom: none;
}

.fel-spec-label {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--e-global-color-primary);
    background: var(--e-global-color-secondary);
    line-height: 1.5;
}

.fel-spec-value {
    padding: 14px 20px;
    font-size: 14px;
    color: var(--e-global-color-text);
    line-height: 1.5;
}

/* Product Gallery */
.fel-product-gallery {
    margin-top: 60px;
}

.fel-product-gallery .fel-product-section-title {
    margin-bottom: 28px;
}

.fel-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.fel-gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--e-global-color-secondary);
    aspect-ratio: 4 / 3;
}

.fel-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.4s ease;
}

.fel-gallery-item:hover img {
    transform: scale(1.05);
}

/* For 2 images */
.fel-gallery-grid.fel-gallery-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* For 1 image */
.fel-gallery-grid.fel-gallery-1 {
    grid-template-columns: 1fr;
    max-width: 600px;
}

/* Category Description Page - images at bottom */
.fel-category-page-images {
    margin-top: 60px;
}

.fel-category-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.fel-category-image-item {
    border-radius: 12px;
    overflow: hidden;
    background: var(--e-global-color-secondary);
    aspect-ratio: 4 / 3;
}

.fel-category-image-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

/* Product sub-sections within category page */
.fel-product-subsection {
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--e-global-color-divider);
}

.fel-product-subsection:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.fel-product-subsection h3 {
    font-size: 22px;
    color: var(--e-global-color-primary);
    margin-bottom: 16px;
    padding-left: 16px;
    border-left: 3px solid var(--e-global-color-accent);
}

.fel-product-subsection-body {
    font-size: 15px;
    line-height: 1.75;
    color: #3B4855;
}

.fel-product-subsection-body ul {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.fel-product-subsection-body ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    line-height: 1.6;
}

.fel-product-subsection-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--e-global-color-accent);
    border-radius: 50%;
}

/* CTA Section */
.fel-product-cta {
    background: var(--e-global-color-primary);
    padding: 80px 0;
    text-align: center;
}

.fel-product-cta h2 {
    font-size: 36px;
    color: var(--e-global-color-white) !important;
    margin-bottom: 16px;
}

.fel-product-cta p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.fel-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--e-global-color-white);
    background: var(--e-global-color-accent);
    padding: 16px 32px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.fel-cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    transition: left 0.4s ease;
    z-index: -1;
}

.fel-cta-btn:hover {
    color: var(--e-global-color-white);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(237, 112, 63, 0.35);
}

.fel-cta-btn:hover::before {
    left: 0;
}

/* Related products */
.fel-related-products {
    padding: 80px 0;
    background: var(--e-global-color-secondary);
}

.fel-related-products h2 {
    font-size: 32px;
    color: var(--e-global-color-primary);
    margin-bottom: 40px;
    text-align: center;
}

.fel-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media only screen and (max-width: 1200px) {
    .fel-category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fel-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media only screen and (max-width: 991px) {
    .fel-products-archive {
        padding: 50px 0 60px;
    }
    
    .fel-products-intro {
        margin-bottom: 40px;
    }
    
    .fel-products-intro h2 {
        font-size: 32px;
    }
    
    .fel-category-header {
        padding: 150px 0 60px;
        margin-top: 0 !important;
    }
    
    .fel-category-header h1 {
        font-size: 40px;
    }
    
    .fel-product-hero {
        padding: 150px 0 60px;
        margin-top: 0 !important;
    }
    
    .fel-product-hero h1 {
        font-size: 36px;
    }
    
    .fel-product-listing {
        padding: 50px 0 60px;
    }
    
    .fel-product-content {
        padding: 50px 0 60px;
    }
    
    .fel-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fel-product-cta {
        padding: 50px 0;
    }
    
    .fel-product-cta h2 {
        font-size: 28px;
    }
    
    .fel-related-products {
        padding: 50px 0;
    }
    
    .fel-spec-row {
        grid-template-columns: 180px 1fr;
    }
}

@media only screen and (max-width: 767px) {
    .fel-category-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .fel-category-card {
        padding: 28px 24px;
    }
    
    .fel-product-listing-grid {
        grid-template-columns: 1fr;
    }
    
    .fel-category-header h1 {
        font-size: 30px;
    }
    
    .fel-product-hero h1 {
        font-size: 28px;
    }
    
    .fel-gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .fel-spec-row {
        grid-template-columns: 1fr;
    }
    
    .fel-spec-label {
        border-bottom: none;
        padding-bottom: 4px;
    }
    
    .fel-spec-value {
        padding-top: 4px;
    }
    
    .fel-related-grid {
        grid-template-columns: 1fr;
    }
    
    .fel-product-section-title {
        font-size: 24px;
    }
    
    .fel-product-cta h2 {
        font-size: 24px;
    }
    
    .fel-category-images-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Sub Products (repeater) ────────────────────────────────────── */

.fel-product-sub-products {
    margin-top: 48px;
}

.fel-sub-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.fel-sub-product-card {
    background: var(--e-global-color-white);
    border: 1px solid var(--e-global-color-divider);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.fel-sub-product-card:hover {
    box-shadow: 0 12px 40px rgba(32, 58, 79, 0.1);
    transform: translateY(-3px);
}

.fel-sub-product-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    padding: 12px;
    background: var(--e-global-color-secondary);
    border-bottom: 1px solid var(--e-global-color-divider);
}

.fel-sub-product-image {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 130px;
}

.fel-sub-product-image img {
    width: 100%;
    height: auto;
    max-height: 260px;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.4s ease;
}

.fel-sub-product-card:hover .fel-sub-product-image img {
    transform: scale(1.03);
}

.fel-sub-product-body {
    padding: 24px 24px 28px;
}

.fel-sub-product-body h3 {
    font-size: 20px;
    color: var(--e-global-color-primary);
    margin-bottom: 12px;
    line-height: 1.35;
}

.fel-sub-product-desc {
    font-size: 15px;
    line-height: 1.7;
    color: #3B4855;
}

.fel-sub-product-desc p:last-child {
    margin-bottom: 0;
}

@media only screen and (max-width: 767px) {
    .fel-sub-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ── General images at top of Products section ──────────────────── */

.fel-top-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.fel-top-image-item {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--e-global-color-divider);
    background: var(--e-global-color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
}

.fel-top-image-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.4s ease;
}

.fel-top-image-item:hover img {
    transform: scale(1.03);
}

@media only screen and (max-width: 767px) {
    .fel-top-images-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ── Product Gallery: fit images to natural sizes ───────────────── */

/* Prevent the lone 4th image (portrait) from expanding to full row width */
.fel-product-description .wp-block-gallery.has-nested-images figure.wp-block-image {
    flex-grow: 0 !important;
    flex-basis: calc(33.333% - var(--wp--style--unstable-gallery-gap, 16px)) !important;
    max-width: calc(33.333% - var(--wp--style--unstable-gallery-gap, 16px)) !important;
}

/* Cap image height so portrait/orientation mix displays at natural ratio */
.fel-product-description .wp-block-gallery.has-nested-images figure.wp-block-image img {
    max-height: 360px !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

