/* ===== Основний контейнер віджета ===== */

.lyu-epg-wrapper {
    margin: 40px 0;
}

/* ===== Грід товарів ===== */

.lyu-epg-grid {
    list-style: none;
    margin: 0;
    padding: 0;

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 24px;
}

.lyu-epg-columns-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lyu-epg-columns-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lyu-epg-columns-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1024px) {
    .lyu-epg-columns-3,
    .lyu-epg-columns-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .lyu-epg-columns-2,
    .lyu-epg-columns-3,
    .lyu-epg-columns-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

/* ===== Карточка товару (темний стиль) ===== */

.lyu-epg-item {
    margin: 0;
    padding: 0;
}

.lyu-epg-card {
    background: radial-gradient(circle at top left, #261236 0%, #120916 45%, #050308 100%) !important;
    border-radius: 24px !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75) !important;
    padding: 20px 20px 18px !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
    position: relative;
    overflow: hidden;
}

/* неоновий фон при ховері */

.lyu-epg-card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle at 0% 0%, rgba(255, 0, 153, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(0, 204, 255, 0.18) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
}

.lyu-epg-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 20px 55px rgba(0, 0, 0, 0.9),
        0 0 30px rgba(255, 0, 128, 0.4) !important;
    border-color: rgba(255, 0, 153, 0.6) !important;
}

.lyu-epg-card:hover::before {
    opacity: 1;
}

.lyu-epg-card > * {
    position: relative;
    z-index: 1;
}

/* ===== Зображення товару + ховер ===== */

.lyu-epg-image-link {
    display: block;
    text-decoration: none;
    margin-bottom: 16px;
}

.lyu-epg-image-wrap {
    position: relative !important;
    width: 100% !important;
    padding-top: 130% !important;
    overflow: hidden !important;
    border-radius: 20px !important;
    background: #0f0b13 !important;
}

/* Обидва зображення */

.lyu-epg-img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}

/* Перша картинка – базова */

.lyu-epg-img-primary {
    opacity: 1 !important;
    z-index: 1 !important;
}

/* Друга – для ховера, але завжди існує як видимий елемент */

.lyu-epg-img-secondary {
    opacity: 0 !important;
    z-index: 2 !important;
    display: block !important;
    visibility: visible !important;
}

/* ВАЖЛИВО:
   Міняємо картинки місцями ТІЛЬКИ якщо є друга фотка
   (тобто на картках з класом .lyu-epg-has-secondary)
*/

.lyu-epg-has-secondary:hover .lyu-epg-img-primary {
    opacity: 0 !important;
    transform: scale(1.03) !important;
}

.lyu-epg-has-secondary:hover .lyu-epg-img-secondary {
    opacity: 1 !important;
    transform: scale(1.03) !important;
}

/* Якщо немає другої фотки — .lyu-epg-has-secondary немає,
   тому перша картинка НЕ ховається */

/* ===== Контент карточки ===== */

.lyu-epg-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.lyu-epg-title-link {
    text-decoration: none;
    color: inherit !important;
}

.lyu-epg-title {
    font-size: 15px;
    line-height: 1.35;
    font-weight: 600;
    margin: 0 0 4px;
    color: #f7e8ff !important;
}

/* Ціна */

.lyu-epg-price {
    font-size: 16px;
    font-weight: 700;
    color: #ffb3ff !important;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(255, 0, 153, 0.65);
}

/* Кнопка "Додати в кошик" */

.lyu-epg-add-to-cart-button {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;

    border-radius: 999px !important;
    padding: 9px 16px !important;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(255, 0, 153, 0.7) !important;

    background: radial-gradient(circle at 0 0, rgba(255, 0, 153, 0.35), rgba(5, 3, 8, 0.98)) !important;
    color: #ffffff !important;

    text-decoration: none !important;
    cursor: pointer;

    transition: background-color 0.2s ease, transform 0.15s ease,
        box-shadow 0.2s ease !important;
}

.lyu-epg-add-to-cart-button:hover {
    background: radial-gradient(circle at 0 0, rgba(255, 0, 153, 0.6), rgba(5, 3, 8, 0.98)) !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-1px) !important;
    box-shadow:
        0 0 18px rgba(255, 0, 153, 0.85),
        0 0 32px rgba(0, 204, 255, 0.35) !important;
}

.lyu-epg-add-to-cart-button:active {
    transform: translateY(0) !important;
    box-shadow: none !important;
}

.lyu-epg-btn-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* ===== Мобільна адаптація ===== */

@media (max-width: 480px) {
    .lyu-epg-card {
        padding: 16px 16px 14px !important;
        border-radius: 20px !important;
    }

    .lyu-epg-title {
        font-size: 14px;
    }

    .lyu-epg-price {
        font-size: 15px;
    }
}