/* Kafle szablonow w cenniku (modules_packet.phtml) i w formularzu zamowienia (application/view/registration/form.phtml):
   miniatura 4:3, po najechaniu albo fokusie granatowa nakladka z przyciskami "Zobacz" (obrys) i "Wyprobuj za darmo"
   (koral strony); na ekranach dotykowych przyciski stale na dole miniatury. Lista szablonow: szablony.php. */

.template {
    overflow: hidden;
    border: 1px solid #e3e8ee !important;
    border-radius: 4px;
    background-size: cover !important;
    background-position: center top !important;
    box-shadow: 0 1px 2px rgba(31, 45, 61, .06);
    transition: box-shadow .25s ease-out, transform .25s ease-out;
}
.template:hover,
.template:focus-within {
    box-shadow: 0 14px 30px -14px rgba(31, 45, 61, .45);
    transform: translateY(-2px);
}

.template-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: rgba(31, 45, 61, .78);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .25s ease-out;
}
.template:hover .template-overlay,
.template:focus-within .template-overlay {
    opacity: 1;
}

.template-overlay .btn {
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 0;
    padding: 11px 16px 12px;
    font-size: 13px;
    letter-spacing: .04em;
    line-height: 1.2;
    text-align: center;
    transform: translateY(6px);
    transition: transform .3s cubic-bezier(.16, 1, .3, 1), background-color .2s ease-out, color .2s ease-out, box-shadow .2s ease-out;
}
.template:hover .template-overlay .btn,
.template:focus-within .template-overlay .btn {
    transform: none;
}
.template-overlay .btn:focus-visible {
    outline: 2px solid #fff !important;
    outline-offset: 3px;
}

/* Zobacz: obrys na nakladce, po najechaniu bialy */
.template-overlay .btn.see-demo {
    background: transparent;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9);
}
.template-overlay .btn.see-demo:hover,
.template-overlay .btn.see-demo:focus-visible {
    background: #fff;
    color: #1f2d3d !important;
    box-shadow: inset 0 0 0 2px #fff;
}

/* Wyprobuj za darmo: koral strony (kolor .btn z red.css) */
.template-overlay .btn.order-demo {
    box-shadow: 0 6px 16px -6px rgba(250, 108, 101, .7);
}

/* Podpis pod kafelkiem */
.template-name {
    display: inline-block;
    margin-top: 12px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .02em;
}

/* Ekrany dotykowe: bez najechania, przyciski stale na dole miniatury */
@media (hover: none) {
    .template-overlay {
        flex-direction: row;
        align-items: flex-end;
        justify-content: center;
        gap: 8px;
        padding: 12px;
        background: linear-gradient(to top, rgba(31, 45, 61, .88), rgba(31, 45, 61, 0) 55%);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        opacity: 1;
    }
    .template-overlay .btn {
        flex: 1;
        max-width: none;
        padding: 10px 8px 11px;
        font-size: 12px;
        transform: none;
    }
    .template:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .template, .template-overlay, .template-overlay .btn { transition: none; transform: none !important; }
}
