/**
 * PG Cookie Control - Joomla Plugin
 * @copyright   © 2026 Параллель групп
 * @version     2.0.0
 */

/* Базовые стили */
.pg-cookie-bar {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* Угловые позиции - фиксированная ширина 400px */
.pg-cookie-bar[style*="top: 20px"][style*="left: 20px"],
.pg-cookie-bar[style*="top: 20px"][style*="right: 20px"],
.pg-cookie-bar[style*="bottom: 20px"][style*="left: 20px"],
.pg-cookie-bar[style*="bottom: 20px"][style*="right: 20px"] {
    width: 400px;
    max-width: calc(100% - 40px);
}

/* Позиции сверху и снизу на всю ширину */
.pg-cookie-bar[style*="top: 0px"][style*="left: 0px"][style*="right: 0px"],
.pg-cookie-bar[style*="bottom: 0px"][style*="left: 0px"][style*="right: 0px"] {
    width: 100%;
    max-width: 100%;
    border-radius: 0 !important;
}

.pg-cookie-bar[style*="top: 0px"][style*="left: 0px"][style*="right: 0px"] {
    border-radius: 0 0 8px 8px !important;
}

.pg-cookie-bar[style*="bottom: 0px"][style*="left: 0px"][style*="right: 0px"] {
    border-radius: 8px 8px 0 0 !important;
}

/* Центральная позиция */
.pg-cookie-bar[style*="center"] {
    max-width: 90%;
    width: 450px;
}

/* Контейнер */
.pg-cookie-container {
    margin: 0 auto;
    display: flex;
    gap: 15px;
    width: 100%;
}

/* ГОРИЗОНТАЛЬНЫЙ ЛАЙАУТ */
.pg-cookie-layout-horizontal .pg-cookie-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

/* ВЕРТИКАЛЬНЫЙ ЛАЙАУТ */
.pg-cookie-layout-vertical .pg-cookie-container {
    flex-direction: column;
    align-items: stretch;
}

/* КНОПКИ СНИЗУ */
.pg-cookie-layout-buttons-bottom .pg-cookie-container {
    flex-direction: column;
    align-items: stretch;
}

.pg-cookie-layout-buttons-bottom .pg-cookie-message {
    width: 100%;
    text-align: center;
}

.pg-cookie-layout-buttons-bottom .pg-cookie-buttons {
    width: 100%;
    justify-content: center !important;
}

/* Сообщение */
.pg-cookie-message {
    flex: 1;
    min-width: 200px;
}

.pg-cookie-message p {
    margin: 0 0 5px 0;
}

.pg-cookie-message a {
    text-decoration: underline;
}

.pg-cookie-message a:hover {
    opacity: 0.8;
}

/* Блок кнопок */
.pg-cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Направление кнопок */
.pg-cookie-buttons-row {
    flex-direction: row;
}

.pg-cookie-buttons-column {
    flex-direction: column;
}

/* Выравнивание кнопок */
.pg-cookie-buttons-left {
    justify-content: flex-start;
}

.pg-cookie-buttons-center {
    justify-content: center;
}

.pg-cookie-buttons-right {
    justify-content: flex-end;
}

/* Кнопки */
.pg-cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    display: inline-block;
    text-align: center;
    transition: all 0.2s ease;
}

.pg-cookie-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* Ссылка подробнее */
.pg-cookie-more-link {
    padding: 8px 12px;
    text-decoration: underline;
    font-size: 14px;
    display: inline-block;
    transition: opacity 0.2s;
}

.pg-cookie-more-link:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* Кнопка закрытия */
.pg-cookie-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: bold;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.pg-cookie-close:hover {
    opacity: 1;
}

/* ========== АДАПТИВНОСТЬ ========== */

/* Планшеты */
@media (max-width: 1024px) {
    .pg-cookie-bar {
        padding: 12px 18px;
    }
    
    .pg-cookie-message {
        font-size: 13px;
    }
    
    .pg-cookie-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .pg-cookie-bar {
        padding: 12px 15px;
    }
    
    /* На мобильных угловые позиции тоже становятся на всю ширину */
    .pg-cookie-bar[style*="top: 20px"][style*="left: 20px"],
    .pg-cookie-bar[style*="top: 20px"][style*="right: 20px"],
    .pg-cookie-bar[style*="bottom: 20px"][style*="left: 20px"],
    .pg-cookie-bar[style*="bottom: 20px"][style*="right: 20px"] {
        width: auto;
        max-width: none;
        left: 10px !important;
        right: 10px !important;
        top: 10px !important;
        bottom: 10px !important;
    }
    
    .pg-cookie-layout-horizontal .pg-cookie-container {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .pg-cookie-buttons {
        justify-content: center !important;
        width: 100%;
    }
    
    .pg-cookie-btn {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
    }
    
    .pg-cookie-message {
        width: 100%;
        text-align: center;
    }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
    .pg-cookie-bar {
        padding: 10px 12px;
    }
    
    .pg-cookie-bar[style*="top: 20px"][style*="left: 20px"],
    .pg-cookie-bar[style*="top: 20px"][style*="right: 20px"],
    .pg-cookie-bar[style*="bottom: 20px"][style*="left: 20px"],
    .pg-cookie-bar[style*="bottom: 20px"][style*="right: 20px"] {
        left: 5px !important;
        right: 5px !important;
        top: 5px !important;
        bottom: 5px !important;
    }
    
    .pg-cookie-message {
        font-size: 12px;
    }
    
    .pg-cookie-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .pg-cookie-buttons-row {
        flex-direction: column;
    }
    
    .pg-cookie-btn {
        width: 100%;
        padding: 8px 12px;
    }
    
    .pg-cookie-more-link {
        width: 100%;
        text-align: center;
        padding: 8px;
    }
}

/* Анимация */
@keyframes pgCookieFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pgCookieFadeInCenter {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes pgCookieFadeInCorner {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pg-cookie-bar {
    animation: pgCookieFadeIn 0.3s ease-out;
}

.pg-cookie-bar[style*="center"] {
    animation: pgCookieFadeInCenter 0.3s ease-out;
}

.pg-cookie-bar[style*="top: 20px"][style*="right: 20px"],
.pg-cookie-bar[style*="bottom: 20px"][style*="right: 20px"] {
    animation: pgCookieFadeInCorner 0.3s ease-out;
}

.pg-cookie-bar[style*="top: 20px"][style*="left: 20px"],
.pg-cookie-bar[style*="bottom: 20px"][style*="left: 20px"] {
    animation: pgCookieFadeInCorner 0.3s ease-out;
}