/* Product pages only. The palette follows the existing FM System site theme. */
.fm-product-catalog-page,
.fm-product-gallery-page {
    background: linear-gradient(135deg, #f6efe6, #fff8ef);
}

.fm-product-catalog-hero {
    position: relative;
    min-height: 390px;
    display: grid;
    align-items: center;
    overflow: hidden;
    color: #fff;
    background: #0f344f;
}

.fm-product-catalog-hero-bg,
.fm-product-catalog-hero-overlay {
    position: absolute;
    inset: 0;
}

.fm-product-catalog-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-product-catalog-hero-overlay {
    background: linear-gradient(90deg, rgba(6, 24, 39, .92), rgba(15, 52, 79, .68) 52%, rgba(15, 52, 79, .2));
}

.fm-product-catalog-hero-inner {
    position: relative;
    z-index: 1;
    padding: 145px 0 72px;
}

.fm-product-catalog-hero-copy {
    max-width: 780px;
}

.fm-product-catalog-hero-copy .section-kicker {
    color: #f7a13d;
}

.fm-product-catalog-hero-copy h1 {
    margin: 0 0 18px;
    font-size: clamp(38px, 5vw, 64px);
    line-height: 1.05;
    color: #fff;
}

.fm-product-catalog-hero-copy p {
    max-width: 700px;
    margin: 0;
    color: rgba(255,255,255,.9);
    font-size: 17px;
    line-height: 1.75;
}

.fm-product-catalog-section {
    padding: 48px 0 70px;
}

.fm-product-tabs {
    display: inline-flex;
    margin-bottom: 28px;
    border: 1px solid #d9d2c9;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 52, 79, .08);
}

.fm-product-tab {
    min-width: 145px;
    padding: 12px 24px;
    text-align: center;
    color: #0f344f;
    font-weight: 800;
    border-right: 1px solid #d9d2c9;
    transition: background .2s ease, color .2s ease;
}

.fm-product-tab:last-child {
    border-right: 0;
}

.fm-product-tab:hover {
    color: #d9821f;
    background: #fff8ef;
}

.fm-product-tab.active {
    color: #fff;
    background: #0f344f;
}

.fm-product-tab.active:hover {
    color: #fff;
    background: #173f5f;
}

.fm-product-grid-simple {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
}

.fm-product-card-simple {
    display: block;
    overflow: hidden;
    border: 1px solid rgba(217, 130, 31, .7);
    border-radius: 24px;
    background: #eef2f4;
    box-shadow: 0 14px 34px rgba(15, 52, 79, .1);
    transition: transform .25s ease, box-shadow .25s ease;
}

.fm-product-card-simple:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 42px rgba(15, 52, 79, .16);
}

.fm-product-card-image {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: #eef2f4;
}

.fm-product-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .35s ease;
}

.fm-product-card-simple:hover .fm-product-card-image img {
    transform: scale(1.02);
}

.fm-product-image-placeholder {
    width: 100%;
    min-height: 220px;
    display: grid;
    place-items: center;
    color: #667085;
    font-weight: 700;
}

.fm-product-card-name {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1;
    max-width: calc(100% - 28px);
    padding: 8px 14px;
    border: 1px solid rgba(15, 52, 79, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 5px 16px rgba(15, 52, 79, .12);
    text-align: center;
}

.fm-product-card-name h2 {
    margin: 0;
    color: #0f344f;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 700;
}

.fm-product-empty {
    grid-column: 1 / -1;
    padding: 54px 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 20px;
    background: rgba(255,255,255,.72);
    text-align: center;
}

.fm-product-empty h2 {
    margin-bottom: 8px;
    color: #0f344f;
}

.fm-product-empty p {
    color: #667085;
    line-height: 1.6;
}

.fm-product-gallery-header {
    padding: 132px 0 34px;
    background: #fffaf3;
    border-bottom: 1px solid rgba(15,52,79,.1);
}

.fm-product-back-link {
    display: inline-flex;
    margin-bottom: 26px;
    color: #0f344f;
    font-weight: 800;
}

.fm-product-back-link:hover {
    color: #d9821f;
}

.fm-product-gallery-header h1 {
    margin-bottom: 10px;
    color: #102f46;
    font-size: clamp(34px, 4vw, 52px);
}

.fm-product-gallery-header p {
    color: #667085;
    line-height: 1.7;
}

.fm-product-gallery-section {
    padding: 34px 0 70px;
}

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

.fm-product-gallery-card {
    width: 100%;
    height: 260px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(217, 130, 31, .55);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 52, 79, .1);
    cursor: pointer;
}

.fm-product-gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.fm-product-gallery-card:hover img {
    transform: scale(1.04);
}

.fm-product-image-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.fm-product-image-modal.is-open {
    display: flex;
}

.fm-product-image-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 17, 29, .9);
    backdrop-filter: blur(6px);
}

.fm-product-image-modal-card {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: min(92vw, 1400px);
    max-height: 90vh;
    max-height: 90dvh;
    padding: 10px;
    border: 1px solid rgba(247,161,61,.55);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(0,0,0,.4);
}

.fm-product-image-modal-card img {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(92vw - 20px);
    max-height: calc(90vh - 20px);
    max-height: calc(90dvh - 20px);
    object-fit: contain;
    border-radius: 10px;
}

.fm-product-image-modal-close {
    position: absolute;
    top: -16px;
    right: -16px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #0f344f;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    box-shadow: 0 8px 22px rgba(0,0,0,.25);
}

.fm-product-image-modal-close:hover {
    background: #d9821f;
}

.fm-product-gallery-empty-page {
    min-height: 55vh;
    display: grid;
    place-items: center;
    padding: 150px 0 70px;
    text-align: center;
}

.fm-product-gallery-empty-page h1 {
    margin: 8px 0 10px;
    color: #0f344f;
}

.fm-product-gallery-empty-page p {
    margin-bottom: 24px;
    color: #667085;
}

@media (max-width: 1200px) {
    .fm-product-grid-simple {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .fm-product-card-image {
        height: 280px;
    }
}

@media (max-width: 900px) {
    .fm-product-grid-simple,
    .fm-product-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fm-product-card-image {
        height: 260px;
    }
}

@media (max-width: 640px) {
    .fm-product-catalog-hero-inner {
        padding: 120px 0 60px;
    }

    .fm-product-catalog-hero {
        min-height: 420px;
    }

    .fm-product-catalog-hero-copy h1 {
        font-size: 34px;
    }

    .fm-product-catalog-section,
    .fm-product-gallery-section {
        padding: 30px 0 52px;
    }

    .fm-product-tabs {
        width: 100%;
    }

    .fm-product-tab {
        flex: 1;
        min-width: 0;
        padding: 12px 10px;
    }

    .fm-product-grid-simple,
    .fm-product-gallery-grid {
        grid-template-columns: 1fr;
    }

    .fm-product-gallery-card {
        height: 245px;
    }

    .fm-product-card-image {
        height: 240px;
    }

    .fm-product-card-name {
        top: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
        padding: 7px 11px;
    }

    .fm-product-card-name h2 {
        font-size: 14px;
    }

    .fm-product-gallery-header {
        padding: 118px 0 30px;
    }

    .fm-product-image-modal {
        padding: 18px;
    }

    .fm-product-image-modal-card {
        max-width: 94vw;
        max-height: 88vh;
        max-height: 88dvh;
    }

    .fm-product-image-modal-close {
        top: -12px;
        right: -10px;
        width: 38px;
        height: 38px;
        font-size: 25px;
    }
}
