/**
 * RURIS Rezervni Delovi - Frontend Stilovi
 * Specijalno optimizovano za NEVE temu (rurissrbija.rs)
 */

.ruris-parts-wrapper {
    font-family: inherit;
    color: inherit;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 0;
    box-sizing: border-box;
}

.ruris-parts-wrapper * {
    box-sizing: border-box;
}

/* KATALOG / GRID UREĐAJA */
.ruris-cat-header {
    margin-bottom: 25px;
    text-align: center;
}
.ruris-cat-title {
    font-family: inherit;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: inherit;
}
.ruris-cat-subtitle {
    font-family: inherit;
    opacity: 0.85;
    margin: 0 0 20px 0;
}
.ruris-filter-bar {
    display: flex;
    gap: 12px;
    max-width: 750px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.ruris-input-search {
    flex: 2;
    min-width: 240px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    background: #fff;
    color: inherit;
}
.ruris-select-cat {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: inherit;
    cursor: pointer;
}

/* GRID KARTICA UREĐAJA */
.ruris-devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 25px;
}
.ruris-device-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}
.ruris-device-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}
.ruris-device-thumb {
    height: 180px;
    background: rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.ruris-device-thumb img {
    max-height: 160px;
    max-width: 90%;
    object-fit: contain;
}
.ruris-thumb-placeholder {
    font-size: 18px;
    font-weight: 700;
    opacity: 0.5;
}
.ruris-device-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.ruris-device-name {
    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: inherit;
}
.ruris-btn-open-catalog {
    margin-top: auto;
    display: block;
    text-align: center;
    font-family: inherit;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 6px;
    text-decoration: none !important;
}

/* POJEDINAČNI UREĐAJ I ŠEMA */
.ruris-single-catalog {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 24px;
}
.ruris-catalog-nav {
    margin-bottom: 15px;
}
.ruris-back-link {
    font-family: inherit;
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}
.ruris-back-link:hover {
    background: rgba(0, 0, 0, 0.1);
}
.ruris-device-main-title {
    font-family: inherit;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: inherit;
}
.ruris-device-lead {
    font-family: inherit;
    opacity: 0.85;
    margin: 0 0 20px 0;
}

/* TABOVI SKLOPOVA */
.ruris-sections-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.ruris-section-tab-btn {
    padding: 10px 18px;
    font-weight: 700;
    cursor: pointer;
}

/* CONTAINER ŠEME */
.ruris-diagram-container {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: center;
}
.ruris-diagram-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}
.ruris-diagram-tip {
    font-size: 13px;
    opacity: 0.8;
}
.ruris-zoom-fullscreen-btn {
    font-family: inherit;
    text-decoration: none !important;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    background: #1e293b;
    color: #fff !important;
    cursor: pointer;
}
.ruris-diagram-image-wrapper {
    max-height: 550px;
    overflow: auto;
    background: #fff;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ruris-diagram-img {
    max-width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
}

/* KONTROLE TABELE DELOVA */
.ruris-table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.ruris-table-search-box input {
    width: 320px;
    max-width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: inherit;
}
.ruris-legend {
    font-size: 13px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 14px;
}
.ruris-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}
.dot-green { background: #16a34a; box-shadow: 0 0 6px rgba(22, 163, 74, 0.4); }
.dot-red { background: #dc2626; box-shadow: 0 0 6px rgba(220, 38, 38, 0.4); }

/* TABELA DELOVA (DESKTOP) */
.ruris-parts-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ruris-parts-display-table {
    width: 100%;
    border-collapse: collapse;
    font-family: inherit;
    font-size: 14px;
}
.ruris-parts-display-table th {
    background: rgba(0, 0, 0, 0.03);
    color: inherit;
    font-weight: 700;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}
.ruris-parts-display-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    vertical-align: middle;
}
.ruris-parts-display-table tr:hover {
    background: rgba(0, 0, 0, 0.02);
}
.col-pos { width: 65px; text-align: center; }
.ruris-pos-badge {
    background: #0f172a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 13px;
}
.ruris-sku-code {
    font-family: monospace;
    font-weight: 700;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.05);
    padding: 3px 6px;
    border-radius: 4px;
}
.ruris-alt-badge {
    font-size: 11px;
    color: #16a34a;
    margin-top: 4px;
    background: #f0fdf4;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #bbf7d0;
    display: inline-block;
}
.ruris-part-title {
    font-size: 14px;
    font-weight: 600;
}

