/**
 * Robnety Pakalpojumi — Elementor Widgets CSS
 *
 * Stili abiem Elementor widgets:
 *  1) .robnety-sidebar-widget  — Sidebar widget
 *  2) .robnety-services-grid-wrap — Services Grid widget
 */

/* ══════════════════════════════════════════════════════════
   SIDEBAR WIDGET
   ══════════════════════════════════════════════════════════ */

.robnety-sidebar-widget {
    box-sizing: border-box;
    overflow: hidden;
}

/* Header bloks — atsevišķs fons (kā WooCommerce sidebar stilā) */
.robnety-sidebar-header {
    padding: 14px 20px;
    background-color: #f5f5f5;
}

.robnety-sidebar-header.has-divider {
    border-bottom: 2px solid #e0e0e0;
}

/* Satura bloks */
.robnety-sidebar-body {
    padding: 16px 20px 20px;
    background-color: #ffffff;
}

.robnety-sidebar-title {
    margin: 0;
    line-height: 1.3;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Saraksts */
.robnety-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.robnety-sidebar-item {
    display: flex;
    align-items: center;
}

/* Atdalītājs */
.robnety-sidebar-widget.has-item-dividers .robnety-sidebar-item {
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 8px;
}
.robnety-sidebar-widget.has-item-dividers .robnety-sidebar-item:last-child {
    border-bottom: none;
}

/* Grid izkārtojums */
.robnety-sidebar-grid {
    display: grid !important;
}
.robnety-sidebar-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.robnety-sidebar-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.robnety-sidebar-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Label (checkbox/radio mode) */
.robnety-sidebar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
    transition: color 0.2s;
}

.robnety-sidebar-input {
    flex-shrink: 0;
    cursor: pointer;
}

.robnety-sidebar-label-text {
    flex: 1;
    line-height: 1.4;
}

/* Saite (links mode) */
.robnety-sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-decoration: none;
    transition: color 0.2s;
}

.robnety-sidebar-link:hover {
    text-decoration: none;
}

/* Sīkbilde */
.robnety-sidebar-thumb {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Cenas teksts sidebar */
.robnety-sidebar-price {
    font-size: 0.85em;
    opacity: 0.75;
    margin-left: 4px;
}

/* Skaita badge */
.robnety-sidebar-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    margin-left: auto;
    flex-shrink: 0;
}

/* Pills izkārtojums */
.robnety-sidebar-layout-pills .robnety-sidebar-pills-wrap {
    display: flex;
    flex-wrap: wrap;
}

.robnety-sidebar-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    user-select: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
}

.robnety-sidebar-pill input[type="checkbox"],
.robnety-sidebar-pill input[type="radio"] {
    display: none;
}

/* Aktīvais elements */
.robnety-sidebar-item.is-active .robnety-sidebar-label {
    font-weight: 600;
}

/* Arhīva saite */
.robnety-sidebar-archive {
    border-top: 1px solid #e8e8e8;
    padding-top: 12px;
}

.robnety-sidebar-archive-link {
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.robnety-sidebar-archive-link:hover {
    text-decoration: underline;
}


/* ══════════════════════════════════════════════════════════
   SERVICES GRID WIDGET
   ══════════════════════════════════════════════════════════ */

.robnety-services-grid-wrap {
    box-sizing: border-box;
}

/* Grid */
.robnety-services-grid {
    display: grid;
    grid-template-columns: repeat(var(--rsg-cols, 3), 1fr);
    width: 100%;
}

/* Vienāds augstums */
.robnety-services-grid-wrap.equal-height .robnety-services-grid {
    align-items: stretch;
}
.robnety-services-grid-wrap.equal-height .rsg-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.robnety-services-grid-wrap.equal-height .rsg-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.robnety-services-grid-wrap.equal-height .rsg-cta-wrap {
    margin-top: auto;
    padding-top: 16px;
}

/* Karte */
.rsg-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background-color: #fff;
}

.rsg-card * {
    box-sizing: border-box;
}

/* Attēls */
.rsg-image-wrap {
    display: block;
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f0f0f0;
}

.rsg-image-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: transparent;
    transition: background-color 0.25s ease;
    pointer-events: none;
}

.rsg-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.rsg-card:hover .rsg-image-wrap img {
    transform: scale(1.04);
}

/* Padding-bottom triksts proporcijas saglabāšanai */
.rsg-image-wrap:not(.rsg-horiz-image-wrap) {
    padding-bottom: 60%; /* Noklusējums, pārrakstīts ar selektoru */
    height: 0;
}
.rsg-image-wrap.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    padding-bottom: 60%;
}
.rsg-image-wrap.no-image .dashicons {
    position: absolute;
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #bbb;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Kartes saturs */
.rsg-card-body {
    padding: 24px;
}

/* Kategorijas badge */
.rsg-category-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    background-color: #f0f5ff;
    color: #0073aa;
    border-radius: 4px;
}

