/* Основные стили для витрины Posiflora */
.posiflora-showcase {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Сетка букетов */
.posiflora-bouquets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 колонки равной ширины */
    grid-gap: 20px;
    margin-bottom: 30px;
}

/* Карточка букета */
.posiflora-bouquet-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.posiflora-bouquet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* Фиксированная высота изображения */
.posiflora-bouquet-image {
    height: 350px;
    overflow: hidden;
    position: relative;
}

.posiflora-bouquet-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.posiflora-bouquet-card:hover .posiflora-bouquet-image img {
    transform: scale(1.05);
}

.posiflora-bouquet-image.no-image {
    height: 250px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-style: italic;
}

.posiflora-bouquet-image .placeholder {
    padding: 20px;
    text-align: center;
}

/* Фиксированная высота контейнера с контентом */
.posiflora-bouquet-details {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Добавляем минимальную высоту для выравнивания */
    min-height: 180px;
    position: relative;
}

/* Фиксированная высота для названия букета */
.posiflora-bouquet-name {
    margin: 0 0 10px;
    font-size: 18px;
    color: #333;
    line-height: 1.3;
    height: 47px; /* Примерно 2 строки текста */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Фиксированная высота для описания */
.posiflora-bouquet-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 15px;
    line-height: 1.4;
    height: 60px; /* Фиксированная высота для 3 строк */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Позиционирование блока цены и кнопки внизу карточки */
.posiflora-bouquet-price {
    font-size: 20px;
    font-weight: bold;
    color: #B70013;
    margin-bottom: 15px;
    margin-top: auto;
}

.posiflora-buy-button {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #B70013;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.posiflora-buy-button:hover {
    background-color: #cc6666;
}

/* Пагинация */
.posiflora-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 20px;
}

.posiflora-pagination a, 
.posiflora-pagination span {
    display: inline-block;
    padding: 5px 12px;
    margin: 0 4px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.posiflora-pagination a {
    background-color: #f5f5f5;
}

.posiflora-pagination a:hover {
    background-color: #e0e0e0;
    color: #333;
}

.posiflora-current-page {
    background-color: #B70013;
    color: white !important;
}

.posiflora-prev-page,
.posiflora-next-page {
    font-weight: bold;
}

.posiflora-page-numbers {
    display: flex;
    align-items: center;
    margin: 0 10px;
}

.posiflora-page-dots {
    margin: 0 8px;
    color: #999;
}

/* Стили для модального окна */
.posiflora-modal-open {
    overflow: hidden;
}

.posiflora-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99999; /* Очень высокий z-index для перекрытия всех элементов */
    display: flex;
    align-items: center;
    justify-content: center;
}

.posiflora-modal {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative; /* Чтобы модальное окно не наследовало позиционирование родителей */
    margin: 0 auto; /* Центрирование по горизонтали */
}

.posiflora-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 2;
}

.posiflora-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.posiflora-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.posiflora-modal-body {
    padding: 20px;
}

/* Стили для формы заказа */
.posiflora-form-group {
    margin-bottom: 15px;
}

.posiflora-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.posiflora-form-group input,
.posiflora-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box; /* Чтобы padding не выходил за пределы width:100% */
}

.posiflora-form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.posiflora-submit-order {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #B70013;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.posiflora-submit-order:hover {
    background-color: #cc6666;
}

/* Отключение кнопки при отправке */
.posiflora-submit-order:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Стили для изображения в модальном окне */
.posiflora-modal-image {
    text-align: center;
    margin: 15px 0;
    border-radius: 4px;
    overflow: hidden;
    max-height: 300px;
}

.posiflora-modal-image img {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
}

/* Сообщения формы */
.posiflora-form-message {
    margin: 15px 0;
}

.posiflora-loading {
    display: block;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
    color: #6c757d;
    margin-bottom: 15px;
}

.posiflora-error {
    display: block;
    padding: 10px;
    background-color: #fff5f5;
    border-left: 4px solid #e53e3e;
    color: #e53e3e;
    margin-bottom: 15px;
}

/* Успешное завершение заказа */
.posiflora-success {
    text-align: center;
    padding: 20px 0;
}

.posiflora-checkmark {
    display: inline-block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    font-size: 40px;
    line-height: 60px;
    text-align: center;
    margin-bottom: 20px;
}

.posiflora-close-success {
    margin-top: 20px;
    padding: 10px 25px;
    background-color: #e91e63;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.posiflora-close-success:hover {
    background-color: #c2185b;
}

/* Стили для деталей заказа */
.posiflora-order-details {
    margin: 20px 0;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    text-align: left;
}

.posiflora-order-details h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.posiflora-order-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 15px;
}

.posiflora-order-table th,
.posiflora-order-table td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.posiflora-order-table th {
    background-color: #f0f0f0;
    font-weight: 600;
    color: #555;
}

.posiflora-order-table tr:last-child td {
    border-bottom: none;
}

.posiflora-order-details p {
    margin: 5px 0;
    font-size: 14px;
}

.posiflora-order-details p strong {
    display: inline-block;
    width: 80px;
    color: #555;
}

/* Анимация для улучшения UX */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.posiflora-modal-overlay {
    animation: fadeIn 0.3s ease;
}

/* Адаптивная верстка */
@media (max-width: 1200px) {
    .posiflora-bouquets-grid {
        grid-template-columns: repeat(4, 1fr); /* сохраняем 4 колонки */
    }
}

@media (max-width: 992px) {
    .posiflora-bouquets-grid {
        grid-template-columns: repeat(3, 1fr); /* уменьшаем до 3 колонок */
    }
}

@media (max-width: 768px) {
    .posiflora-bouquets-grid {
        grid-template-columns: repeat(2, 1fr); /* уменьшаем до 2 колонок */
    }
    
    .posiflora-bouquet-image {
        height: 400px;
    }
    
    .posiflora-bouquet-details {
        min-height: 160px;
    }
    
    .posiflora-modal-image {
        max-height: 400px;
    }
    
    .posiflora-modal-image img {
        max-height: 400px;
    }
}

@media (max-width: 576px) {
    .posiflora-bouquets-grid {
        grid-template-columns: 1fr; /* 1 колонка для мобильных */
    }
    
    .posiflora-modal {
        width: 95%;
        max-width: none;
    }
    
    .posiflora-pagination {
        flex-wrap: wrap;
    }
    
    .posiflora-page-numbers {
        margin: 10px 0;
    }
}
/* Стили для радио-кнопок выбора доставки */
.posiflora-delivery-options {
    margin-top: 5px;
}

.posiflora-radio {
    display: block;
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 15px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.posiflora-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.posiflora-radio-label:before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    background-color: #fff;
    transition: all 0.2s ease;
}

.posiflora-radio input:checked ~ .posiflora-radio-label:before {
    border-color: #e91e63;
}

.posiflora-radio-label:after {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #B70013;
    transition: all 0.2s ease;
    opacity: 0;
    transform: scale(0);
}

.posiflora-radio input:checked ~ .posiflora-radio-label:after {
    opacity: 1;
    transform: scale(1);
}

/* Анимация показа/скрытия поля адреса */
.posiflora-address-group {
    transition: all 0.3s ease;
    overflow: hidden;
}