/* SEMAFOR STATUSI */
.ruris-stock-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 20px;
}
.ruris-status-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.stock-green {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.stock-green .ruris-status-bullet { background: #16a34a; }
.stock-red {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.stock-red .ruris-status-bullet { background: #dc2626; }

.ruris-price-tag {
    font-weight: 700;
    font-size: 15px;
}
.ruris-no-price {
    opacity: 0.5;
}

.ruris-btn-cart, .ruris-btn-inquiry {
    font-family: inherit;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none !important;
    display: inline-block;
}

.ruris-mobile-label {
    display: none;
}

/* LIGHTBOX PROZOR ZA ŠEMU */
.ruris-lightbox-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    padding: 20px;
}
.ruris-lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
}
.ruris-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}
.ruris-lightbox-close {
    position: absolute;
    top: -35px; right: 0;
    background: none; border: none;
    color: #fff; font-size: 32px;
    cursor: pointer;
}

/* =========================================================================
 * NEPROBOJNI MOBILNI PRIKAZ ZA NEVE TEMU (< 960px)
 * Razbija sve Neve i WooCommerce .entry-content table-cell fiksacije
 * ========================================================================= */
@media screen and (max-width: 960px) {

    .neve-theme .ruris-parts-wrapper,
    .nv-content-wrap .ruris-parts-wrapper,
    .entry-content .ruris-parts-wrapper,
    .ruris-parts-wrapper {
        padding: 5px !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .ruris-single-catalog {
        padding: 10px !important;
        border: none !important;
        background: transparent !important;
    }

    /* 1. Sakrij zaglavlje tabele na telefonu */
    .ruris-parts-display-table thead,
    .ruris-parts-display-table thead tr,
    .ruris-parts-display-table thead th,
    .entry-content table.ruris-parts-display-table thead {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    /* 2. Razbij tabelu u čiste blokove */
    .ruris-parts-table-responsive,
    .entry-content .ruris-parts-table-responsive,
    table.ruris-parts-display-table,
    .entry-content table.ruris-parts-display-table,
    table.ruris-parts-display-table tbody,
    .entry-content table.ruris-parts-display-table tbody {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 3. Svaki red postaje samostalna bela kartica */
    table.ruris-parts-display-table tr.ruris-part-row,
    .entry-content table.ruris-parts-display-table tr.ruris-part-row {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 10px !important;
        margin: 0 0 14px 0 !important;
        padding: 14px 16px !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
        box-sizing: border-box !important;
        clear: both !important;
    }

    /* 4. Ćelije unutar kartice postaju vertikalne linije (NE vodoravne ćelije) */
    table.ruris-parts-display-table tr.ruris-part-row td,
    .entry-content table.ruris-parts-display-table tr.ruris-part-row td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 4px 0 !important;
        border: none !important;
        text-align: left !important;
        box-sizing: border-box !important;
        float: none !important;
    }

    /* Pozicija na vrhu kartice */
    table.ruris-parts-display-table tr.ruris-part-row td.col-pos {
        display: inline-block !important;
        width: auto !important;
        margin-bottom: 6px !important;
        padding: 0 !important;
    }
    .ruris-pos-badge {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
    }

    /* Naziv dela - krupno i čitljivo */
    table.ruris-parts-display-table tr.ruris-part-row td.col-name {
        display: block !important;
        padding: 2px 0 8px 0 !important;
        border-bottom: 1px solid #f1f5f9 !important;
        margin-bottom: 8px !important;
    }
    .ruris-part-title {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        line-height: 1.35 !important;
        display: block !important;
    }
    table.ruris-parts-display-table tr.ruris-part-row td.col-name .ruris-mobile-label {
        display: none !important;
    }

    /* Šifra dela u kartici */
    table.ruris-parts-display-table tr.ruris-part-row td.col-sku {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 4px 0 !important;
    }

    /* Status zaliha u kartici */
    table.ruris-parts-display-table tr.ruris-part-row td.col-stock {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 6px 0 !important;
    }

    /* Cena dela u kartici */
    table.ruris-parts-display-table tr.ruris-part-row td.col-price {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 6px 0 !important;
    }
    .ruris-price-tag {
        font-size: 17px !important;
        font-weight: 800 !important;
        color: #0f172a !important;
    }

    /* Oznake (Šifra:, Status:, Cena:) */
    .ruris-mobile-label {
        display: inline-block !important;
        font-size: 13px !important;
        opacity: 0.65 !important;
        font-weight: 600 !important;
    }

    /* Dugme preko cele širine (46px visina za lak dodir prstom) */
    table.ruris-parts-display-table tr.ruris-part-row td.col-action {
        display: block !important;
        width: 100% !important;
        padding: 12px 0 0 0 !important;
        margin-top: 8px !important;
        border-top: 1px dashed #e2e8f0 !important;
    }

    .ruris-parts-display-table td.col-action .button,
    .ruris-parts-display-table td.col-action a.button,
    .ruris-parts-display-table td.col-action button {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 12px 16px !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        border-radius: 6px !important;
        box-sizing: border-box !important;
        line-height: 1.4 !important;
    }

    .ruris-table-search-box input {
        width: 100% !important;
    }
}