/* Virtual try-on trigger button a modal — zobrazuje se jen na mobilnich zarizeních */

/* ===================== Trigger tlacitko ===================== */
.search-tryon-trigger {
    display: none; /* skryto na desktopu */
    margin: 12px 0 16px;
}

@media (max-width: 850px) {
    .search-tryon-trigger {
        display: block;
    }
}

.search-tryon-trigger__label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.search-tryon-trigger__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #222222;
    color: #f5f0e8;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: background 0.15s;
}

.search-tryon-trigger__btn:hover,
.search-tryon-trigger__btn:focus {
    background: #444444;
    outline: none;
}

.search-tryon-trigger__btn::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5f0e8'%3E%3Cpath d='M12 15.5A3.5 3.5 0 0 1 8.5 12 3.5 3.5 0 0 1 12 8.5a3.5 3.5 0 0 1 3.5 3.5 3.5 3.5 0 0 1-3.5 3.5m7.43-2.92c.04-.3.07-.6.07-.58 0-.2-.03-.5-.07-.58l1.76-1.38c.16-.12.2-.34.1-.52l-1.66-2.88c-.1-.18-.31-.24-.5-.18l-2.08.84c-.43-.34-.89-.62-1.4-.84l-.31-2.22A.39.39 0 0 0 15 4h-6a.39.39 0 0 0-.39.34l-.31 2.22c-.51.22-.97.5-1.4.84L4.82 6.56c-.19-.06-.4 0-.5.18L2.66 9.62c-.1.18-.06.4.1.52l1.76 1.38c-.04.3-.07.6-.07.58 0 .2.03.5.07.58L2.76 14.06c-.16.12-.2.34-.1.52l1.66 2.88c.1.18.31.24.5.18l2.08-.84c.43.34.89.62 1.4.84l.31 2.22c.06.2.22.34.39.34h6c.17 0 .33-.14.39-.34l.31-2.22c.51-.22.97-.5 1.4-.84l2.08.84c.19.06.4 0 .5-.18l1.66-2.88c.1-.18.06-.4-.1-.52l-1.76-1.38z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    flex-shrink: 0;
}

/* ===================== Modal overlay ===================== */
.tryon-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tryon-overlay.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.tryon-modal {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 480px;
    margin: 20px 12px 40px;
    border-radius: 4px;
    padding: 20px 16px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.tryon-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #666;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tryon-modal__close:hover {
    color: #222;
}

.tryon-modal__title {
    font-size: 17px;
    font-weight: 600;
    color: #222;
    margin: 0 32px 4px 0;
    letter-spacing: 0.02em;
}

.tryon-modal__subtitle {
    font-size: 13px;
    color: #888;
    margin: 0 0 16px;
}

.tryon-modal__label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ===================== Swatch picker ===================== */
.tryon-swatches {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tryon-swatches::-webkit-scrollbar {
    display: none;
}

.tryon-swatch {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    transition: border-color 0.12s;
    max-width: 72px;
}

.tryon-swatch__thumb {
    position: relative;
    display: block;
}

.tryon-swatch img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

/* Znacka "uz vyzkouseno" — zelene kolecko se zaskrtnutim v rohu swatche */
.tryon-swatch.is-tried .tryon-swatch__thumb::after {
    content: "✓";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #2e7d32;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff;
}

.tryon-swatch.is-tried .tryon-swatch__name {
    color: #2e7d32;
}

.tryon-swatch__name {
    font-size: 10px;
    color: #555;
    text-align: center;
    max-width: 68px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.tryon-swatch.is-selected {
    border-color: #222;
}

.tryon-swatch.is-selected .tryon-swatch__name {
    color: #222;
    font-weight: 600;
}

/* ===================== Tlacitka ===================== */
.tryon-modal__btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #222;
    color: #f5f0e8;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    letter-spacing: 0.03em;
    text-decoration: none;
    margin-top: 12px;
    transition: background 0.15s;
}

.tryon-modal__btn:hover,
.tryon-modal__btn:focus {
    background: #444;
    color: #f5f0e8;
    outline: none;
    text-decoration: none;
}

.tryon-modal__btn:disabled,
.tryon-modal__btn.is-disabled {
    background: #ccc;
    cursor: not-allowed;
}

.tryon-modal__btn--ghost {
    background: none;
    color: #444;
    border: 1px solid #ccc;
}

.tryon-modal__btn--ghost:hover,
.tryon-modal__btn--ghost:focus {
    background: #f0f0f0;
    color: #222;
}

/* ===================== Preview selfie ===================== */
.tryon-preview-wrap {
    margin: 12px 0 0;
}

.tryon-preview-wrap img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

/* ===================== Loading ===================== */
.tryon-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 0;
    gap: 12px;
    color: #666;
    font-size: 14px;
}

.tryon-loading__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: #222;
    border-radius: 50%;
    animation: tryon-spin 0.8s linear infinite;
}

@keyframes tryon-spin {
    to { transform: rotate(360deg); }
}

/* ===================== Vysledek ===================== */
.tryon-result {
    margin-top: 4px;
}

.tryon-result img {
    width: 100%;
    border-radius: 3px;
    display: block;
}

.tryon-result__product {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    background: #f5f0e8;
    border-radius: 3px;
    color: #222;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.tryon-result__product:hover,
.tryon-result__product:focus {
    background: #ece4d6;
    color: #222;
    text-decoration: none;
}

.tryon-result__product-arrow {
    flex-shrink: 0;
    font-size: 16px;
}

.tryon-result__actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.tryon-result__actions .tryon-modal__btn {
    margin-top: 0;
}

/* ===================== Krok navigace ===================== */
.tryon-step {
    display: none;
}

.tryon-step.is-active {
    display: block;
}

/* ===================== Empty state ===================== */
.tryon-empty {
    padding: 24px 0;
    text-align: center;
    color: #888;
    font-size: 14px;
}
