/*
Theme Name:     Magnetique Child
Theme URI:      https://themeforest.net/user/firstsight_design
Description:    Child theme dla Magnetique — własne tłumaczenia i poprawki, które przeżyją aktualizacje motywu.
Author:         Renata Dziedzicka
Template:       magnetique
Version:        1.0.2
Text Domain:    magnetique-child
*/

/* ==========================================================================
   SIDEBAR KURSU — oba przyciski (Kup teraz + Dodaj do koszyka) pełna szerokość
   ========================================================================== */
.art-course-single-sidebar .art-course-enroll-button,
.art-course-single-sidebar .art-course-enroll-button form,
.art-course-single-sidebar .art-course-enroll-button form button,
.art-course-single-sidebar .art-course-enroll-button .lp-button,
.art-course-single-sidebar .wrap-btn-add-course-to-cart,
.art-course-single-sidebar .wrap-btn-add-course-to-cart form,
.art-course-single-sidebar .wrap-btn-add-course-to-cart form button,
.art-course-single-sidebar .btn-add-course-to-cart,
.art-course-single-sidebar .lp-course-buttons,
.art-course-single-sidebar .lp-course-buttons form,
.art-course-single-sidebar .lp-course-buttons form button {
    width: 100%;
    display: block;
}

/* Drobny odstęp między KUP TERAZ a DODAJ DO KOSZYKA w sidebarze */
.art-course-single-sidebar .lp-course-buttons > * + *,
.art-course-single-sidebar .art-course-enroll-button > * + *,
.art-course-single-sidebar .wrap-btn-add-course-to-cart {
    margin-top: 10px;
}


/* ==========================================================================
   POZOSTAŁE KURSY — ukryj sekcję jeśli jest tylko 1 kurs (lub żaden)
   ========================================================================== */
/* LearnPress 4.3.6 renderuje sekcję "Pozostałe Kursy" przez
   ListCoursesRelatedTemplate. Wrapper: .lp-list-courses-related,
   wewnątrz lista: .lp-courses-related (UL), elementy: LI.
   Ładowane przez AJAX, ale wrapper jest w DOM od razu. */

/* Ukryj kontener jeśli lista ma tylko 1 element */
.lp-list-courses-related:has(.lp-courses-related > li:only-child) {
    display: none;
}

/* Ukryj kontener jeśli listy w ogóle nie ma (0 wyników z AJAX) */
.lp-list-courses-related:not(:has(.lp-courses-related li)) {
    display: none;
}

/* Dodaj odstęp od stopki gdy sekcja jest ukryta */
.lp-list-courses-related:has(.lp-courses-related > li:only-child),
.lp-list-courses-related:not(:has(.lp-courses-related li)) {
    margin-bottom: 80px;
}

@media (max-width: 767px) {
    .lp-list-courses-related:has(.lp-courses-related > li:only-child),
    .lp-list-courses-related:not(:has(.lp-courses-related li)) {
        margin-bottom: 40px;
    }
}

/* Zachowuję też stare reguły na wypadek gdyby motyw używał własnego template
   (template-parts/single-course.php → .art-recent-events-section) */
.art-recent-events-section:has(.art-courses-list > :only-child),
.art-recent-events-section:not(:has(.art-courses-list)) {
    display: none;
}


/* ==========================================================================
   HEADER KURSU (desktop / topbar) — KUP TERAZ + DODAJ DO KOSZYKA obok siebie
   ========================================================================== */
@media (min-width: 768px) {
    .art-course-header-right .art-course-enroll-button .lp-course-buttons,
    .art-course-header-right .lp-course-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: stretch;
    }

    .art-course-header-right .lp-course-buttons > form,
    .art-course-header-right .lp-course-buttons > .wrap-btn-add-course-to-cart {
        margin: 0;
        display: inline-flex;
    }

    .art-course-header-right .lp-course-buttons form button,
    .art-course-header-right .btn-add-course-to-cart {
        width: auto;
    }
}
