/* ==========================================================
   PATENT PAGE
   Loaded only by Views/Home/Patent.cshtml via ~/bundles/patent-css.
   Site-wide components stay in style.css / mobile_style.css.
   ========================================================== */

/* "Patents approved 195" script behind the title (--patent-bg is set inline so the URL carries ?v=). */
.patent-title {
    padding: 28px 0;
    font-size: 40px;
    text-align: center;
    background: var(--patent-bg) center / auto 100% no-repeat;
}

/* ---- Certificate coverflow ----
   fun.js (data-cycle) gives each certificate --offset (-3 … 3 around the current one), --distance and
   data-cycle-distance; each step to the side moves it 62% of its width and shrinks it by 10%.
   Desktop shows three on each side; the next one in is already laid out (hidden) so its image has loaded. */
.patent-carousel {
    position: relative;
    margin-top: 24px;
}

.patent-carousel__track {
    position: relative;
    overflow: hidden;
    padding-bottom: 30%; /* the main certificate (18% wide, A4) plus room for its shadow */
}

.patent-cert {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: calc(10 - var(--distance, 0));
    display: none;
    width: 18%;
    transform: translate(-50%, -50%) translateX(calc(var(--offset, 0) * 62%)) scale(calc(1 - var(--distance, 0) * 0.1));
    transition: transform 0.3s ease;
}

.patent-cert[data-cycle-distance="0"],
.patent-cert[data-cycle-distance="1"],
.patent-cert[data-cycle-distance="2"],
.patent-cert[data-cycle-distance="3"],
.patent-cert[data-cycle-distance="4"] {
    display: block;
}

.patent-cert[data-cycle-distance="4"] {
    visibility: hidden;
}

/* Jumping from one end to the other: no slide across the whole carousel. */
.patent-cert.is-wrapping {
    transition: none;
}

.patent-cert__img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #111;
    background-color: #fff;
    transition: box-shadow 0.2s;
}

.patent-cert:hover .patent-cert__img {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.patent-cert:focus-visible {
    outline: 3px solid #ffed00;
    outline-offset: 2px;
}

.patent-carousel__btn {
    position: absolute;
    top: 50%;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    background-color: rgba(17, 17, 17, 0.7);
    transform: translateY(-50%);
    cursor: pointer;
}

.patent-carousel__btn--prev {
    left: 2%;
}

.patent-carousel__btn--next {
    right: 2%;
}

.patent-carousel__btn:hover {
    background-color: #111;
}

.patent-carousel__btn:focus-visible {
    outline: 3px solid #ffed00;
    outline-offset: 2px;
}

.patent-maxim {
    max-width: 900px;
    margin: 32px auto 48px;
    color: #dcbc6e;
    font-size: 22px;
    line-height: 1.5;
    text-align: center;
}

/* ---- Banner, product buttons, exploded view ---- */
.patent-panel__img {
    display: block;
    width: 100%;
    height: auto;
}

.patent-tabs {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin: 48px 0 32px;
}

.patent-tab {
    flex: 0 1 25%;
    padding: 10px;
    border: 1px solid #111;
    color: #111;
    font-family: "Sui Generis", Arial, sans-serif;
    font-size: clamp(16px, 2.2vw, 32px);
    line-height: 1.2;
    background-color: #fff;
    cursor: pointer;
}

@media (hover: hover) {
    .patent-tab:not(.is-active):hover {
        background-color: #cfcfcf;
    }
}

.patent-tab.is-active {
    color: #fff;
    background-color: #111;
}

.patent-tab:focus-visible {
    outline: 3px solid #ffed00;
    outline-offset: 3px;
}

.patent-tabs__arrow {
    color: #111;
    font-size: 24px;
}

/* Only the selected product's certificates, banner and exploded view are shown. */
.patent-carousel:not(.is-active),
.patent-panel:not(.is-active) {
    display: none;
}

/* ==========================================================
   Patent page: responsive
   ========================================================== */
@media (max-width: 767.98px) {
    .patent-title {
        padding: 18px 0;
        font-size: 24px;
    }

    /* One certificate on each side. */
    .patent-carousel__track {
        padding-bottom: 62%;
    }

    .patent-cert {
        width: 40%;
    }

    .patent-cert[data-cycle-distance="2"] {
        visibility: hidden;
    }

    .patent-cert[data-cycle-distance="3"],
    .patent-cert[data-cycle-distance="4"] {
        display: none;
    }

    .patent-carousel__btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .patent-maxim {
        margin: 24px auto 32px;
        font-size: 16px;
    }

    .patent-tabs {
        gap: 6px;
        margin: 32px 0 24px;
    }

    .patent-tab {
        flex: 1 1 0;
        padding: 8px 4px;
        font-size: 14px;
    }

    .patent-tabs__arrow {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .patent-cert,
    .patent-cert__img {
        transition: none;
    }
}
