/*!
 * Общие стили для страниц attestatsiya
 * Используется во всех файлах папки attestatsiya
 */

/* === Стили для корзины === */
.add-to-cart-form button.in-cart {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.add-to-cart-form button:disabled {
    cursor: not-allowed;
    opacity: 0.8;
    display: flex;
    gap: 15px;
    color: #000;
    text-align: left;
}

.add-to-cart-form button.in-cart svg {
    stroke: white;
}

/* Стили для активной кнопки добавления в корзину */
.add-to-cart-form button.btn-add-to-cart {
    width: 100%;
    padding: 15px;
    background: #38bff2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.3s;
}

.add-to-cart-form button.btn-add-to-cart svg {
    stroke: #fff;
}

.add-to-cart-form button.btn-add-to-cart:hover {
    background: #2aa8d6;
}

/* === Стили для кнопок в таблицах и карточках курсов === */
.courses-table .add-to-cart-form button,
.course-card .add-to-cart-form button {
    width: auto;
    padding: 8px 12px;
    background: #38bff2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.3s;
    min-width: 120px;
}

.courses-table .add-to-cart-form button:hover,
.course-card .add-to-cart-form button:hover {
    background: #2aa8d6;
}

.courses-table .add-to-cart-form button.in-cart,
.course-card .add-to-cart-form button.in-cart {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    cursor: not-allowed;
    opacity: 0.7;
    gap: 8px;
}

.courses-table .add-to-cart-form button:disabled,
.course-card .add-to-cart-form button:disabled {
    cursor: not-allowed;
    opacity: 0.8;
    display: flex;
    gap: 8px;
    color: white;
    text-align: left;
}

.courses-table .add-to-cart-form button.in-cart svg,
.course-card .add-to-cart-form button.in-cart svg {
    stroke: white;
}

/* === Стили для курсов === */
.course-row {
    transition: background-color 0.3s ease;
}

.course-row:hover {
    background-color: #f8f9fa;
}


.course-available {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    border-radius: 5px;
}

.course-in-cart {
    background: #28a74545;
    color: #2c3e50;
    border: 1px solid #28a745;
    padding: 2px 12px;
    line-height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
}

/* === Стили для таблиц курсов === */
.courses-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.courses-table th,
.courses-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.courses-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.courses-table a {
    color: #38bff2;
    text-decoration: none;
}

.courses-table a:hover {
    text-decoration: underline;
}

/* === Стили для мобильных карточек === */
.course-card {
    background: white;
    border: none;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0;
    padding: 20px;
    transition: background-color 0.3s ease;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-meta {
    text-align: right;
}

.card-price-cart {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.card-body {
    margin-bottom: 12px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.875rem;
}

/* === Дополнительные стили для мобильных карточек === */
.mobile-courses {
    display: none;
}

.card-header>div:first-child {
    flex: 1;
}

.card-header a {
    color: #38bff2;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    display: block;
    margin-bottom: 5px;
}

.card-header a:hover {
    text-decoration: underline;
}

.course-code {
    color: #666;
    font-size: 0.875rem;
}

.course-relevance span {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 8px;
}

.mobile-courses .course-name {
    color: #333;
    text-decoration: none;
    line-height: 1.4;
    display: block;
    margin-bottom: 12px;
    font-size: 1rem;
}

.mobile-courses .course-name:hover {
    color: #38bff2;
    text-decoration: underline;
}

/* === Стили для новой структуры мобильных карточек === */
.mobile-card-top {
    margin-bottom: 12px;
}

.mobile-card-title {
    margin-bottom: 8px;
}

.mobile-card-title a {
    color: #38bff2;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    display: inline-block;
}

.mobile-card-title .course-code {
    color: #666;
    font-size: 0.875rem;
    margin-left: 8px;
}

.mobile-courses .course-name {
    text-align: left;
    display: block;
    margin-bottom: 8px;
}

.mobile-card-details {
    margin-bottom: 8px;
}

.mobile-card-year {
    margin-bottom: 8px;
}

.mobile-card-year span {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}

.mobile-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.mobile-card-bottom .course-price {
    font-size: 1.2rem;
    color: #2aa8d6;
    font-weight: 600;
    white-space: nowrap;
}

.mobile-card-bottom .course-price-note {
    font-size: 0.75rem;
    color: #666;
}

.mobile-card-bottom .add-to-cart-form {
    display: inline;
}

.mobile-card-bottom .add-to-cart-form button {
    background: #38bff2;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
}

.mobile-card-bottom .add-to-cart-form button svg {
    stroke: #fff;
}

/* === Стили для кнопок === */
.btn-add-to-cart {
    width: 100%;
    padding: 15px;
    background: #38bff2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.3s;
}

.btn-add-to-cart:hover {
    background: #2aa8d6;
}

.btn-go-to-cart {
    display: block;
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 10px;
    transition: background 0.3s;
}

.btn-go-to-cart:hover {
    background: #218838;
    color: white;
}

.btn-remove-from-cart {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 15px;
}

.btn-remove-from-cart:hover {
    background: #dc3545;
    color: white;
}

/* === Стили для цен в таблицах (десктоп) === */
.courses-table .course-price {
    font-weight: 600;
    color: #38bff2;
    font-size: 1.1rem;
}

.courses-table .course-price-note {
    font-size: 0.8rem;
    color: #666;
    font-weight: normal;
}

/* === Стили для хлебных крошек === */
.breadcrumb {
    margin-bottom: 20px;
    color: #666;
}

.breadcrumb a {
    color: #38bff2;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* === Стили для аккордеона === */
.accordion-group {
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.accordion-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-toggle {
    font-size: 1.5rem;
    font-weight: bold;
    color: #38bff2;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* === Адаптивные стили === */
@media (max-width: 768px) {
    .desktop-courses {
        display: none !important;
    }

    .mobile-courses {
        display: block !important;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .card-meta {
        align-items: flex-start;
        width: 100%;
    }

    .card-price-cart {
        justify-content: space-between;
        width: 100%;
    }
}

@media (min-width: 769px) {
    .desktop-courses {
        display: block !important;
    }

    .mobile-courses {
        display: none !important;
    }
}

/* === Стили для страницы курса === */
.course-page .course-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    margin-top: 30px;
}

.course-header {
    margin-bottom: 30px;
}

.course-title-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    flex-direction: column;
}

.course-title {
    font-size: 30px;
    color: #333;
    line-height: 31px;
    margin: 0;
}

.course-meta {
    display: flex;
    gap: 20px;
    color: #666;
}

.course-description,
.course-specs {
    margin-bottom: 30px;
}

.course-description h3,
.course-specs h3 {
    margin-bottom: 15px;
    color: #333;
}

.specs-grid {
    display: grid;
    gap: 10px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.spec-label {
    color: #666;
}

.spec-value {
    font-weight: 500;
    color: #333;
}

.status-available {
    color: #28a745;
    font-weight: 600;
}

.status-in-cart {
    color: #28a745;
    font-weight: 600;
}

.purchase-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    position: sticky;
    top: 20px;
}

.price-block {
    text-align: center;
    margin-bottom: 20px;
}

.price {
    font-size: 2rem;
    font-weight: bold;
    color: #38bff2;
    line-height: 1.3;
}

.cart-status {
    text-align: center;
}

.in-cart-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
    background: #28a74545;
    color: #2c3e50;
    border: 1px solid #28a745;
}

.course-features {
    margin-top: 0;
    margin-bottom: 0;
    padding: 20px 10px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
}

.feature-icon {
    color: #28a745;
    font-weight: bold;
}

/* === Адаптивные стили для страницы курса === */
@media (max-width: 768px) {
    .course-page .course-content {
        grid-template-columns: 1fr;
    }

    .course-meta {
        flex-direction: column;
        gap: 5px;
    }

    .course-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* === Запрет переноса строки для текста в корзине === */
.in_cart_text {
    white-space: nowrap;
}

/* Старые курсы (без edu_courses) */
.course-legacy-badge,
.course-badge.course-legacy {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    color: #8a5a00;
    background: #fff3cd;
    border: 1px solid #ffecb5;
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}

.course-legacy-link {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    color: #4b77b9;
    text-decoration: underline;
    white-space: nowrap;
}

.course-legacy-link:hover {
    color: #2aa8d6;
}

.course-title-wrapper .course-badge.course-legacy {
    margin-left: 0;
}

/* === Поиск + фильтр по году (index) === */
.search-container .search-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.search-container .search-input-wrapper {
    position: relative;
    flex: 1 1 320px;
    max-width: 600px;
    margin: 0;
}

.search-container .search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa0a6;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 0;
}

.search-container .search-icon svg {
    display: block;
    width: 22px;
    height: 22px;
}

.year-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.year-filter-tag {
    display: inline-flex;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.year-filter-tag input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.year-filter-tag span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 52px;
    padding: 0 18px;
    background: #28a745;
    color: #fff;
    border-radius: 8px;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1;
    opacity: 0.45;
    transition: opacity 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.2);
}

.year-filter-tag:hover span {
    opacity: 0.7;
}

.year-filter-tag.is-active span,
.year-filter-tag input:checked + span {
    opacity: 1;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.35);
}

@media (max-width: 768px) {
    .search-container .search-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .year-filter {
        justify-content: center;
    }

    .search-container .search-input-wrapper {
        max-width: none;
    }
}