/* === Файл: discounts-style.css === */

/* === ИЗМЕНЕНИЕ: Добавляем CSS-переменную для шрифта === */
:root {
    --main-font-family: 'Rubik', sans-serif;
}

/* --- Стили для таблицы скидок --- */
.bagon-pa-discounts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-family: var(--main-font-family);
}

/* Скрываем заголовки таблицы, так как они теперь не нужны */
.bagon-pa-discounts-table thead {
    display: none;
}

/* Каждая строка теперь выглядит как отдельная карточка */
.bagon-pa-discounts-table tr {
    display: block;
    margin-bottom: 20px;
    border-radius: 8px;
    background: #2d2d2d;
    border: 1px solid #4a4a4a;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.bagon-pa-discounts-table tbody tr:hover {
    background-color: #383838;
}

/* Каждая ячейка - это строка внутри карточки */
.bagon-pa-discounts-table td {
    display: block;
    text-align: right;
    padding: 12px 15px; /* Увеличены отступы */
    border-bottom: 1px solid #3a3a3a;
    position: relative;
    overflow-wrap: break-word;
    word-break: break-word;
    padding-left: 45%; /* Место для заголовка слева */
    min-height: 24px;
}

.bagon-pa-discounts-table tr td:last-child {
     border-bottom: none;
     padding-left: 15px; /* Для блока с кнопками убираем отступ слева */
     padding-top: 15px;
     padding-bottom: 15px;
}

/* Добавляем текстовые метки */
.bagon-pa-discounts-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 15px;
    top: 12px;
    width: 40%;
    font-weight: bold;
    color: #fbd38d;
    text-align: left;
    font-size: 0.95em;
}

/* Скрываем метку для ячейки с действиями (кнопками), если она там появится */
.bagon-pa-discounts-table td:last-child::before {
    display: none;
}

/* Код купона */
.discount-code {
    font-weight: 600;
    color: #ffffff;
    background-color: #1f1f1f;
    padding: 6px 10px;
    border-radius: 4px;
    display: inline-block;
    border: 1px dashed #555;
    font-size: 1.1em;
}

/* Статус */
.discount-status-badge {
    padding: 4px 10px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.9em;
    color: #1c1c1c;
    display: inline-block;
}

.discount-status-badge.status-active {
    background-color: #48bb78; /* Зеленый */
}

.discount-status-badge.status-inactive {
    background-color: #718096; /* Серый */
    opacity: 0.7;
}

/* --- Стили для кнопок в таблице скидок --- */
.discount-actions-wrapper {
    display: flex;
    width: 100%;
    flex-direction: row;
    justify-content: flex-end; /* По умолчанию справа */
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* Разрешаем перенос */
}

.discount-actions-wrapper .button {
    flex-grow: 0;
    padding: 8px 15px;
    font-size: 0.9em;
    width: auto;
    box-sizing: border-box;
    text-decoration: none;
    text-align: center;
}

.button.apply-coupon {
    background-color: #48bb78;
    color: #0f0f0f;
}

.button.apply-coupon:hover {
    background-color: #38a169;
}

.button.remove-coupon {
    background-color: #f56565;
    color: #0f0f0f;
}

.button.remove-coupon:hover {
    background-color: #e53e3e;
}

.button.checkout-btn {
    background-color: #6e93d6;
    color: #0f0f0f;
}

.button.checkout-btn:hover {
    background-color: #4b6799;
}

/* --- АДАПТИВНОСТЬ ДЛЯ СКИДОК --- */
@media (max-width: 768px) {
    .discount-actions-wrapper {
        flex-direction: column;
        justify-content: center;
    }
    
    .discount-actions-wrapper .button {
        width: 100%; /* Кнопки на всю ширину на мобильных */
        flex-grow: 1;
    }

    .bagon-pa-discounts-table td {
        font-size: 0.95em; /* Чуть меньше шрифт на мобильных */
    }
}

/* === УЛУЧШЕНИЯ ДЛЯ БЛОКА СКИДОК (ПОЛЬЗОВАТЕЛЬСКИЕ ПРАВКИ) === */

/* Делаем карточки более воздушными */
.bagon-pa-discounts-table tr {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #4a4a4a;
}

.bagon-pa-discounts-table td {
    padding: 15px 20px; /* увеличиваем отступы */
}

/* Код купона – выделяем ярче */
.discount-code {
    background: linear-gradient(145deg, #2d2d2d, #1f1f1f);
    border: 1px solid #fbd38d;
    color: #fbd38d;
    font-weight: 700;
    font-size: 1.2em;
    padding: 8px 15px;
    border-radius: 30px; /* более округлый */
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
}

/* Бейдж статуса – добавляем иконки и делаем более заметным */
.discount-status-badge {
    position: relative;
    padding-left: 25px;
    border-radius: 30px;
    text-transform: uppercase;
    font-size: 0.8em;
    font-weight: 700;
    color: #fff;
    border: none;
}

.discount-status-badge.status-active {
    background-color: #48bb78;
}
.discount-status-badge.status-active::before {
    content: "✓";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
}

.discount-status-badge.status-inactive {
    background-color: #718096;
    opacity: 1;
}
.discount-status-badge.status-inactive::before {
    content: "✗";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
}

/* Кнопки – единый стиль */
.discount-actions-wrapper {
    gap: 15px;
}

.discount-actions-wrapper .button {
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Кнопка "Копіювати" – прозрачная с обводкой */
.button.copy-coupon {
    background: transparent;
    border: 1px solid #fbd38d;
    color: #fbd38d;
}

.button.copy-coupon:hover {
    background: rgba(251, 211, 141, 0.1);
    transform: translateY(-2px);
}

/* Кнопка "Застосувати до кошика" – градиент зелёный */
.button.apply-coupon {
    background: linear-gradient(145deg, #48bb78, #38a169);
    color: #fff;
}

.button.apply-coupon:hover {
    background: linear-gradient(145deg, #38a169, #2f8d5a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

/* Кнопка "Перейти до Оформлення" – градиент золотой */
.button.checkout-btn {
    background: linear-gradient(145deg, #fbd38d, #f9c972);
    color: #1a1a1a;
}

.button.checkout-btn:hover {
    background: linear-gradient(145deg, #f9c972, #f5b13a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(251, 211, 141, 0.3);
}

/* Кнопка "Скасувати" (remove) – красный градиент */
.button.remove-coupon {
    background: linear-gradient(145deg, #f56565, #e53e3e);
    color: #fff;
}

.button.remove-coupon:hover {
    background: linear-gradient(145deg, #e53e3e, #c53030);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 62, 62, 0.3);
}

/* Адаптивность */
@media (max-width: 768px) {
    .bagon-pa-discounts-table td {
        padding: 12px 15px;
        padding-left: 45%;
    }

    .discount-actions-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .discount-actions-wrapper .button {
        width: 100%;
    }

    .discount-code {
        font-size: 1em;
        padding: 5px 12px;
    }
}