/* Nosaukums */
.rsg-title {
    margin: 0 0 10px;
    line-height: 1.3;
}
.rsg-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}
.rsg-title a:hover {
    text-decoration: none;
}

/* Apraksts */
.rsg-excerpt {
    margin: 0 0 14px;
    line-height: 1.6;
}

/* Meta info */
.rsg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 14px;
}

.rsg-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.rsg-meta-item .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.rsg-price {
    font-weight: 700;
}

/* CTA poga */
.rsg-cta-wrap {
    display: flex;
    flex-direction: column;
}

.rsg-cta-btn {
    display: inline-block;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    cursor: pointer;
    line-height: 1.4;
    white-space: nowrap;
    border: 1px solid transparent;
}

.rsg-cta-btn:hover {
    text-decoration: none;
}

/* Nav rezultātu */
.rsg-no-results {
    text-align: center;
    padding: 32px;
    color: #777;
    width: 100%;
}

/* ─── Kartes stils: Overlay ──────────────────────────── */

.rsg-card.rsg-card-style-overlay {
    min-height: 260px;
}

.rsg-overlay-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    min-height: 260px;
    overflow: hidden;
}

.rsg-overlay-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #333;
    transition: transform 0.35s ease;
}

.rsg-overlay-link:hover .rsg-overlay-bg {
    transform: scale(1.04);
}

.rsg-overlay-content {
    position: relative;
    z-index: 2;
    padding: 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 60%);
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #fff;
}

.rsg-card-style-overlay .rsg-category-badge {
    background-color: rgba(255,255,255,0.2);
    color: #fff;
    margin-bottom: 8px;
}

.rsg-card-style-overlay .rsg-title {
    color: #fff;
    margin-bottom: 6px;
}

.rsg-card-style-overlay .rsg-price {
    color: rgba(255,255,255,0.9);
}

/* ─── Kartes stils: Horizontāls ─────────────────────── */

.rsg-card.rsg-card-style-horizontal {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.rsg-horiz-image-wrap {
    display: block;
    flex: 0 0 35%;
    max-width: 35%;
    overflow: hidden;
    position: relative;
}

.rsg-horiz-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.35s ease;
}

.rsg-card.rsg-card-style-horizontal:hover .rsg-horiz-image-wrap img {
    transform: scale(1.04);
}

.rsg-card.rsg-card-style-horizontal .rsg-card-body {
    flex: 1;
}

/* ─── Kartes stils: Minimāls / Icon ─────────────────── */

.rsg-card.rsg-card-style-minimal .rsg-card-body,
.rsg-card.rsg-card-style-icon .rsg-card-body {
    padding: 24px;
}

/* ══════════════════════════════════════════════════════════
   FILTRĒŠANAS JOSLA
   ══════════════════════════════════════════════════════════ */

.rsg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.rsg-filter-btn {
    display: inline-block;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    padding: 8px 18px;
    border-radius: 4px;
}

.rsg-filter-btn:hover,
.rsg-filter-btn.is-active {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* ══════════════════════════════════════════════════════════
   JS FILTRĒŠANAS ANIMĀCIJAS
   ══════════════════════════════════════════════════════════ */

/* Fade animācija */
.robnety-services-grid-wrap[data-animation="fade"] .rsg-card {
    transition: opacity 0.3s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.robnety-services-grid-wrap[data-animation="fade"] .rsg-card.rsg-hidden {
    display: none;
}

/* Slide animācija */
.robnety-services-grid-wrap[data-animation="slide"] .rsg-card.rsg-hidden {
    display: none;
}

/* ══════════════════════════════════════════════════════════
   RESPONSĪVS DIZAINS
   ══════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .robnety-services-grid {
        grid-template-columns: repeat(
            min(var(--rsg-cols, 3), 2),
            1fr
        );
    }
}

@media (max-width: 767px) {
    .robnety-services-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .rsg-card.rsg-card-style-horizontal {
        flex-direction: column;
    }
    .rsg-horiz-image-wrap {
        flex: unset;
        max-width: 100%;
        height: 200px;
        position: relative;
    }
    .rsg-horiz-image-wrap img {
        position: absolute;
    }

    .robnety-sidebar-grid-cols-2,
    .robnety-sidebar-grid-cols-3,
    .robnety-sidebar-grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .robnety-sidebar-grid-cols-2,
    .robnety-sidebar-grid-cols-3,
    .robnety-sidebar-grid-cols-4 {
        grid-template-columns: 1fr;
    }
}
