/* Базовые стили контейнера */
#fp-converter {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
}

/* Заголовки (h2) */
.fp-title {
    font-size: 1.6em;
    margin-bottom: 10px;
    color: #2c3e50;
}

.fp-lead {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.fp-block-title {
    font-size: 1.5em;
    margin: 20px 0 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

/* Секция выбора продукта */
.fp-product-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.fp-search-wrap {
    position: relative;
    max-width: 600px;
}

.fp-search-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.3s;
}

.fp-search-input:focus {
    outline: none;
    border-color: #3498db;
}

.fp-search-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #3498db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.fp-search-list.active {
    display: block;
}

.fp-search-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.fp-search-item:hover {
    background: #e8f4f8;
}

.fp-chosen {
    margin-top: 15px;
    padding: 12px;
    background: #e8f4f8;
    border-radius: 6px;
    display: none;
}

.fp-chosen.active {
    display: block;
}

.fp-chosen-name {
    font-weight: bold;
    color: #2c3e50;
}

.fp-chosen-density {
    color: #666;
    font-size: 0.9em;
}

.fp-chosen-reset {
    float: right;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.fp-chosen-reset:hover {
    background: #c0392b;
}

/* Информационные блоки */
.fp-info {
    background: #e8f4f8;
    padding: 15px;
    border-left: 4px solid #3498db;
    margin-bottom: 20px;
    border-radius: 4px;
}

.fp-info.warn {
    background: #fff3cd;
    border-left-color: #ffc107;
}

/* Группа единиц измерения */
.fp-group {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.fp-gh {
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.fp-gh:hover {
    background: #e9ecef;
}

.fp-gh-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.fp-gh-count {
    color: #666;
    font-size: 0.9em;
}

.fp-gh-arrow {
    transition: transform 0.3s;
    color: #3498db;
}

.fp-group.open .fp-gh-arrow {
    transform: rotate(180deg);
}

.fp-gb {
    padding: 20px;
    display: none;
}

.fp-group.open .fp-gb {
    display: block;
}

.fp-note {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    color: #666;
    font-size: 0.95em;
}

/* Строки с ценами */
.fp-rows {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.fp-row {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.fp-rn {
    display: block;
    width: 100%;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    cursor: pointer;
    text-align: left;
}

.fp-rn--center {
    text-align: center;
}

.fp-rn--right {
    text-align: right;
}

.fp-abbr {
    color: #666;
    font-size: 0.85em;
    font-weight: normal;
}

.fp-in {
    width: 100%;
    padding: 8px 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.fp-in:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.fp-in.source {
    background: #e8f4f8;
    border-color: #3498db;
    font-weight: 600;
}

.fp-in:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.fp-copy {
    margin-top: 8px;
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    width: 100%;
}

.fp-copy:hover {
    background: #2980b9;
}

/* Таблицы */
.fp-tables {
    margin-top: 30px;
}

.fp-table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.fp-table-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

.fp-tcopy {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.fp-tcopy:hover {
    background: #229954;
}

.fp-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    background: white;
}

.fp-table th,
.fp-table td {
    padding: 10px 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.fp-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.fp-table tr:nth-child(even) {
    background: #f8f9fa;
}

/* FAQ секция */
.fp-faq {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.fp-faq h3 {
    color: #2c3e50;
    margin-top: 20px;
}

.fp-faq h3:first-child {
    margin-top: 0;
}

/* Статусные сообщения */
.fp-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
}

.fp-status.active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.fp-status.warn {
    background: #f39c12;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Кнопки действий */
.fp-actions {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.fp-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    margin-right: 10px;
    margin-bottom: 10px;
}

.fp-btn:hover {
    background: #2980b9;
}

.fp-hint {
    display: inline-block;
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .fp-title {
        font-size: 1.4em;
    }
    
    .fp-rows {
        grid-template-columns: 1fr;
    }
    
    .fp-table-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}