/* ════════════════════════════════════════════════════════════════
   وثائق الضمان — Warranty receipt manager (Google Drive backed)
   ════════════════════════════════════════════════════════════════ */

/* Add/edit modal */
.warranty-modal__file {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.warranty-modal__file img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--c-border);
}
.warranty-pdf-tile {
    width: 100%;
    min-height: 100px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-strong);
    padding: 16px;
}
.warranty-pdf-tile i { font-size: 1.8rem; color: var(--danger-text); }
.warranty-pdf-tile span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-strong);
    text-align: center;
    word-break: break-word;
}
.warranty-pick-btn {
    width: 100%;
    padding: 11px;
    background: var(--c-primary);
    color: var(--c-on-primary);
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--mo-fast) var(--ease-out);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.warranty-pick-btn:active { transform: scale(0.97); }

/* Preview modal */
.warranty-preview { display: flex; flex-direction: column; gap: 14px; }
.warranty-preview__file {
    position: relative;
}
.warranty-preview__file img,
.warranty-preview__img {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    background: var(--c-bg);
    border-radius: 12px;
    cursor: zoom-in;
    -webkit-tap-highlight-color: transparent;
}
.warranty-preview__zoom-hint {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    background: rgba(15,23,42,0.7);
    color: var(--c-on-primary);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    pointer-events: none;
    backdrop-filter: blur(6px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Full-screen image viewer (tap image inside preview to expand) */
.warranty-fullscreen {
    position: fixed;
    inset: 0;
    background: var(--c-text);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    animation: warrantyFullFade 0.2s ease-out;
}
@keyframes warrantyFullFade { from { opacity: 0; } to { opacity: 1; } }
.warranty-fullscreen__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px calc(10px + env(safe-area-inset-top, 0px));
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    /* Functional gradient kept: an image scrim so the white controls stay readable over any photo. */
    background: linear-gradient(180deg, rgba(0,0,0,0.7), transparent);
    z-index: 2;
    color: var(--c-on-primary);
}
.warranty-fullscreen__title {
    font-size: 0.95rem;
    font-weight: 800;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    unicode-bidi: plaintext;   
}
/* the × is the shared .btn-close; this class stays as the JS hook (warranty/files.js) */
.warranty-fullscreen__img {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    /* Allow native pinch-zoom on touch devices */
    touch-action: pinch-zoom;
}
.warranty-fullscreen__bottombar {
    display: flex;
    gap: 10px;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    /* Functional gradient kept: image scrim (see the top bar). */
    background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent);
    z-index: 2;
}
.warranty-fullscreen__btn {
    flex: 1;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--c-on-primary);
    font-family: inherit;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 11px 16px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--mo-fast) var(--ease-out), background-color var(--mo-fast) var(--ease-out);
}
.warranty-fullscreen__btn:active { transform: scale(0.96); background: rgba(255,255,255,0.28); }
.warranty-preview__meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.warranty-preview__meta > div {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.warranty-preview__meta span {
    font-size: 0.62rem;
    color: var(--text-faint);
    font-weight: 700;
}
.warranty-preview__meta strong {
    font-size: 0.82rem;
    color: var(--text-main);
    font-weight: 800;
}
.warranty-preview__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

