/**
 * Stranica: Garancija i servisni uslovi
 * PDF pregled + široke tabele — optimizacija za tablet i mobilni
 */

.service-page {
    padding-bottom: env(safe-area-inset-bottom);
}

.service-page .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}

.service-breadcrumbs {
    padding-top: 8px;
}

.service-page-title {
    margin-bottom: 16px;
}

.service-content {
    color: var(--gray-700);
    line-height: 1.75;
    font-size: 0.95rem;
}

.service-content > p {
    margin-bottom: 1rem;
}

.service-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}

.service-content b {
    font-weight: 700;
    color: var(--gray-900);
}

/* ----- PDF pregled ----- */
.service-pdf-section {
    margin-top: 1.75rem;
}

.service-pdf-wrapper {
    position: relative;
    width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
    box-shadow: var(--box-shadow);
}

.service-pdf-wrapper .service-pdf-iframe {
    display: block;
    width: 100%;
    height: min(72vh, 720px);
    min-height: 420px;
    border: 0;
}

/* PDF.js (canvas) — podrazumevano sakriven; na užem ekranu umesto iframe-a */
.service-pdf-js {
    display: none;
    background: var(--white);
}

.service-pdf-pages {
    line-height: 0;
}

.service-pdf-page-canvas {
    display: block;
    width: 100%;
    height: auto;
}

.service-pdf-page-canvas + .service-pdf-page-canvas {
    margin-top: 10px;
}

.service-pdf-js-status {
    margin: 0;
    padding: 14px 12px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--gray-600);
    line-height: 1.45;
}

.service-pdf-embed-footer {
    padding: 12px 16px;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.service-pdf-open-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.service-pdf-open-link:hover {
    text-decoration: underline;
}

.service-download-wrap {
    margin-top: 1.5rem;
}

.service-download-wrap .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 22px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    touch-action: manipulation;
}

.service-download-wrap .btn-primary i {
    font-size: 0.95rem;
}

/* ----- Naslovi sekcija ----- */
.service-section-heading {
    margin-top: 1.75rem;
    margin-bottom: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.35;
}

/* ----- Tabela garancije (horizontalni skrol na užim ekranima) ----- */
.service-table-scroll {
    margin-top: 4px;
}

.table-scroll-hint {
    display: none;
    margin: 0 0 10px;
    font-size: 0.78rem;
    color: var(--gray-600);
    align-items: center;
    gap: 8px;
}

.table-scroll-hint i {
    color: var(--primary);
    flex-shrink: 0;
}

.warranty-terms-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: none;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    background: var(--white);
    box-shadow: inset 0 -1px 0 var(--gray-100);
}

.warranty-terms-wrap::-webkit-scrollbar {
    height: 8px;
}

.warranty-terms-wrap::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

.warranty-terms-wrap::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.warranty-terms-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    background: var(--white);
    font-size: 0.88rem;
}

.warranty-terms-table th,
.warranty-terms-table td {
    border: 1px solid var(--gray-300);
    padding: 10px 12px;
    vertical-align: top;
    text-align: left;
    hyphens: auto;
    overflow-wrap: break-word;
    word-break: break-word;
}

.warranty-terms-table thead th {
    background: var(--gray-200);
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--gray-900);
    white-space: nowrap;
}

.warranty-terms-table tbody tr:nth-child(odd) {
    background: var(--white);
}

.warranty-terms-table tbody tr:nth-child(even) {
    background: var(--gray-100);
}

.warranty-terms-table tbody td:first-child {
    font-weight: 600;
    white-space: nowrap;
    color: var(--gray-800);
}

.service-footnote {
    margin-top: 14px;
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.55;
    padding: 12px 14px;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary);
}

.service-contact-block {
    margin-top: 8px;
}

.service-contact-block p {
    margin: 0;
    line-height: 1.65;
}

.service-contact-block a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.service-contact-block a:hover {
    text-decoration: underline;
}

/* ===== Tablet ===== */
@media (max-width: 1024px) {
    .service-page.section {
        padding-top: 24px;
        padding-bottom: 36px;
    }

    .service-content {
        font-size: 0.92rem;
    }

    .service-pdf-wrapper .service-pdf-iframe {
        display: none !important;
    }

    .service-pdf-js {
        display: block;
        min-height: 220px;
    }

    .warranty-terms-table {
        font-size: 0.84rem;
    }

    .warranty-terms-table th,
    .warranty-terms-table td {
        padding: 9px 10px;
    }
}

/* ===== Mobilni ===== */
@media (max-width: 768px) {
    .service-breadcrumbs {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        mask-image: linear-gradient(to right, #000 92%, transparent);
        padding-bottom: 6px;
    }

    .service-breadcrumbs::-webkit-scrollbar {
        display: none;
    }

    .service-page-title {
        font-size: clamp(1.35rem, 5vw, 1.55rem);
        line-height: 1.25;
    }

    .service-content > p {
        margin-bottom: 0.95rem;
    }

    .service-section-heading {
        font-size: 1.05rem;
        margin-top: 1.5rem;
    }

    .table-scroll-hint {
        display: flex;
        flex-wrap: wrap;
    }

    .warranty-terms-wrap {
        border-radius: var(--border-radius-sm);
        margin-left: -2px;
        margin-right: -2px;
        width: calc(100% + 4px);
    }

    .warranty-terms-table {
        font-size: 0.78rem;
        min-width: 980px;
    }

    .warranty-terms-table th,
    .warranty-terms-table td {
        padding: 8px 8px;
    }

    .warranty-terms-table thead th {
        font-size: 0.72rem;
        padding: 10px 8px;
    }

    .service-footnote {
        font-size: 0.85rem;
        padding: 12px;
    }
}

@media (max-width: 380px) {
    .warranty-terms-table {
        font-size: 0.72rem;
        min-width: 920px;
    }
}
