/* Makiety produktów – warstwy z projektu grafika ułożone 1:1 na płótnie produktu */
@font-face {
    font-family: "Bebas Neue";
    src: url("/assets/fonts/BebasNeue-Regular.ttf") format("truetype");
    font-display: block;
}

.mockup-product {
    display: grid;
    gap: 0.75rem;
}

.mockup-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    user-select: none;
    background: #f1f5f9;
}

/* Na kafelku produktu widać tylko pierwszą stronę (np. awers bombki); powiększenie pokazuje wszystkie */
.mockup-product[data-compact] .mockup-side-extra {
    display: none;
}

.mockup-side-label {
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    z-index: 5;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    background: rgb(15 23 42 / 0.7);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mockup-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mockup-photo-slot {
    position: absolute;
    pointer-events: none;
}

.mockup-photo-img {
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: center center;
    transition: transform 0.12s ease-out;
}

.mockup-text {
    font-family: "Bebas Neue", "Arial Narrow", sans-serif;
}

/* Szachownica pod miniaturami w panelu trenera/admina, żeby od razu widzieć czy PNG ma przezroczystość */
.checkerboard-bg {
    background-color: #f8fafc;
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.toast-banner {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 60;
    pointer-events: none;
    max-width: calc(100% - 2.5rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Nad dolnym paskiem koszyka (formularz rodzica), żeby go nie zasłaniać */
body:has(#cart-shortcut:not([hidden])) .toast-banner {
    bottom: calc(6rem + env(safe-area-inset-bottom));
}

#cart-shortcut {
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.cart-quantity-button {
    width: 2.5rem;
    height: 2.5rem;
}

.cart-quantity-button:disabled {
    opacity: 0.45;
}

.app-dialog {
    width: min(32rem, calc(100% - 2rem));
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    padding: 0;
    margin: auto;
}

.app-dialog::backdrop {
    background: rgb(15 23 42 / 0.75);
}

.app-dialog-content {
    max-height: inherit;
}

#mockup-modal {
    width: min(42rem, calc(100% - 2rem));
}

:root:has(.app-dialog[open]) {
    overflow: hidden;
}

@media (max-width: 639px) {
    input:is([type="text"], [type="search"], [type="password"], [type="tel"], [type="email"], [type="number"]),
    select,
    textarea {
        font-size: 1rem;
    }

    .admin-mobile-table,
    .admin-mobile-table tbody,
    .admin-mobile-table td {
        display: block;
    }

    .admin-mobile-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .admin-mobile-table tbody tr {
        display: block;
        padding: 0.5rem;
        margin-bottom: 0.625rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        background: #f8fafc;
    }

    .admin-mobile-table tbody td {
        padding: 0.25rem;
    }
}

/* Duży podgląd zdjęcia po najechaniu na miniaturę (panel admina) */
.hover-preview {
    position: fixed;
    z-index: 60;
    /* Nie wyższy niż okno przeglądarki (proporcje zdjęcia 700×920 + podpis) */
    width: min(420px, calc((100vh - 60px) * 700 / 920));
    padding: 8px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 40px rgb(15 23 42 / 0.25);
    pointer-events: none;
}

.hover-preview[hidden] {
    display: none;
}

.hover-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 700 / 920;
    object-fit: contain;
    object-position: bottom;
    border-radius: 10px;
    background-color: #f8fafc;
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.hover-preview-caption {
    margin-top: 6px;
    font-size: 11px;
    font-family: ui-monospace, monospace;
    color: #475569;
    word-break: break-all;
}

/* Formularz rodzica: przełącznik zdjęć pod podglądem produktu i przyciski ilości */
.photo-chip {
    width: 2.25rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    overflow: hidden;
    transition: border-color 0.12s, box-shadow 0.12s;
}

.photo-chip img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom;
}

.photo-chip:hover {
    border-color: #94a3b8;
}

.photo-chip.is-active {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px #bfdbfe;
}

/* Na telefonie miniatury pod podglądem wypełniają jego szerokość, łatwiej w nie trafić palcem */
@media (max-width: 639px) {
    .photo-chips .photo-chip {
        flex: 1 1 2.25rem;
        max-width: 2.75rem;
        height: 3.25rem;
    }
}

.photo-chip-lg {
    width: 3.5rem;
    height: 4.25rem;
}

.qty-btn {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: #334155;
}

.qty-btn:hover:not(:disabled) {
    background: #f1f5f9;
}

.qty-btn:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

.summary-qty-btn {
    width: 2.25rem;
    height: 2rem;
    font-size: 1rem;
    font-weight: 800;
    color: #334155;
}

.summary-qty-btn:hover {
    background: #f1f5f9;
}

/* Podgląd produktu w formularzu rodzica: kwadrat obok opisu (na telefonie ok. 40% szerokości) */
.mockup-fit {
    width: var(--sm-width);
}

/* Zdjęcie realizacji: miniatura w lewym dolnym rogu podglądu (tu nie zasłania twarzy ani numeru na karcie) */
.real-thumb {
    position: absolute;
    bottom: 0.375rem;
    left: 0.375rem;
    width: 3.25rem;
    height: 3.25rem;
    border: 2px solid #fff;
    border-radius: 0.625rem;
    background: #e2e8f0;
    box-shadow: 0 2px 8px rgb(15 23 42 / 0.35);
    overflow: hidden;
}

.real-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.real-thumb span {
    position: absolute;
    inset: auto 0 0;
    padding: 0.15rem 0;
    background: rgb(15 23 42 / 0.78);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
}

@media (min-width: 640px) {
    .real-thumb {
        width: 4rem;
        height: 4rem;
    }
}

/* Opis produktu w panelu: pole rośnie razem z tekstem (starsze przeglądarki: stała wysokość z rows) */
.textarea-grow {
    field-sizing: content;
    min-height: 8.5rem;
}

/* Wspólny wybór zdjęcia nad listą produktów */
.photo-pick {
    position: relative;
    width: 4.75rem;
    border-radius: 0.75rem;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    overflow: hidden;
    transition: border-color 0.12s, box-shadow 0.12s;
}

@media (min-width: 640px) {
    .photo-pick {
        width: 5.5rem;
    }
}

.photo-pick img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    object-position: bottom;
}

.photo-pick span {
    display: block;
    padding: 0.25rem 0.25rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #334155;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.photo-pick:hover {
    border-color: #94a3b8;
}

.photo-pick.is-active {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px #bfdbfe;
}

.photo-pick.is-active::after {
    content: "✓";
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    display: grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 9999px;
    background: #1d4ed8;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
}

/* Własny wygląd listy wyboru: Safari na iOS ignoruje wysokość systemowego <select> */
.app-select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23475569'%3E%3Cpath d='M5.3 7.3a1 1 0 0 1 1.4 0L10 10.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.1rem;
}

/* Atrybut hidden zawsze ukrywa element, także gdy ma klasę flex/grid z Tailwinda */
[hidden] {
    display: none !important;
}
